Manjaro 配置指南
Manjaro is a user-friendly Linux distribution based on the independently developed Arch operating system.

1. Post-Installation Configuration
Section titled “1. Post-Installation Configuration”Set Language
Section titled “Set Language”Add the following to your ~/.bashrc or ~/.zshrc file to set the system language to English (US).
export LANGUAGE=en_US.utf8export LC_ALL=en_US.utf8export LANG=en_US.utf8Change Source Mirror
Section titled “Change Source Mirror”To improve download speeds, switch to a faster mirror (e.g., SJTU in China).
-
Update mirror list:
Terminal window sudo pacman -Syysudo pacman-mirrors -i -c China -m ranksudo pacman -Syyu -
Add Arch Linux CN repository:
Edit
/etc/pacman.confand add the following lines:[archlinuxcn]SigLevel = Optional TrustedOnlyServer = https://mirrors.sjtug.sjtu.edu.cn/archlinux-cn/$arch -
Update and install keyring:
Terminal window sudo pacman -Syy && sudo pacman -S archlinuxcn-keyringsudo pacman -Su
Configure Proxy for Pacman
Section titled “Configure Proxy for Pacman”If you are behind a proxy, configure pacman to use it.
Option 1: Using curl
Section titled “Option 1: Using curl”Edit /etc/pacman.conf:
XferCommand = /usr/bin/curl -x http://127.0.0.1:8888 -C - -f %u --output %oOption 2: Using wget
Section titled “Option 2: Using wget”Edit /etc/pacman.conf:
XferCommand = /usr/bin/wget -e http_proxy=http://127.0.0.1:8888 --passive-ftp -c -O %o %uAlternatively, configure wget globally:
-
Edit
/etc/wgetrc:https_proxy = http://127.0.0.1:8888http_proxy = http://127.0.0.1:8888ftp_proxy = http://127.0.0.1:8888 -
Then update
/etc/pacman.conf:XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
2. Software Installation
Section titled “2. Software Installation”Install Common Dependencies
Section titled “Install Common Dependencies”Install a set of commonly used development libraries and tools.
sudo pacman -S clang make cmake gdb c-ares cunit graphviz gnutls gmp expat curl autoconf automake icu libconfig libgcrypt pkgconf libssh2 libuv libxml2 libxml++ make ncurses nettle nodejs nodejs-material-design-icons openssh openssl pcre pcre2 postfix sqlite zlib wget tar git vim htop ncdu axel privoxyInstall Tmux
Section titled “Install Tmux”sudo pacman -S tmuxInstall and Configure Zsh
Section titled “Install and Configure Zsh”-
Install Zsh and Oh My Zsh:
Terminal window sudo pacman -S zsh zsh-loverssh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" -
Install Plugins and Themes:
Terminal window git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10kgit clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting -
Configure
~/.zshrc:Add the following configuration to your
~/.zshrc:Terminal window export TERM="xterm-256color"ZSH_THEME="powerlevel10k/powerlevel10k"#POWERLEVEL9K_MODE="nerdfont-complete"POWERLEVEL9K_PROMPT_ON_NEWLINE=truePOWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon user dir_writable dir vcs)POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time root_indicator background_jobs time disk_usage ram load)POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""POWERLEVEL9K_USER_ICON="\uF415" # <U+F415>POWERLEVEL9K_ROOT_ICON="\uF09C"POWERLEVEL9K_SUDO_ICON=$'\uF09C' # <U+F09C>POWERLEVEL9K_TIME_FORMAT="%D{%H:%M}"POWERLEVEL9K_VCS_GIT_ICON='\uF408'POWERLEVEL9K_VCS_GIT_GITHUB_ICON='\uF408'
Using System Zsh Configuration
Section titled “Using System Zsh Configuration”If you chose Zsh during Manjaro installation, you can install the official Manjaro Zsh packages:
sudo pacman -S acpi awesome-terminal-fonts git mercurial powerline-fonts systemd manjaro-zsh-config zsh-autosuggestions zsh-completions zsh-history-substring-search zsh-lovers zsh-syntax-highlighting zsh-theme-powerlevel9kThen, enable the Powerlevel9k theme:
echo 'source /usr/share/zsh-theme-powerlevel9k/powerlevel9k.zsh-theme' >> ~/.zshrcInstall Fonts (FiraCode)
Section titled “Install Fonts (FiraCode)”Install Nerd Fonts for better terminal icons.
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zipunzip FiraCode.ziprm Fura*.otfrm Fura*Windows*.ttfsudo mkdir -p /usr/share/fonts/TTFsudo mv Fura*.ttf /usr/share/fonts/TTF/fc-cache -fvInstall Samba
Section titled “Install Samba”Set up file sharing with Samba.
-
Install packages:
Terminal window sudo pacman -S samba gvfs-smb thunar-shares-plugin manjaro-settings-samba -
Configure Samba:
Terminal window sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.origsudo touch /etc/samba/smbpasswdsudo vim /etc/samba/smb.confExample
smb.conf:[global]workgroup = WORKGROUPsecurity = usernetbios name = Manjarohosts allow = 192.168.120.passdb backend = smbpasswdencrypt passwords = truesmb passwd file = /etc/samba/smbpasswdlog file = /var/log/samba/log.%mmax open files = 1000[public]comment = Manjaro publicpath = /publicvalid users = lxwritable = yesbrowseable = yesavailable = yes -
Finalize setup:
Terminal window testparmsudo smbpasswd -a lxsudo systemctl enable smb nmbsudo systemctl start smb nmbsudo reboot
Install Aria2
Section titled “Install Aria2”Install Aria2 (example with version 1.35.0).
wget https://github.com/aria2/aria2/releases/download/release-1.35.0/aria2-1.35.0.tar.gztar zxf aria2-1.35.0.tar.gzcd aria2-1.35.0./configure --prefix=/public/software/aria2-1.35.0makemake installWebUI for Aria2
Section titled “WebUI for Aria2”git clone git@github.com:ziahamza/webui-aria2.gitcd webui-aria2/public/software/aria2-1.35.0/bin/aria2c --enable-rpc --rpc-listen-allnode node-server.js3. Development Environment
Section titled “3. Development Environment”-
Configure Mirrors:
Add to
~/.bashrcor~/.zshrc:Terminal window export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-staticexport RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup -
Install Rust:
Terminal window curl -sSf https://sh.rustup.rs | shsource $HOME/.cargo/env -
Configure Cargo Mirror:
Add to
~/.cargo/config:[source.crates-io]registry = "https://github.com/rust-lang/crates.io-index"replace-with = 'ustc'[source.ustc]registry = "git://mirrors.ustc.edu.cn/crates.io-index" -
Install Tools (lsd & exa):
Terminal window cargo install lsd exa
Perl Packages
Section titled “Perl Packages”Install common Perl modules using cpan.
cpan -i Term::ReadLine::Perlcpan -i Log::Log4perlcpan -i Module::Buildcpan -i JSONcpan -i Getopt::Longcpan -i Parallel::ForkManagercpan -i YAML::Anycpan -i Date::Manipcpan -i Math::BigFloatcpan -i Math::Complexcpan -i List::Utilcpan -i PAR::Packer4. Input Methods (Optional)
Section titled “4. Input Methods (Optional)”Google Pinyin
Section titled “Google Pinyin”sudo pacman -S fcitx-im fcitx-configtool fcitx-googlepinyinvim ~/.xprofileAdd the following to ~/.xprofile:
export LC_ALL=zh_CN.UTF-8export GTK_IM_MODULE=fcitxexport QT_IM_MODULE=fcitxexport XMODIFIERS="@im=fcitx"Sogou Pinyin
Section titled “Sogou Pinyin”sudo pacman -S fcitx-im fcitx-configtool fcitx-sogoupinyinvim ~/.xprofileAdd the following to ~/.xprofile:
export GTK_IM_MODULE=fcitxexport QT_IM_MODULE=fcitxexport XMODIFIERS="@im=fcitx"5. Tips & Tricks
Section titled “5. Tips & Tricks”Pacman Commands
Section titled “Pacman Commands”| Command | Description |
|---|---|
pacman -S package_name | Install a package |
pacman -S extra/package_name | Install a version from a specific repository |
pacman -Syu | Update package database and upgrade system |
pacman -Ss string | Search for a package in the database |
pacman -Si package_name | Show detailed information about a package |
pacman -Sc | Clear package cache (files in /var/cache/pacman/pkg) |
pacman -Scc | Clear all cache files |
pacman -R package_name | Remove a single package |
pacman -Rs package_name | Remove a package and its unused dependencies |
pacman -Qs string | Search for installed packages |
pacman -Qi package_name | Show detailed information about an installed package |
pacman -Ql package_name | List files owned by an installed package |
pacman -U package.tar.zx | Install from a local file |
pactree package_name | Show dependency tree of a package |
Useful Software
Section titled “Useful Software”# Google Chromesudo pacman -S google-chrome
# VS Codesudo pacman -S visual-studio-code-bin
# NetEase Cloud Musicsudo pacman -S netease-cloud-music
# WPS Officesudo pacman -S wps-office ttf-wps-fonts
# TeXLivesudo pacman -S texlive-most texlive-langchinese texstudioElectron-based Software
Section titled “Electron-based Software”# ShadowsocksR clientsudo pacman -S electron-ssr
# Unofficial NetEase Cloud Music clientsudo pacman -S electron-netease-cloud-music
# WeChat clientsudo pacman -S electronic-wechat
# Microsoft Teams clientsudo pacman -S teams-for-linux
# Chinese handwriting IMEsudo pacman -S google-chinese-handwriting-ime-git