Installation and use of archlinux super detailed tutorial

Installation system

1, Download media

2, Launch ISO to Live environment

There are many ways to do this:

  • Make ISO as the U-disk starting tool, you can use Ultra ISO or cabbage
  • If you have Linux/Unix system, you can write Grub to your hard disk and make startup items

3, Preparation before installation

Start iso to live environment, log in, and place install.txt file in / root, ArchLinux for reference.

Verify startup mode

If you enable UEFI mode on the UEFI motherboard, arch ISO will use SYSTEMd boot to start Arch Linux.

ls /sys/firmware/efi/efivars

If the directory does not exist, the system may boot in BIOS or CSM mode

Connect to the Internet

  • Make sure that the system has network interface enabled, check with IP link (8):
ip link
# netctl open wifi
  • If ADSL broadband connection is adopted
# perhaps
systemctl start adsl
  • ping check network connection

Synchronous system clock

timedatectl set-ntp true
timedatectl status

Set up hard disk partition

  • Disk planning
Mount point during installation Partition of the installation process Partition after installation Recommended size
/mnt/boot/efi/ /dev/nvme1n1p1 EFI system partition 260-512MiB
/mnt/ /dev/nvme1n1p7 / 512MiB-50GiB
/mnt/var/ /dev/nvme1n1p8 /var/ Greater than 100GiB
/mnt/home/ /dev/sda2 /home Greater than 1TiB
# View the current partition
fdisk -l
fdisk /dev/sdX1
# Enter disk operation. Enter m for help. Enter g to create gpt partition table, p to list partition, d to delete partition, n to create partition, q to exit.
#Input: n add a partition


#Prompt to enter the start sector (512B for a sector, calculate according to the partition capacity)
#Enter 2048, enter

#Let the input end sector, because a sector 512B, to create a 50g partition, you should input + 50g;

# Note that w writes will not take effect until you exit.
# format partition 
mkfs.xfs /dev/nvme1n1p7 
#Mount the root partition to / mnt (Mount first)
mount /dev/nvme1n1p7  /mnt/
mkdir -p /mnt/boot/efi
mkdir -p /mnt/var
mkdir -p /mnt/home
# format partition 
# mkfs.fat -F32 /dev/nvme1n1p1
# Mount UEFI system partition
mount /dev/nvme1n1p1  /mnt/boot/efi

# Allocate / var /, mount / mnt/var/
mount /dev/nvme1n1p8  /mnt/var/

# Assign / home /, mount / mnt/home/
mount /dev/sda2 /mnt/home/
# Finally, check the mounting condition

4, Installation

Select mirror

The file / etc/pacman.d/mirrorlist defines which image source the package will be downloaded from

Because there are too many foreign websites in the image station file, the network speed is slow, so add the domestic image station at the beginning of the image station file
Modify the / etc/pacman.d/mirrorlist file to place the domestic image station on the top lines

Installing the basic operating system

# Using pacstrap script, install base package, Linux kernel and firmware of general hardware
# pacstrap /mnt base linux linux-firmware

# Install a more complete package
# The base package does not contain all the programs in the live environment. The packages.x86 page contains their differences: ʄ
# If you also want to install other package groups such as base devel, add their names to pacstrap and separate them with spaces

pacstrap -i /mnt base base-devel linux linux-firmware

5, Configure system

Configure fstab

genfstab -U /mnt >> /mnt/etc/fstab

# Check fstab
cat /mnt/etc/fstab

Switch new system

arch-chroot /mnt

pacman -S vi vim

time zone

Set the time zone of the system as Zone 8 (Shanghai)

timedatectl set-timezone  Asia/Shanghai
timedatectl status

Set the hardware time, assuming that the hardware time has been set to UTC time

hwclock --systohc


  • Set the local language of the system
vim /etc/locale.gen

Remove the two lines of comment en us.utf-8 and Chinese zh cn.utf-8

  • Set the Log of the system to be displayed in English
echo LANG=en_US.UTF-8 > /etc/locale.conf

Warning: it is not recommended to set any Chinese locale here, which will cause TTY garbled code

  • To modify the keyboard layout and keep this setting in effect, edit vconsole.conf(5), for example:
vim /etc/vconsole.conf


network information

  • Create the hostname file (note to replace myhostname with the hostname you want)
hostnamectl set-hostname myhostname
hostnamectl  status
  • Add corresponding information to hosts
vi /etc/hosts

/etc/hosts (note to replace myhostname with the hostname you want):    localhost
::1        localhost    myhostname.localdomain    myhostname

If the system has a permanent IP address, use this permanent IP address instead of

  • Install the network package dhcpcd, netctl, and network manager
# pacman -S dhcpcd  # systemctl enable dhcpcd
# pacman -S netctl iw wpa_supplicant dialog
# pacman -S rp-pppoe #pppoe-setup #systemctl enable adsl
pacman -S networkmanager nm-connection-editor  network-manager-applet rp-pppoe
systemctl enable NetworkManager

Network manager applet is the front-end UI management tool of network manager, which can be started through nm applet. (Simplified Chinese)

Initialize file system

mkinitcpio -P

Boot system

  • Install OS prober
    If you have other systems on your hard disk, you need to install OS prober
pacman -S os-prober
  • Install grub boot related Toolkit (UEFI system)
pacman -S dosfstools grub efibootmgr
  • Install grub
grub-install --target=x86_64-efi --efi-directory=/boot/efi --recheck
  • Configure grub
grub-mkconfig -o /boot/grub/grub.cfg

Set root password


6, Restart

  • Exit chroot environment
  • Restart the system

Using the system

Enter the root password to enter the system

1, Package management

Add Chinese community warehouse

  • Add archlinuxcn Library
    Arch Linux Chinese community warehouse is an unofficial user warehouse driven by arch Linux Chinese community. Including common software, tools, font / beautification package, etc. for Chinese users.
vim /etc/pacman.conf
  • /etc/pacman.conf finally add the following:
SigLevel = Optional TrustAll
Server =$arch
  • Update image warehouse
pacman -Syy

# Install archlinuxcn signature key and import GPG key
pacman -S archlinuxcn-keyring

Install pamac and yay tools

Better package management tools

# Interface to add / remove software, software update, if a graphical interface is installed, it can be found in the system menu
pacman -S pamac
# Command line management software, can fuzzy search package name or description
pacman -S yay

2, User management

  • Add user (note to replace myusername with the user name you want)
useradd -m -g users -s /bin/bash myusername
# For example: groupadd svenaugustus & & useradd - M - G svenaugustus - S / bin / bash svenaugustus

Make sure to add a user, otherwise you cannot log in through the interface, and the interface will not list the root user

  • Set password for user
passwd myusername
# For example: passwd svenaugustus
  • Add sudo permission for the user you just created
vim /etc/sudoers

Add under root ALL=(ALL) ALL

myusername ALL=(ALL) ALL
# For example: svenaugustus ALL=(ALL) ALL
timedatectl set-timezone Asia/Shanghai
timedatectl set-ntp true

3, Graphic interface

Install X Window System

If you need a desktop environment, you need to pre install the X Window System

  • Install x Window System
pacman -S xorg
  • Install Chinese font: Dejavu and WenQuanYi micro black font
pacman -S ttf-dejavu wqy-microhei && fc-cache -fv

Installing the video card driver

If you need a desktop environment, you need to install a graphics driver first

  • Determine the graphics card model
lspci | grep VGA
  • Installing the video card driver
Pacman-s driver package
Video card Driver package
Universal graphics card xf86-video-vesa
Intel Intel xf86-video-intel
AMD graphics card xf86-video-amdgpu
NVIDIA graphics Geforce7 ± xf86-video-nouveau
NVIDIA graphics Geforce6/7 xf86-video-304xx
ATI graphics card xf86-video-ati
# Example
pacman -S xf86-video-vesa  xf86-video-intel  xf86-video-nouveau

Install desktop environment

Two common desktop environments are GNOME and KDE. Where plasma is the latest version of KDE.

Desktop Environment brief introduction
GNOME3 The world's most popular desktop environment developed based on GTK has simple default settings, which requires a lot of beautification and installation
plasma The world's most popular and the latest version of KDE desktop environment, developed based on QT, is beautiful and gorgeous, with a bit complicated settings and a lot of installation content
xfce Lightweight and beautiful, Linus's current desktop environment
lxde Lightweight desktop, Linux Manjaro distribution default desktop environment
mate Branch of GNOME2, Linux Mint distribution default desktop environment
deepin New desktop environment developed by China deep technology team based on Qt and GO
pacman -S xfce4 xfce4-goodies

# lightdm window login manager
pacman -S lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings

# Set to startup
systemctl enable lightdm.service
pacman -S plasma plasma-meta

# Install kde app
pacman -S kde-applications kde-applications-meta

# lightdm window login manager
pacman -S sddm.service

# Set to startup
systemctl enable sddm.service

Chinese environment (Simplified Chinese) / Simplified_Chinese_ (Simplified Chinese)

  • Set up Chinese environment
    (the configuration files of KDM, GDM and LightDM are /. xprofile, and the configuration files of startx and Slim are /. xinitrc)
echo LANG=zh_CN.UTF-8 > .xinitrc
echo LANG=zh_CN.UTF-8 > .xprofile

Chinese input method

sudo pacman -S --noconfirm fcitx-im fcitx-configtool fcitx-sogoupinyin fcitx-googlepinyin

# If it's kde: sudo Pacman - s -- noconfirm fcitx im KCM fcitx fcitx sogoupinyin fcitx googlepinyin

  • Configure fcitx
vim ~/.xprofile


export LANG=zh_CN.UTF-8
export GTK_IM_MODULE=fcitx
export QT4_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
  • fcitx input method configuration > add ons > check advanced > Xim front end > check on the spot

Unmute your voice

pacman -S alsa-utils 
# Install alsa tray to control volume from tray
# yay -S alsa-tray
# Touch mute
amixer sset Master unmute 
# You can also use pulseaudio to control the volume
pacman -S pulseaudio pavucontrol 
systemctl --user start pulseaudio
systemctl --user enable pulseaudio

4, Perfect system configuration

Turn on Num Lock when power on

Most keyboards have a Num Lock key that controls the keypad's switches. You may want to turn on Num Lock when the system starts.

yay -S  systemd-numlockontty

# Set startup
systemctl enable numLockOnTty.service

Installation of ZSH

Since it's Linux, I haven't forgotten to change bash to zsh
First, install zsh:

sudo pacman -S zsh

Then configure oh my Zsh:

sh -c "$(wget -qO-"

Finally, replace the default shell:

sudo chsh -s /bin/zsh

After restarting, you can use zsh happily~

system optimization

  • Avoid using swap partition as much as possible and use physical memory to provide system performance
vim /etc/sysctl.d/90-swappiness.conf


  • Set solid state SSD periodic TRIM (skip without solid state)
    There is another mismatch between the features of the operating system and SSD hardware.
    That is, when the operating system deletes data, it does not really delete the physical data, but only modifies the data in the inode. You can avoid these problems by enabling the TRIM command.
mkdir -p  /etc/cron.daily/
vim /etc/cron.daily/ssd-fstrim


echo "*** $(date -R) ***" >> $LOG
fstrim -v / >> $LOG
fstrim -v /var>> $LOG

reference resources

Software recommendation

1, General software

File manager

nemo is a good file manager, which is better than thunar to some extent. wiki :
nemo fileroller adds fileroller. nemo provides the menu of decompression and compression.

sudo pacman -S --noconfirm nemo nemo-python nemo-fileroller nemo-preview nemo-terminal cinnamon-translations

Set "open in terminal" in nemo file manager to xfce terminal

gsettings set org.cinnamon.desktop.default-applications.terminal exec xfce4-terminal

Desktop Landscaping

  • xfce desktop environment beautification
#Select the corresponding style and icon settings in the settings appearance
#Select the corresponding theme setting in the settings window manager
# paper themes and icons
yay -S paper-gtk-theme-git paper-icon-theme-git
# arc theme
#pacman -Sarc-gtk-theme arc-solid-gtk-theme
pacman -S --noconfirm gtk-theme-arc-git  
# Icons (numix or papirus Series), recommended numix
pacman -S --noconfirm numix-circle-icon-theme papirus-icon-theme
  • kde desktop environment beautification
# Select the corresponding icon (papirus Series) in the system settings, and papirus is recommended
sudo pacman -S papirus-icon-theme
# Select the corresponding topic (arc or kvantum Series) setting in system settings
pacman -S arc-kde kvantum-theme-arc

systems software

yay -S --noconfirm glances smartmontools 

Glaces is more powerful than top. It can automatically highlight programs that utilize the highest system resources and provide as much information as possible for Linux/Unix servers. Glaces is more powerful than top. It can automatically highlight programs that utilize the highest system resources and provide as much information as possible for Linux/Unix servers.
smartmontools hard disk S.M.A.R.T detection tool.

yay -S --noconfirm bleachbit redshift screenfetch man-pages-zh_cn

bleachbit quickly frees up disk space and tirelessly guards your privacy. Free cache, delete cookie s, clear Internet browsing history, clean temporary files, delete logs, and more
redshift adjusts the color temperature of your screen according to your surroundings. When you work in front of the screen at night, it may help you reduce the damage to your eyes;
Screen fetch system information tool, terminal use screen fetch command;

yay -S --noconfirm filelight tree mugshot alacarte

filelight displays interactive images and uses a circular pie chart to visualize disk usage.
Tree displays all files in the current directory (tree);
mugshot edit profile?
alacarte menu manager

yay -S --noconfirm freefilesync

freefilesync folder comparison and synchronization tool;

yay -S --noconfirm networkmanager-l2tp networkmanager-strongswan networkmanager-openconnect networkmanager-openvpn networkmanager-pptp networkmanager-vpnc

VPN support based on network manager. (Simplified Chinese)

Common software

  • office software, music, video software
yay -S --noconfirm wps-office ttf-wps-fonts wps-office-mui-zh-cn netease-cloud-music smplayer smplayer-skins smplayer-themes nomacs thunderbird thunderbird-i18n-zh-cn 

WPS Office; TTF WPS fonts; WPS Office depends on fonts;
Netease cloud music; player video player;
nomacs image browser, the interface is super simple, but provides simple image editing functions (can adjust color, brightness, size and cutting). In addition, it also supports full screen mode, histogram, and many panels that can switch to display metadata, edit history and other information.
thunderbird mail client tool;

  • browser
yay -S --noconfirm google-chrome firefox firefox-i18n-zh-cn 

Google Chrome; firefox Firefox;

  • text editor
yay -S --noconfirm vim remarkable masterpdfeditor flameshot   

vim classic text editor, in the terminal full keyboard is very happy;
remarkable excellent and functional Markdown editor;
Master pdf editor is a free PDF browser and editor for linux users, which supports real-time preview;
pinta is a drawing tool similar to Windows;
Flame screenshot tool;

yay -S --noconfirm sublime-text-dev-imfix-fcitx

sublime-text-dev-imfix-fcitx powerful development essential text editor; (ability to use paid license)

  • Productivity tools
yay -S --noconfirm wiznote meld galculator goldendict easystroke catfish peek kazam 

wiznote is known note;
meld text comparison;
Galcalculator is a GTK + based scientific calculator.
goldendict dictionary software;
easystroke mouse gesture;
catfish is a very fast and lightweight file search tool based on GTK +;
peek screen recording tool, small and exquisite, can save videos as gif moving pictures and webm videos compatible with html5;
Kazam's simple desktop screen recording tool can only record the whole screen, can record sound, and can quickly upload the recorded video to YouTube and VideoBin video sharing websites.
Various API documents of zeal can be downloaded.

  • Password manager
yay -S --noconfirm keepassxc

keepassxc password manager;

  • Remote login, download tools
yay -S --noconfirm electerm-bin uget filezilla

The free and open SSH desktop terminal of electerm is as easy to use as xshell and terminus.
uget is comparable to thunderbolt's download tool;
filezilla powerful FTP tool;
Baidu netdisk bin the client of Baidu cloud disk
OBS studio cross platform live video software

  • Mind mapping
yay -S --noconfirm xmind graphviz

The key of xmind's cross platform mind mapping tool is to import MindManage files;
graphviz is an open-source toolkit launched by at & T lab. It can use DOT language and draw various diagrams.

  • Teamwork
sudo pacman -S qt5-quickcontrols
yay -S --noconfirm teamviewer

Team viewer remote collaboration requires Qt5 quickcontrols

Two. Installation of programming software

Programming development

  • Version control system
yay -S --noconfirm git subversion mercurial bzr

git is an open source distributed version control system, which can effectively and high-speed deal with version management from very small to very large projects.
subversion is an open source version control system. Compared with RCS and CVS, it uses a branch management system. Its design goal is to replace CVS.
mercurial is similar to GIT's distributed version control system, such as OpenJDK.
bzr Bazaar (bzr) is another open source DVCS (Distributed Version Control System), which tries to bring some new things to the world of SCM (Source Code Management). bzr is a project supported by Canonical, the Ubuntu Linux distribution company. In short, bzr is written in python for version control.

  • Programming language (Java, C++, Golang, Python, PHP, NodeJS) running environment
yay -S --noconfirm jdk-openjdk jre-openjdk-headless openjdk-doc openjdk-src visualvm
yay -S --noconfirm jdk8-openjdk jre8-openjdk-headless openjdk8-doc openjdk8-src jdk11-openjdk jre-openjdk11-headless openjdk11-doc openjdk11-srcjre-openjdk11 jre-openjdk11-headless openjdk11-doc openjdk11-src
yay -S --noconfirm jdk7-openjdk jdk10-openjdk

yay -S --noconfirm gcc go python erlang nodejs npm yarn php php-cgi php-fpm xdebug

OpenJDK8 doc OpenJDK8 SRC for OpenJDK8 documents and source code;
nodejs is the engine framework of Node.Js (Chrome V8)
npm \ yarn is the Node.Js (Chrome V8) dependency management framework
PHP PHP CGI PHP FPM PHP development environment

  • IDE development tools
yay -S --noconfirm jetbrains-toolbox

jetbrains toolbox is a famous IDE management tool for jetbrains sequences;

  • C + + development tools
yay -S --noconfirm gdb codeblocks qtcreator glade postman-bin tcpdump gnu-netcat

gdb GNU debugger;
codeblocks cross platform C++ IDE, which the official website says can meet the needs of the most demanding users. '
QT creator based C + + development tools (including interface design);
glade based on GTK3 C + + development tools (including interface design);

  • Load balancing, agent, reverse agent
yay -S --noconfirm nginx  

nginx load balancing and reverse agent software and tools;

  • Network troubleshooting tools
yay -S --noconfirm wireshark-qt tcpdump gnu-netcat net-tools dnsutils inetutils iproute2

Wireshark QT network packet capturing interface tool;
Tcpdump command line tool for capturing packets in TCP network;
GNU netcat network connection nc command line tool;
Network related commands ifconfig and route are in net tools package, nslookup and dig are in dnsutils package, ftp and telnet are in inetutils package, and ip commands are in iproute2 package.

  • Network test tools
yay -S --noconfirm postman-bin soapui jmeter

POSTMAN bin is a famous POSTMAN tool;
soapui is another tool that supports HTTP and soap testing;

  • client
yay -S --noconfirm redis-desktop-manager robo3t-bin 

Redis Desktop Manager caching middleware redis visualization client;
Robo3t bin is a client tool for connecting MongoDB;

