ArchLinux Installation and Configuration

6 minute read

Published:

This post is about my own archlinux installation and configuration process from archiso on.

Updating…

Installation Procedure

  1. Download Newest Archlinux GUI Distribution ISO
  2. Prepare an U Disk for Ventoy installation
  3. Place all your OS iso files and PE into the available ventoy partition
  4. Reboot and press corresponding mainboard keys to enter boot option interface
  5. Select U Disk boot option and select your OS option
  6. Just install by the Install Arch Linux software

Configuration Steps after Installation

Pacman Mirror Preparation:

  • Run sudo vim /etc/pacman.conf for insert archlinuxcn and uncomment multitest source
  • Open Archlinux Mirrorlist for selelcting Chinese mirrorlist and place the fastest in the first place, then run sudo pacman -Syyu && sudo pacman -S archlinux-keyring archlinuxcn-keyring && sudo pacman -Syyu for updating all packages
  • Run sudo Pacman -Rdd mutter to solve mutter and mutter-performance signature conflict problem by archlinuxgui iso mirrors

VPN Proxy Preparation:

  • Run sudo pacman -S vim clash chezmoi for facilitating successive steps
  • Open V2Free for getting clash configuration
  • Run wget https://ghproxy.com/https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb ~/.config/clash/ for downloading essential files for clash with mirror
  • Run clash and this will automatically generating essential dbs and config file for using, and vim ~/.config/clash/clash.yaml, paste copied configuration, and then modify the socks port to 1089, at last, run clash at any terminal
  • Run paru for paru updating packages
  • Run git config --global http.proxy 127.0.0.1:7890 && git config --global https.proxy 127.0.0.1:7890

Chezmoi Dotfiles Pulling and Applying:

Softwares and Packages Installation:

  • Run sudo pacman -S qtile alacritty kitty fish zsh ranger feh neovim rofi picom starship yarn npm xclip python3 ruby perl go python-pip && pip install pynvim psutil && gem install neovim && paru -S hyprland-git waybar-experimental-git waybar-wlr-workspaces gobject-introspection dunst swaylock-effects swayidle light brillo grim swappy slurp rofi-emoji kbct-git && pip install pygobject for preliminary configuration
  • Run sudo pacman -S htop btop exa bat dust duf procs ripgrep httpie kdiff3 neofetch lolcat figlet toilet cowsay blueman pulseaudio pavucontrol pamixer brightnessctl udiskie ntfs-3g volumeicon cbatticon libnotify notification-daemon networkmanager network-manager-applet fcitx fcitx-configtool fcitx-googlepinyin tmux screen axel lazygit flameshot screenkey typespeed nnn zotero sioyek thunar dolphin code zathura mpv vlc gimp filezilla && paru -S boxes cmatrix cava for all kinds of useful packages

Beautify:

  • Run cd ~/Downloads/ && git clone https://github.com/vinceliuice/grub2-themes && cd grub2-themes && sudo ./install.sh -t whitesur -s 2k -b && grub-install --target=x86_64-efi --efi-directory=/boot/efi for grub theme beatify(grub2-themes link)
  • Run paru -S nerd-fonts-complete && sudo pacman -S wqy-microhei wqy-zenhei adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts for nerdfont and chinese font support(chinese font archlinux wiki page)
  • Open DistroTube Gitlab: Shell Color Scripts and follow the README guide to install colorscript in the bin, specifically by cd ~/Downloads && git clone https://gitlab.com/dwt1/shell-color-scripts.git && cd shell-color-scripts && sudo make install
  • Run cd ~ && rm -rf Pictures && git clone https://ghproxy.com/https:/github.com/XIRZC/mywp.git Pictures for feh directory setting
  • Run git clone https://ghproxy.com/https://github.com/cdump/ranger-devicons2 ~/.config/ranger/plugins/devicons2 for ranger icon

Fish Configuration:

  • Run curl https://ghproxy.com/https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish for oh-my-fish installation
  • Run starship preset pastel-powerline > ~/.config/starship.toml or starship preset nerd-font-symbols > ~/.config/starship.toml for starship command line prompt configuration(starship link)

Cuda, Conda and PyTorch Installation:

  • Run cd ~/Downloads && axel -n 10 https://developer.download.nvidia.com/compute/cuda/11.3.0/local_installers/cuda_11.3.0_465.19.01_linux.run && chmod +x cuda_11.3.0_465.19.01_linux.run && sudo pacman -R gcc && sudo pacman -S gcc10 nvidia nvidia-settings nvidia-utils nvtop && sudo ln -s /usr/bin/gcc10 /usr/bin/gcc && sudo ./cuda_11.3.0_465.19.01_linux.run for cuda 11.3 installation without selecting driver within run file(cuda 11.3 download link, gcc compatible version with cuda version)
  • Run cd ~/Downloads && axel -n 10 https://repo.anaconda.com/miniconda/Miniconda3-py37_4.12.0-Linux-x86_64.sh && chmod +x Miniconda3-py37_4.12.0-Linux-x86_64.sh && ./Miniconda3-py37_4.12.0-Linux-x86_64.sh for miniconda installation(minconda download link)
  • Follow the instruction in Tsinghua Conda and Tsinghua Pip for conda and pip acceleration
  • Run conda create -n com python=3.7 && conda activate com && conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=10.2 -c pytorch for configure a common python=3.7, pytorch=1.8, torchvision=0.9, torchaudio=0.8, cudatoolkit=10.2 python virtual environment(pytorch previous version link)

DualBoot Time Fixing:

  • Run sudo timedatectl set-local-rtc true set-ntp true for fix windows&linux timezone conflict(localtime for windows, utc for linux)

Zotero Preparation:

  • Config Zotero by validate by webdav dav.jianguoyun.com/dav, and then opening Jianguoyun setting link for query password

Remote SSH Connecting Configuration:

  • Run sudo pacman -S openssh && sudo systemctl start sshd && sudo systemctl enable sshd, and if you want to change the binding port, just run sudo vi /etc/ssh/sshd_config and uncomment the Port line and change this value

Docker and Nvidia Container Installation and Configuration:

  • Run sudo pacman -S docker docker-compose nvidia-container-toolkit && paru -S nvidia-container-runtime && sudo cp ~/.config/docker/daemon.json /etc/docker/daemon.json && sudo systemctl enable docker && sudo systemctl start docker for install and config docker

Remote VNC Installation and Configuration:

  • Run sudo pacman -S tigervnc && vncpasswd, then run echo 1:mrxir >> /etc/tigervnc/vncserver.users && echo session=lxqt \n geometry=1920x1080 \n localhost \n alwaysshared > ~/.vnc/config && sudo systemctl start vncserver@1.service && sudo systemctl enable vncserver@1.service, and you just need to open vncviewer to enter your ip addr ipv4 address follow by :1 such as vncviewer 10.31.164.163:1(tigervnc archwiki)

Reference: https://github.com/antoniosarosi/dotfiles

Original Archlinux Live ISO useful commands

Here are some pre-utils to use:

  • ip link for look up wlan interface configuration and status
  • wpa_passphrase $SSID $PWD > X.conf for generate corresponding network connection configuration
  • wpa_supplicant -c X.conf -i wlan0 -B for connect corresponding wifi in the background
  • dhcpcd & for configure wifi ip address if the network doesn’t work
  • fdisk -l for list disk partition
  • mkfs.ext4 for make format for linux partition
  • mkswap for make format for swap
  • mkfs.fat for make format for EFI partition

Here are six important successive commands:

  • pacstrap /mnt base linux linux-firmware for install linux into mounted linux main partition
  • genfstab -U /mnt >> /mnt/etc/fstab for system config
  • arch-chroot /mnt for change root into new system
  • pacman -S grub efibootmgr intel-ucode os-prober for important system essentials
  • grub-mkconfig > /boot/grub/grub.cfg for grub configuration generation
  • grub-install --target=x86_64-efi --efi-directory=/boot for grub installtion

Here are some other useful commands for daily use: