Skip to content

Instantly share code, notes, and snippets.

@tm9k1
Last active August 17, 2024 18:18
Show Gist options
  • Save tm9k1/d22508c05868e7eca578580e5ea86829 to your computer and use it in GitHub Desktop.
Save tm9k1/d22508c05868e7eca578580e5ea86829 to your computer and use it in GitHub Desktop.
My commands list to get to desktop of an Arch system

ARCH INSTALLATION INSTRUCTIONS

SYSTEM CHECKS
  1. UEFI boot:

    ls /sys/firmware/efi/efivars
  2. Internet connection:

    ping google.com -c3
  3. system clock accuracy:

    timedatectl set-ntp true
    • review clock status:

      timedatectl status
DISK PARTITIONING
  1. view all partitions:

    fdisk -l     # lsblk works too
  2. partition the disk:

    cfdisk /dev/XXXXXX
  3. create the necessary filesystems:

    mkfs.fat -F32 /dev/XXXXXX   # /boot/efi
    mkfs.ext4 /dev/XXXXXX       # /
    mkfs.xfs /dev/XXXXXX        # /home
BOOTSTRAPPING ARCH LINUX
  1. mount the partitions:

    mount /dev/XXXXX /mnt           # /
    mkdir -p /mnt/boot/efi
    mount /dev/XXXXX /mnt/boot/efi  # /boot/efi
    mkdir /mnt/home
    mount /dev/XXXXX /mnt/home      # /home
    swapon /dev/XXXXX               # swap
  2. install base packages to system:

    pacstrap -i /mnt base
  3. save the filesystem table:

    genfstab -U -p /mnt >> /mnt/etc/fstab
POST-BOOTSTRAP OPS
  1. change root to new installation:

    arch-chroot /mnt
  2. set root password:

    passwd
  3. set up a hostname for your machine:

    echo XXXXXXXXXX > /etc/hostname
  4. create the locale file:

    echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
    locale-gen
    echo LANG=en_US.UTF-8 > /etc/locale.conf
    export LANG=en_US.UTF-8
  5. install the bootloader:

    pacman -S base mkinitcpio grub efibootmgr os-prober linux-firmware linux XXXXXX-ucode                    # install microcode for platform CPUs [intel/amd]
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB # install GRUB
    grub-mkconfig -o /boot/grub/grub.cfg
  6. install and enable network manager service for managed internet connectivity:

    pacman -S networkmanager
    systemctl enable NetworkManager
    systemctl enable systemd-networkd
  7. exit and reboot to installed linux:

    pacman -S sudo vi
    exit
    umount -R /mnt
    systemctl reboot
  8. Disconnect Live USB now

INITIAL CONFIGURATION
  1. check internet connectivity:

    ping google.com -c3
  2. set up your timezone:

    rm /etc/localtime
    ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
    timedatectl set-ntp true
    timedatectl set-local-rtc 1 --adjust-system-clock
  3. create a user:

    useradd -g users -G wheel,power,storage -m tm9k1        # replace tm9k1 with your username of choice
    passwd tm9k1
    EDITOR=nano visudo

    User privilege specification

    root ALL=(ALL) ALL

    tm9k1 ALL=(ALL) ALL

  4. Log out and log in as your normal user.

ESSENTIALS
  1. Set up pacman:

    sudo pacman -Syu haveged
    sudo systemctl start haveged
    sudo systemctl enable haveged
    
    sudo rm -fr /etc/pacman.d/gnupg
    sudo pacman-key --init
    sudo pacman-key --populate archlinux
    sudo pacman -S archlinux-keyring
    sudo pacman -Syuu
  2. Set up AUR helper [Arch User Repository]

    1. install yay, our AUR helper:

      sudo pacman -S --needed base-devel git wget yajl # Y-A-J-L
      cd /tmp
      git clone https://aur.archlinux.org/yay.git && cd yay
      makepkg -si && cd ..

      that fakeroot-tcp reddit link

    2. Include AUR repos in pacman conf (for use by AUR helper)

      sudo nano /etc/pacman.conf

      append this text at the end of the file:

      [archlinuxfr]
      SigLevel = Never
      Server = http://repo.archlinux.fr/$arch

      update the repositories' database

      sudo pacman -Syu
      sudo pacman -Fy
  3. Get Bluetooth Protocol Stack

    sudo pacman -S pulseaudio-bluetooth
  4. Get Plasma

    sudo pacman -S xorg plasma konsole
    sudo systemctl enable sddm.service
DRIVERS | OTHER SOFTWARE
  • [DRIVER] [GRAPHICS] [intel]:

    sudo pacman -S xf86-video-intel
  • [DRIVER] [GRAPHICS] [nvidia]:

    sudo pacman -S nvidia
  • [DRIVER] [WIFI] [broadcom]:

    pacman -S broadcom-wl
  • [SOFTWARE] [DOCKER]

    sudo pacman -S docker pigz
    sudo usermod -aG docker $USER
    sudo systemctl enable docker
  • [SOFTWARE] [ESSENTIALS]

    sudo pacman -S nano openssh code \
                   gwenview kimageformats \
                   kdeconnect libnotify \
                   firefox kdialog \
                   dolphin ffmpegthumbs ntfs-3g kdegraphics-thumbnailers \
                   ark p7zip unrar lzop lrzip \
                   telegram-desktop ttf-opensans noto-fonts-emoji\
                   spectacle yakuake screenfetch \
                   remmina freerdp \
                   discord 
    yay -S code-marketplace code-features icu69 
TIPS TRICKS TUTORIALS
  • if Wired Ethernet stops working:

    nmcli connection show
    
    # DELETE ANY EXISITING ETHERNET CONNECTIONS FROM THE LIST
    
    nmcli connection add type ethernet
    nmcli connection up ethernet
  • if you have a ipv6 address on the network but no ipv4 address, try releasing and renewing your IP address

    sudo dhclient -r wlp2s0
    sudo dhclient wlp2s0
  • Enable MDNS

    sudo pacman -S nss-mdns avahi --noconfirm
    sudo systemctl enable avahi-daemon
    sudo nano /etc/nsswitch.conf
    • add this piece to the hosts line:

      hosts: files mymachines myhostname mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns

  • Refresh pacman keys after a long time (GPG issues)

     sudo pacman-key --refresh-keys
    
Raspberry Pi 4 extras
  • Force HDMI output

    hdmi_force_hotplug=1
    
    # hdmi_group=2          # DMT
    # hdmi_mode=82          # 1080p
    
    # hdmi_group=2          # DMT
    # hdmi_mode=85          # 720p
    
    hdmi_group=1            # CEA
    hdmi_mode=63            # 1080p
    
    # hdmi_group=1          # CEA
    # hdmi_mode=46          # 1080i
  • Add support for GPIO:

    sudo groupadd -f -r gpio
    sudo groupadd -f -r i2c
    sudo groupadd -f -r spi
    sudo usermod -aG gpio,spi,i2c `whoami`
    sudo nano /etc/udev/rules.d/99-gpio.rules
    SUBSYSTEM=="bcm2835-gpiomem", KERNEL=="gpiomem", GROUP="gpio", MODE="0660"
    SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="/bin/sh -c > 'chown root:gpio /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'"
    SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:gpio /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value ; chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"
    sudo pacman -S python-pip
    sudo pip install wheel
    sudo CFLAGS="-fcommon" pip install rpi.gpio

Have Fun! o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment