Skip to content

Instantly share code, notes, and snippets.

@vladislav805
Last active November 4, 2021 08:54
Show Gist options
  • Save vladislav805/d336b5e017d0ee96cc067a9a8ecf1d0a to your computer and use it in GitHub Desktop.
Save vladislav805/d336b5e017d0ee96cc067a9a8ecf1d0a to your computer and use it in GitHub Desktop.
Cheatsheet by install and using Arch Linux

Arch Linux

Install Arch Linux with EFI

  1. Download ISO from official site
  2. Burn the ISO to a USB flash using Rufus with Partition Scheme = GPT, Target = EFI (non CSM).
  3. Boot to BIOS/UEFI, disable CSM.
  4. Boot from USB flash with EFI.
  5. Check connection with Internet
    ping -c 2 google.com
    • If using wifi, select network
      wifi-menu
  6. Find out which disk (/dev/sdX, where X - letter (e.g., a, b, c, etc.), in case of NVMe, name will be like /dev/nvmeX) to install the system on: lsblk:
    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda      8:0    0 232.9G  0 disk 
    ├─sda1   8:1    0   260M  0 part /boot/efi
    ├─sda2   8:2    0    50G  0 part /
    └─sda3   8:3    0 182.6G  0 part /home
    sdb      8:16   0 931.5G  0 disk 
    └─sdb1   8:17   0 931.5G  0 part /mnt/TOSHIBA
    
    In my case it sda. It is device /dev/sda. Next in text, instead of sdX, you need to write your own disk, for example, sda.
  7. Create partitions on disk (ALL DATA ON DISK WILL BE PERMANENTLY DELETED AND LOST):
    cfdisk /dev/sdX
    • Delete all partitions on /dev/sdX;
    • Create a new FAT32 partition with 260MB at the beginning of disk;
    • Create a new ext4 partition for root with 50GB (51220MB) of disk;
    • Create a new ext4 partition for home dir with all the remaining space;
    • Write;
    • Quit.
  8. Create file systems on partitions:
    • EFI partition:
      mkfs.fat -F32 /dev/sdX1
    • root partition:
      mkfs.ext4 /dev/sdX2
    • home partition:
      mkfs.ext4 /dev/sdX3
  9. Mount root:
    mount /dev/sda2 /mnt
  10. Create home dir and mount home partition:
    mkdir /mnt/home
    mount /dev/sda3 /mnt/home
  11. Install
    • Install all:
      pacstrap -i /mnt base linux linux-firmware sudo nano
    • Create fstab:
      genfstab -U -p /mnt >> /mnt/etc/fstab
  12. Set up system:
    • Change root:
      arch-chroot /mnt /bin/bash
    • Enable needed locales:
      • Open locale.conf and uncomment (remove # at the beginning of line) locale:
        nano /etc/locale.gen
      • Then Ctrl+O for save, Ctrl+X for exit;
    • Generate locales:
      locale-gen
    • Generate locale.conf:
      echo "LANG=en_US.UTF-8" > /etc/locale.conf
    • Setup timezone: instead Europe/Moscow select your timezone by double clicking Tab after zoneinfo/:
      ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime
    • Set date and time from hardware:
      hwclock --systohc --utc
    • Check date and time:
      date
    • Write hostname of machine:
      echo name > /etc/hostname
    • Open hosts:
      nano /etc/hosts
      and write
      127.0.0.1 localhost
      
      then save (Ctrl+O) and exit (Ctrl+X);
    • Install network manager:
      pacman -S networkmanager
    • Enable network manager:
      systemctl enable NetworkManager
    • Set password for root: passwd, enter twice password;
    • Install AMD drivers:
      pacman -S mesa
  13. Install and set up GRUB:
    • Install:
      pacman -S grub efibootmgr
    • Create directory for mount:
      mkdir /boot/efi
    • Mount efi partition:
      mount /dev/sda1 /boot/efi
    • Check if mount correctly:
      lsblk
    • Install grup:
      grub-install /dev/sdX
    • Make GRUB config:
      grub-mkconfig -o /boot/grub/grub.cfg
  14. Exit from root:
    exit
  15. Unmount:
    umount -R /mnt
  16. Reboot to just installed system:
    reboot
  17. Log in to system (username: root, your password);
  18. Add user:
    useradd -m -g users -G wheel -s /bin/bash username
    (change last username);
  19. Set password for new user:
    passwd username
  20. Pass sudo-privelegies for new user:
    EDITOR=nano visudo
  21. Find # %wheel ALL=(ALL) ALL and remove # at the beginning of line, Ctrl+O, Ctrl+X;
  22. Set up drivers and desktop environment:
    • Setup drivers:
      pacman -S pulseaudio pulseaudio-alsa pavucontrol xorg xorg-xinit xorg-server
    • Setup XFCE4:
      pacman -S xfce4 lightdm lightdm-gtk-greeter
    • On start computer start X11:
      echo "exec startxfce4" > ~/.xinitrc
    • Enable Desktop Manager:
      systemctl enable lightdm
  23. Reboot;
  24. Arch with XFCE4 successfully installed.

Windows dualboot

It's assumed that windows has already been installed.

  1. Get and save two parameters for GRUB menuentry (source):
    1. Mount EFI-partition:
      sudo mount /dev/sda1 /boot/efi
    2. Get filesystem UUID (further in the text as $fs_uuid):
      sudo grub-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
    3. Get hints strings (further in the text as $hints_string):
      sudo grub-probe --target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
  2. Open custom grub config:
    sudo nano /etc/grub.d/40_custom
    and insert the following content into it, previously replace two variables ($hints_string and $fs_uuid):
    cat << END
    menuentry "Windows" {
        insmod part_gpt
        insmod fat
        insmod chain
        search --no-floppy --fs-uuid --set=root $hints_string $fs_uuid
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    }
    END
  3. Remake grub config:
    sudo grub-mkconfig -o /boot/grub/grub.cfg
  4. PROFIT

Small things

Bash completion

sudo pacman -S bash-completion

JetBrains Mono font

sudo pacman -S ttf-jetbrains-mono

Emoji font support

sudo pacman -S noto-fonts-emoji

Xfce4 preferences

Interactive app menu

Install package:

# pacman -S xfce4-whiskermenu-plugin

Notifications

Install package:

# pacman -S xfce4-notifyd

Media buttons

Install package:

# pacman -S xfce4-pulseaudio-plugin

Put to any panel PulseAudio Plugin.

Task manager

Install package:

# pacman -S xfce4-taskmanager

Network GUI manager

Install package:

# pacman -S network-manager-applet

gvfs support

# pacman -S gvfs gvfs-mtp

NTFS support

# pacman -S ntfs-3g

Synaptics touchpad (sensor panel) for laptops

  1. Install
    # pacman -S xf86-input-synaptics 
  2. Copy example config
    # cp /usr/share/X11/xorg.conf.d/70-synaptics.conf /etc/X11/xorg.conf.d/
  3. Set options
    Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
            Option "TapButton1" "1"
            Option "TabButton2" "2"
            Option "TabButton3" "3"
            Option "RBCornerButton" "3"
    EndSection
    
  4. Restart X11 or reboot.

Others

Using AUR

For comfortable use AUR, you may install cli tool yay.

  1. Packages, needed for install yay:
    # pacman -S --needed git base-devel
  2. Change directory to temp:
    $ cd /tmp
  3. Clone repo:
    $ git clone https://aur.archlinux.org/yay.git
  4. Change directory to respositry:
    $ cd yay
  5. Build and install it:
    $ makepkg -si

After it, you can install packages from AUR only with:

$ yay -S PACKAGE_NAME

Logitech Mouse with side buttons

By default, these keys are responsible for navigating through history. But IMHO, it's more convenient to control the sound volume with them. For this you need:

  1. Install packages:
    # pacman -S xbindkeys xdotool
  2. Run xev and in opened window click needed buttons on mouse. In terminal find key codes. In my case it 8 = volume down, 9 = volume up.
  3. Create ~/.xbindkeysrc file and put config like this:
"xdotool key XF86AudioLowerVolume"
    b:8
"xdotool key XF86AudioRaiseVolume"
    b:9
  1. In ~/.bashrc add line at the end: xbindkeys

Sublime Text 4

  1. Add keys
    curl -O https://download.sublimetext.com/sublimehq-pub.gpg && sudo pacman-key --add sublimehq-pub.gpg && sudo pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
  2. Add repository
    echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf
  3. Install
    sudo pacman -Syu sublime-text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment