[Arch] Archlinux Setup (Updated)
A brief archlinux install guide.
Final setup will be: archlinux + i3wm, booted with efi.
Before the install…
- this is for gpt partitions and efi boot. And the
device namehere is only a reference.
- Also note that: if you are installing the new system from a existing system, you can simply use rsync to migrate system, see wiki for details. If you want a fresh new install, the package
arch-install-scriptsis needed, which includes the tools like
- Before you get started, use
lsblkto list out the disks and identify onto which disk you want to install the system.
Make sure the system clock is accurate before the install.
Make sure internet is available. A wired connection is recommended. See wiki for details.
Preparing the disk.
THIS TUTORIAL IS DEDICATED TO UEFI + GPT setup, if you have an older machine that only support BIOS/MBR, the partitions and bootloader part should be different.
Disk Partition & Formatting
If you already have the partitions simply skip this section.
cgdisk to make partitions.
for further disk info you can use
fdisk -l /dev/sdx.
The minimal partitions should look like this (swap is optional).
|Partition||Mount Point||Type||Size (typical)||Device Name|
|swap||linux swap||2 * Memory Size||/dev/sda2|
|root||/||linux filesystem||as large as needed||/dev/sda3|
If you already have another OS with EFI(e.g. you want dual booting), you can continue using an existing boot partition.
Formatting the boot and root partition
Use swap partition (Optional)
dosfstools may be needed for vfat file system.
Mount the Disk
System Install and Basic Configs
Before the install, you may want to choose a faster mirror. Expecially when you are from CHINA… China’s gov is a total blyat… Edit
/etc/pacman.d/mirrorlist and run
install basic system
# genfstab -U /mnt >> /mnt/etc/fstab
Note: before running genfstab, I recommend you to use
fdisk -l etc. to check if the partitions are correctly mounted.
After the system installing, genfstab should not be used anymore. Edit
/etc/fstab manually afterwards if needed.
chroot into the new installed system
basic system config
# timedatectl list-timezones # timedatectl set-timezone Zone/SubZone
Locale and Language
/etc/locale.gen, uncomment the language encoding that you need. e.g. I have
en_US.UTF-8 UTF-8 de_DE.UTF-8 UTF-8 zh_CN.GB18030 GB18030 zh_CN.GBK GBK zh_CN.UTF-8 UTF-8 zh_CN GB2312
locale-gen to generate locales..
/etc/locale.conf and set LANG variable, e.g.
Network Manager I prefer Network Manager.. here we disable dhcpd(if used during the installation) and install network-manager
Create new user It’s not recommended to use root user on a daily basis.
useradd -G wheel username passwd username mkdir -m 700 /home/username chown username:username /home/user
sudoers to grant new user root privilege. Use
visudo command to edit.
username ALL=(ALL) ALL
Boatloader (fore UEFI)
Check again all the partitions are correctly mounted!
Now you can unmount the disk and reboot. If nothing went wrong, you should be able to boot into the new system with grub.
Desktop Environment, Sound and Graphic.
pacman -S xorg xorg-server xorg-utils xorg-xinit xorg-xfontsel xorg-font-util
install and setup i3
pacman -S i3-wm i3status i3blocks i3lock dmenu dunst
Note: packages other than
i3-wm are optinal. There are also forks of i3 that you may choose from e.g.
i3-gaps which gives extra gap between panels. Also I’m not going to cover the usage and detailed config of i3-wm and other utils here. This is only a setup guide.
To run i3, edit
~/.xinitrc and add at the end:
startx to launch X and i3! (A basic config will be generated during the first startup)
Alsa is installed by default, install
alsa-utils for a control panel
graphic Note: this section is only for intel integrated graphic card users..
pacman -S mesa xf86-video-intel
Preventing graphic tearing: add or edit
Section "Device" Identifier "Intel Graphics" Driver "intel" Option "TearFree" "true" EndSection
fonts Lacking proper fonts sometimes causes problems.. Here are the fonts I installed.
adobe-source-code-pro-fonts noto-fonts noto-fonts-cjk noto-fonts-emoji wqy-bitmapfont ttf-font-awesome ttf-arphic-ukai ttf-arphic-uming ttf-dejavu ttf-font-awesome ttf-symbola
Terminal, shell and editor
I currently use suckless’s
st terminal. The build I’m using can be found in this site’s static file page.
I also use
fish as shell,
nnn as file browsers,
neovim as editor and
plugged as its plugin manager.
Fcitx and input method
pacman -S fcitx fcitx-configtool fcitx-googlepinyin fcitx-libpinyin
then add the folling lines to
# fcitx input export QT_IM_MODULE=fcitx export XMODIFIERS=@im=fcitx export GTK_IM_MODULE=fcitx
and the following to i3 config
exec --no-startup-id fcitx -d
Other useful settings
add this to .xinitrc to swap esc and caplock (for vim users)
# swap caps setxkbmap -option caps:swapescape
also this one (which will change your life)
xset r rate 300 50
[+] click to leave a comment [+]
the comment system on this blog works via email. The button below will generate a mailto: link based on this page's url and invoke your email client - please edit the comment there! [optional] even better, encrypt the email with my public key - don't modify the subject field - specify a nickname, otherwise your comment will be shown as anonymous - your email address will not be disclosed - you agree that the comment is to be made public. - to take down a comment, send the request via email.>> SEND COMMENT <<