Skip to content

Instantly share code, notes, and snippets.

@derekstavis
Created January 15, 2018 15:29
Show Gist options
  • Save derekstavis/2efa6c90b5afd0d738d0ea8c1ae8cf19 to your computer and use it in GitHub Desktop.
Save derekstavis/2efa6c90b5afd0d738d0ea8c1ae8cf19 to your computer and use it in GitHub Desktop.
Mostly adequate guide to Arch Linux installation

Arch Linux is a distribution that's always on the most recent version of software packages, differing from other distros like Ubuntu and Debian, which releases a major/minor of all packages just in new releases. Another good point is that on Arch most configurations are default and just work, so you won't get Canonical's or RedHat's opinions in your operating system.

Although, not everything is flowrs. Arch's installation isn't graphical, that's why I've created a time ago a sequence of commands to help friends to install Arch Linux with GNOME with the setup I consider ideal for developers.

After booting the USB drive with the installation (download at https://www.archlinux.org/download/) just follow these steps:

WARNING: You need to have UEFI boot (disable CSM mode in your BIOS)

DISCLAIMER: This will erase all the data in your computer.

> fdisk /dev/sdX # where X is your root device
g<enter>
n<enter>
<enter>
<enter>
+500M<enter> # if it asks something, reply Y
n<enter>
<enter>
<enter>
+60G<enter>
n<enter>
<enter>
<enter>
+2G<enter>
n<enter>
<enter>
<enter>
<enter>
t<enter>
1<enter>
1<enter>
w<enter>
> mkfs.vfat /dev/sdX1
> mkfs.xfs /dev/sdX2
> mkfs.xfs /dev/sdX4
> mount /dev/sdX2 /mnt
> mkdir /mnt/boot
> mount /dev/sdX1 /mnt/boot
> pacstrap /mnt base base-devel
> arch-chroot /mnt
> pacman -S gnome networkmanager sudo vim
> bootctl install
> cp /usr/share/systemd/bootctl/loader.conf /boot/loader/loader.conf
> cp /usr/share/systemd/bootctl/arch.conf /boot/loader/entries/arch.conf
> vi /boot/loader/entries/arch.conf
<esc>:r! blkid /dev/sdX2 # keep "options" like "options    root=PARTUUID=xxxxx rw"
<esc>:wq
> vim /etc/locale.gen # uncomment en_US.UTF-8
> locale-gen
> vim /etc/fstab
<esc>:r! blkid /dev/sdX4
# format the text to be like "PARTUUID=xxxxxx /home xfs rw 0 0" (no quotes on PARTUUID) 
> exit
> reboot
> localectl set-locale LANG=en_US.UTF-8
> hostnamectl set-hostname <your-hostname>
> systemctl enable gdm NetworkManager
> useradd -m -G wheel <your-username>
> passwd <your-username> # and set your password
> passwd # set root password
> vim /etc/sudoers # and uncomment wheel permissions
> systemctl start gdm NetworkManager

After executing these steps you should be presented with GNOME login screen.

I also add some useful packages:

> pacman -S gst-plugins-good gst-pugins-bad gst-plugins-ugly gst-libav # various codecs
> pacman -S gnome-tweak-tool # change system themes, font size, etc
> pacman -S gnome-boxes # better than virtual box

INFO: It's possible to specify all packages in a single pacman -S, it's not necessary to run line per line if you want everything.

Another cool stuff on Arch Linux is Arch User Repository (or AUR). To install a pacman wrapper which also installs packages from AUR (necessary for getting Google Chrome):

> cd /tmp
> curl -L https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz -o package-query.tar.gz
> curl -L https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz -o yaourt.tar.gz

> tar xvzf package-query.tar.gz
> tar xvzf yaourt.tar.gz

> cd package-query
> makepkg -si

> cd ../yaourt
> makepkg -si

From now you can always use yaourt. To install Google Chrome:

> yaourt -S --noconfirm google-chrome

Here's more AUR awesome:

> yaourt -S --noconfirm wps-office ttf-wps-fonts # a microsoft office compatible clone
> yaourt -S --noconfirm telegram-desktop-bin # telegram desktop client
> yaourt -S --noconfirm tilix # the best terminal application
> yaourt -S --noconfirm zoom # the video conference tool
> yaourt -S --noconfirm nasc-git # text editor like calculator
> yaourt -S --noconfirm watchman # useful for improving webpack file watcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment