2019-01-14 15:56:17 +08:00
|
|
|
|
# Manjaro 初始配置
|
|
|
|
|
|
2019-07-10 11:17:06 +08:00
|
|
|
|
## 使用国内软件源
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
2019-07-04 20:25:23 +08:00
|
|
|
|
*注:该操作会修改 /etc/pacman.d/mirrorlist 文件,使用前请先备份。*
|
2019-07-04 12:06:49 +08:00
|
|
|
|
|
|
|
|
|
生成可用中国镜像站列表:
|
|
|
|
|
|
|
|
|
|
```sh
|
2019-07-05 20:20:50 +08:00
|
|
|
|
pacman-mirrors -i -c China -m rank
|
2019-07-04 12:06:49 +08:00
|
|
|
|
```
|
|
|
|
|
|
2019-07-10 11:17:06 +08:00
|
|
|
|
勾选任意软件源,如 <http://mirrors.ustc.edu.cn/manjaro/> ,然后按 OK 键两次。最后刷新缓存:
|
2019-01-14 15:56:17 +08:00
|
|
|
|
|
|
|
|
|
```sh
|
2019-07-05 20:20:50 +08:00
|
|
|
|
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-07-04 13:43:59 +08:00
|
|
|
|
## 切换主目录为英文
|
|
|
|
|
|
|
|
|
|
中文系统默认主目录下文件夹名为中文,在 shell 下访问太过费事,最好改为英文。方法是修改 ~/.config/user-dirs.dirs 文件内容如下,之后将各目录修改为对应的英文名,然后重新登陆该账户即可:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
XDG_DESKTOP_DIR="$HOME/Desktop"
|
|
|
|
|
XDG_DOWNLOAD_DIR="$HOME/Downloads"
|
|
|
|
|
XDG_TEMPLATES_DIR="$HOME/Templates"
|
|
|
|
|
XDG_PUBLICSHARE_DIR="$HOME/Public"
|
|
|
|
|
XDG_DOCUMENTS_DIR="$HOME/Documents"
|
|
|
|
|
XDG_MUSIC_DIR="$HOME/Music"
|
|
|
|
|
XDG_PICTURES_DIR="$HOME/Pictures"
|
|
|
|
|
XDG_VIDEOS_DIR="$HOME/Videos"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
之后:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
gsettings set org.blueman.transfer shared-path '/home/<user name>/Downloads'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
或通过:
|
|
|
|
|
|
|
|
|
|
```sh
|
2019-07-05 20:20:50 +08:00
|
|
|
|
blueman-services
|
2019-07-04 13:43:59 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
重新配置,否则重启会提示:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
Configured directory for incoming files does not exist
|
|
|
|
|
```
|
|
|
|
|
|
2019-01-14 15:56:17 +08:00
|
|
|
|
## 安装常用工具
|
|
|
|
|
|
2019-07-01 14:50:29 +08:00
|
|
|
|
```sh
|
2019-07-04 13:34:09 +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 aria2
|
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-12 06:01:15 +08:00
|
|
|
|
## 安装 Gnome
|
|
|
|
|
|
|
|
|
|
使用下列命令安装 Gnome 并安装 Gnome 配置工具(gnome-tweaks):
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
pacman -S gnome gnome-extra gnome-tweaks chrome-gnome-shell gnome-shell-extensions
|
|
|
|
|
```
|
|
|
|
|
|
2019-07-12 06:05:27 +08:00
|
|
|
|
使用下列命令安装 Flatix 和 Papirus 主题:
|
2019-07-12 06:01:15 +08:00
|
|
|
|
|
|
|
|
|
```sh
|
2019-07-12 06:05:27 +08:00
|
|
|
|
pacman -S flatix-theme flatix-theme-dark papirus-icon-theme papirus-maia-icon-theme
|
2019-07-12 06:01:15 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
之后可在 gnome-tweaks 中更换主题。
|
|
|
|
|
|
|
|
|
|
访问 <https://extensions.gnome.org> 搜索 AlternateTab 扩展,在网页上安装浏览器插件后可在扩展的首页右上角看到开关按钮,点击打开就会自动安装,之后在 gnome-tweaks 可以找到该扩展,使能该扩展实现“仅在当前工作区中切换窗口”的功能。
|
|
|
|
|
|
2019-07-11 16:49:22 +08:00
|
|
|
|
### 安装 fcitx 输入法
|
2019-07-04 12:06:49 +08:00
|
|
|
|
|
|
|
|
|
输入以下命令安装 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-11 16:49:22 +08:00
|
|
|
|
### 安装 IBus 输入法
|
|
|
|
|
|
2019-07-12 04:49:27 +08:00
|
|
|
|
输入以下命令安装 ibus。
|
2019-07-11 16:49:22 +08:00
|
|
|
|
|
2019-07-12 04:49:27 +08:00
|
|
|
|
```sh
|
|
|
|
|
pacman -S ibus ibus-libpinyin
|
|
|
|
|
yaourt ibus-qt
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
添加如下代码到 ~/.xprofile,如果该文件不存在则创建一份。
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
export GTK_IM_MODULE=ibus
|
|
|
|
|
export QT_IM_MODULE=ibus
|
|
|
|
|
export XMODIFIERS=@im=ibus
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
如果是 Gnome 桌面,进入 Gnome 设置,选择区域和语言,将输入源配置为“汉语(Intelligent Pinyin)”,并提升为第一个(这个输入法与 Gnome 兼容最好)。点击 Intelligent Pinyin 的设置,将"常规“中”语言初始状态“设置为”英文“;将”快捷键“中“切换中文/英文模式”快捷键设置为“Shift”。
|
2019-07-11 16:49:22 +08:00
|
|
|
|
|
|
|
|
|
*注:如果有多个输入法,可以使用 im-config 工具进行切换。*
|
|
|
|
|
|
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>
|
|
|
|
|
```
|
2019-07-31 18:16:26 +08:00
|
|
|
|
|
|
|
|
|
## 配置 Bash
|
|
|
|
|
|
|
|
|
|
在 ~/.bash_profile 中增加
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
alias ls='ls --color=auto'
|
|
|
|
|
alias dir='dir --color=auto'
|
|
|
|
|
alias vidr='vdir --color=auto'
|
|
|
|
|
alias grep='grep --color=auto'
|
|
|
|
|
alias fgrep='fgrep --color=auto'
|
|
|
|
|
alias egrep='egrep --color=auto'
|
|
|
|
|
# some more ls aliases
|
|
|
|
|
alias ll='ls -alF'
|
|
|
|
|
alias la='ls -A'
|
|
|
|
|
alias l='ls -CF'
|
|
|
|
|
```
|