Virtualization and containerization

  • Virtualization
yay -S --noconfirm virtualbox virtualbox-host-modules-arch virtualbox-ext-oracle

The virtualbox virtual machine tool is preferred by linux, which is better than vmware.

  • Containerization
yay -S --noconfirm docker

docker virtual Linux container technology;


yay -S --noconfirm mysql57 mongodb-bin-3.6

Install mysql5.7 and mongodb

Terminal agent

If you want the terminal to pass ss proxy, you need to install a third-party software assistant, privoxy, which is an HTTP protocol filtering agent.

  • Install privoxy
yay -S --noconfirm privoxy
  • Configure privoxy

The configuration file of privoxy is in / etc/privoxy/config. Generally, find the forward socks5t line and change its value to the address the SS agent listens to, as follows:

vim /etc/privoxy/config
forward-socks5t / .

1080 is the local address of ss. At this time, you need to restart privoxy to take effect. Use

sudo systemctl restart privoxy

Just command

  • Terminal add agent
    At this time, add a proxy in the terminal to access the network through the proxy.
export http_proxy=
export https_proxy=

Where 8118 is the default privoxy listening address.

  • test
# Test whether the proxy server is normal
curl --socks5 
# Test privoxy
curl --proxy -Is | grep -w 200
# Test privoxy + export http \
curl -I


yay -S --noconfirm cmatrix geogebra stellarium celestia 

cmatrix terminal outputs endless strings from top to bottom, similar to the matrix effect in < hacker empire > > the terminal runs cmatrix;

geogebra graphics calculator, supports functions, geometry, algebra, calculus, statistics and 3D mathematics.
stellarium astrology software. There are a lot of adjustable options. This is just a screenshot.

celestia's free space simulator allows you to explore our universe in three dimensions;

3, Application shortcut

xfce desktop environment application shortcut key

  • On the keyboard - application shortcut

Select add, and enter xfce4-screenshooter-f in the command
Click OK, pop up the shortcut key to confirm, and press Print
Click OK again.
When you need a screenshot, press Print
You can take a screenshot

  • xfce default keyboard modification (keyboard)
    Open the launcher menu (similar to the start of windows) > Settings > keyboard > xfce4-pop-whiskermenu > Super + exit (Esc)
    Open file manager: System Tools > Settings > keyboard > exo open -- launch FileManager > Super + F
    Open mail client: System Tools > Settings > keyboard > exo open -- launch MailReader > Super + M
    Open the default browser: System Tools > Settings > keyboard > exo open -- launch WebBrowser > Super + W
    Open simulation terminal: System Tools > Settings > custom shortcut > exo open -- launch terminalemulator > Super + T
    Open application Finder: System Tools > Settings > keyboard > xfce4 appfinder -- collapsed > Super + R
    Open Task Manager: System Tools > Settings > keyboard > xfce4 taskmanager > Super + k
    Turn on display / resolution settings: System Tools > Settings > keyboard > xfce4 display settings - minimal > Super + P
    Lock screen: System Tools > Settings > custom shortcut > xflock4 > Super + L
    Screenshot: System Tools > Settings > keyboard > custom shortcut > xfce4-screenshooter - F > Print
    Screenshot: System Tools > Settings > keyboard > custom shortcut > deep in screenshot > Super + A

  • xfwm4 default shortcut modification (window manager)
    Display desktop: change to Super + D
    CTRL + F1.... F12 delete the unneeded ones to prevent key conflicts with IDE development tools such as Jetbrains.
    Ctrl+Alt + clear up, down, left and right, not needed temporarily, to prevent conflicts with the shortcut keys of IDE development tools such as Jetbrains.
    Alt+insert and delete are not needed for the time being to prevent conflicts with the shortcut keys of IDE development tools such as Jetbrains.

reference resources

More attention to WeChat official account.

Tags: Linux PHP network ArchLinux

Posted on Sun, 17 May 2020 20:55:24 -0700 by eroticheretic