记录一下这个过程中踩的所有坑。
1. 安装系统(跳过)
2. 配置系统
换源
输入
sudo pacman-mirrors -i -c China -m rank
选择比较快的,然后 修改 /etc/pacman.conf, 在里面追加
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
也可以用其他的源, 如 https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
然后执行命令
sudo pacman -Syy
更新源,导入GPG Key
sudo pacman -S archlinuxcn-keyring
sudo pacman -Syyu
这一步需要等很长时间。 期间经常提醒一些包由于速度下载太慢,失败了。 源为: mirrors.tuna.tsinghua.edu.cn
不知道是不是我在上面第一个命令弹出的对话框里面选择了3个源的原因。
重新操作了一遍,现在一切正常。现在进行下一步。
多线程下载
#配置 Pacman 多线程下载
sudo pacman -S axel
sudo vim /etc/pacman.conf
#注释已有的 XferCommand 新增一行
XferCommand = /usr/bin/axel -n 16 %u -o %o
安装输入法
这里有两种选择,谷歌输入法 和 搜狗输入法
sudo pacman -S fcitx-im
suso pacman -S fcitx-configtool
sudo pacman -S fcitx-sogoupinyin
或
sudo pacman -S fcitx-googlepinyin
安装完成后需要添加 ~/.xprofile, 然后重启
export GTK_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
安装google chrome
sudo pacman -S google-chrome
安装zsh
sudo pacman -S zsh
echo $SHELL # 查看当前的shell
chsh -s /bin/zsh # 修改shell
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
sudo pacman -S autojump
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
配置git
git config --global user.name 'xxxxx'
git config --global user.email 'xxxxx'
vim ~/.gitconfig
# 在最后加上
[credential]
helper = store
这样就不用在push的时候反复输入密码了,省了不少的事儿
3. 配置开发环境
安装数据库
sudo pacman -S mysql
# 安装完成后会有如下提示
(3/4) installing mysql-clients
(4/4) installing mysql
:: You need to initialize the MySQL data directory prior to starting
the service. This can be done with mysqld --initialize command, e.g.:
mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
:: Additionally you should secure your MySQL installation using
mysql_secure_installation command after starting the mysqld service
# 接下来使用上面提示的信息,输入
mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql
# 以及
mysql_secure_installation
*** 每次重装系统配置的时候都会出现不同的问题,真是醉了!!!
这次的问题是protobuf的版本问题,系统的protobuf版本是20,而mysql需要的是18,所以我还要自己去git上下载源码,然后编 译出18的版本来,编译的过程漫长。。。
然而,网上查找说需要protobuf v3.8, 于是从网上下载了protobuf v3.8 然后编译了20来分钟,结果出来的是libprotobuf- lite.so.19,简直要哭了。 于是放弃了用mysql,改用mariadb, 跟之前项目用的数据库是兼容的。
sudo pacman -S mariadb
# 安装完成后也会有提示,按照提示给信息输入命令, 同上!
sudo pacman -S redis
# 项目需要用redis,很方便的数据库
安装 workbench
选择的是 DBeaver, 支持很多数据库
sudo pacman -S dbeaver
安装开发工具
sudo pacman -S vscode
# sudo pacman -S pycharm-professional
设置数据库自动启动
systemctl enable mysqld
systemctl enable redis
# 启动他们
systemctl start mysqld
systemctl start redis
至此告一段落,下一篇文章将继续介绍后续的实际开发中的问题
参考博客:
https://www.jianshu.com/p/47e3658af6c5
https://www.linux265.com/news/3821.html
https://cloud.tencent.com/developer/article/1390999