2019-01-14 15:56:17 +08:00
|
|
|
|
# Manjaro 初始配置
|
|
|
|
|
|
|
|
|
|
## 使用中科大软件源
|
|
|
|
|
|
2019-07-04 12:06:49 +08:00
|
|
|
|
*注:该操作会修改 /etc/pacmand.d/mirrorlist 文件,使用前请先备份。*
|
|
|
|
|
|
|
|
|
|
生成可用中国镜像站列表:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
sudo pacman-mirrors -i -c China -m rank
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
勾选 <http://mirrors.ustc.edu.cn/manjaro/> ,然后按 OK 键两次。最后刷新缓存:
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
|
|
|
|
```sh
|
2019-07-04 12:06:49 +08:00
|
|
|
|
sudo pacman -Syy
|
2019-01-14 15:56:17 +08:00
|
|
|
|
```
|
|
|
|
|
|
2019-03-27 22:50:56 +08:00
|
|
|
|
## 使用 AUR 镜像
|
|
|
|
|
|
|
|
|
|
修改 /etc/yaourtrc,去掉 # AURURL 的注释,修改为
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
AURURL="https://aur.tuna.tsinghua.edu.cn"
|
|
|
|
|
```
|
2019-03-27 22:50:56 +08:00
|
|
|
|
|
2019-07-04 13:15:39 +08:00
|
|
|
|
## 升级软件包
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
pacman -Syu
|
|
|
|
|
```
|
|
|
|
|
|
2019-01-14 15:56:17 +08:00
|
|
|
|
## 安装和配置网络
|
|
|
|
|
|
|
|
|
|
首先要安装网络工具:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
pacman -S net-tools
|
|
|
|
|
pacman -S networkmanager
|
|
|
|
|
```
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
|
|
|
|
之后可以通过:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
ifconfig <ethX> up
|
|
|
|
|
```
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
|
|
|
|
开启网络,通过:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
systemctl start NetworkManager
|
|
|
|
|
```
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
|
|
|
|
开启网络服务。之后才能正确获取 ip 地址。
|
|
|
|
|
|
|
|
|
|
## 安装和配置声音
|
|
|
|
|
|
|
|
|
|
首先要安装:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
pacman -S alsa-utils
|
|
|
|
|
pacman -S extra/alsa-firware
|
|
|
|
|
```
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
|
|
|
|
之后使用 amixer 或 alsamixer 进行配置:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
amixer sset Master unmute
|
|
|
|
|
amixer sset Speaker unmute
|
|
|
|
|
amixer sset Headphone unmute
|
|
|
|
|
alsamixer
|
|
|
|
|
```
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
|
|
|
|
最后使用:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
speaker-test -c 2
|
|
|
|
|
```
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
|
|
|
|
对 2 通道声音进行测试。
|
|
|
|
|
|
|
|
|
|
## 安装和配置显卡
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
pacman -S intel-media-driver
|
|
|
|
|
```
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
|
|
|
|
具体可参考:<https://wiki.archlinux.org/index.php/Hardware_video_acceleration>
|
|
|
|
|
|
2019-01-14 22:15:41 +08:00
|
|
|
|
## 切换系统语言
|
|
|
|
|
|
|
|
|
|
编辑 /etc/locale.gen 为:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
en_US.UTF-8 UTF-8
|
|
|
|
|
```
|
2019-01-14 22:15:41 +08:00
|
|
|
|
|
|
|
|
|
和 /etc/locale.conf 为:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
LANG="en_US.UTF-8"
|
|
|
|
|
```
|
2019-01-14 22:15:41 +08:00
|
|
|
|
|
2019-01-14 22:50:35 +08:00
|
|
|
|
最后:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
locale-gen "en_US.UTF-8"
|
|
|
|
|
```
|
2019-01-14 22:50:35 +08:00
|
|
|
|
|
2019-01-14 15:56:17 +08:00
|
|
|
|
## 安装常用工具
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
2019-07-04 13:15:39 +08:00
|
|
|
|
pacman -S base-devel git gcc make cmake gdb python2 python3 go arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-newlib tmux openssh samba ntfs-3g vim bzip2 coreutils ncurses xz unrar unzip zip
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
2019-07-04 12:06:49 +08:00
|
|
|
|
另外需要安装 flex、bison、libncurses5-dev 等。
|
|
|
|
|
|
|
|
|
|
### 安装防火墙
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
pacman -S firewalld
|
|
|
|
|
```
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
2019-07-04 12:06:49 +08:00
|
|
|
|
### 安装 fcitx
|
|
|
|
|
|
|
|
|
|
输入以下命令安装 fcitx-im 默认安装全部软件,并安装 google 拼音输入法:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
pacman -S fcitx-im fcitx-configtool fcitx-googlepinyin
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
默认会自动运行 fictx 程序,如果该程序没有自动启动,则运行下列命令:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
cp /etc/xdg/autostart/fcitx-autostart.desktop ~/.config/autostart/
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
添加如下代码到 ~/.xprofile,如果该文件不存在则创建一份。
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
export GTK_IM_MODULE=fcitx
|
|
|
|
|
export QT_IM_MODULE=fcitx
|
|
|
|
|
export XMODIFIERS=@im=fcitx
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
之后运行 fictx 诊断程序,如果诊断错误则按提示进行修正,如果诊断没有发现问题则重启即可。
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
fcitx-diagnose
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
默认通过 ctrl+space 来切换输入法。
|
2019-01-16 17:00:57 +08:00
|
|
|
|
|
2019-07-04 13:15:39 +08:00
|
|
|
|
### 安装 Qt
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
pacman -S qtcreator qt5-base qt5-doc
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 音乐播放
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
pacman -S rhythmbox
|
|
|
|
|
```
|
|
|
|
|
|
2019-01-16 09:51:30 +08:00
|
|
|
|
## VMTools
|
|
|
|
|
|
|
|
|
|
如果 Manjaro 作为 VirtualBox 的 Guest 来运行,则需要安装 VMTools,命令如下:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
pacman -S virtualbox-guest-utils
|
|
|
|
|
```
|
2019-01-16 09:51:30 +08:00
|
|
|
|
|
|
|
|
|
一定不要使用 VM 的菜单来安装工具。
|
|
|
|
|
|
2019-01-14 15:56:17 +08:00
|
|
|
|
## 提升权限
|
|
|
|
|
|
|
|
|
|
普通用户可能无法访问某些设备,需要提升权限:
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
|
|
|
|
gpasswd --add <user name> dialout
|
|
|
|
|
groups <user name>
|
|
|
|
|
```
|