Skip to content

Instantly share code, notes, and snippets.

@mellowagain
Last active November 4, 2019 18:17
Show Gist options
  • Save mellowagain/df8ae1624d4ab4dde55771257cd6750b to your computer and use it in GitHub Desktop.
Save mellowagain/df8ae1624d4ab4dde55771257cd6750b to your computer and use it in GitHub Desktop.
How to install Arch Linux on UEFI systems. It is recommended to follow the Arch Wiki Installation guide, but if you're retarded like me, this will help you.
# Before typing any commands, we should set the keyboard layout for your keyboard.
# Replace de_CH-latin1 with your keyboard layout.
# If you have the US keyboard layout, skip this step.
loadkeys de_CH-latin1

# Before installing Arch, be sure that your computer is connected to the internet.
dhcpcd
ping -c 3 archlinux.org

# If you wish to use Wifi, open the wifi menu using the command below and follow the wizard.
wifi-menu

# If no internet is available, stop the dhcpcd service using the command below and see the network configuration.
# https://wiki.archlinux.org/index.php/Network_configuration#Device_driver
systemctl stop dhcpcd@<TAB>

# Partition your disk how you want.
# I recommend a seperate /home/, /, swap & UEFI partition

lsblk
cfdisk /dev/sda

# I configured it like this:
#
# 1.82TB HDD - 16GB Ram
# +-----------+------+-------------+
# | /dev/sda  | Size | Mount Point |
# +-----------+------+-------------+
# | /dev/sda1 |  8G  | linux-swap  |
# +-----------+------+-------------+
# | /dev/sda2 | 512M | /boot/efi   |
# +-----------+------+-------------+
# | /dev/sda3 |  1T  | /home/      |
# +-----------+------+-------------+
# | /dev/sda4 | 830G | /           |
# +-----------+------+-------------+

# Activate the swap (/dev/sda1 - 8G)
mkswap /dev/sda1
swapon /dev/sda1

# Format the EFI parition in VFAT (/dev/sda2 - 512M)
mkfs.vfat /dev/sda2

# Format the home parition (/dev/sda3 - 1T)
mkfs.ext4 /dev/sda3

# Format the root partition (/dev/sda4 - 830G)
mkfs.ext4 /dev/sda4

# Mount the file systems
mount /dev/sda4 /mnt

mkdir /mnt/home
mount /dev/sda3 /mnt/home

mkdir -p /mnt/boot/efi
mount /dev/sda2 /mnt/boot/efi

# Choose the closest mirror
pacman -Sy 
pacman -S reflector
reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist

# Install the Arch Linux base package
pacstrap -i /mnt base base-devel linux linux-firmware nano

# Configure fstab
genfstab -U -p /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstab

# Login into your new installed system
arch-chroot /mnt

# Configure language
# Uncomment en_US.UTF-8 in the file below (remove the # infront of it)
nano /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8

# Configure keymap
echo "KEYMAP=de_CH-latin1" >> /etc/vconsole.conf

# Set time zone
rm -rf /etc/localtime
ls /usr/share/zoneinfo
ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

# Update hardware clock to your time zone
hwclock --systohc --utc

# Configure multilib repository
# Uncomment the lines: [multilib] and include = /etc/pacman.d/mirrorlist (remove the # infront)
nano /etc/pacman.conf
pacman -Sy

# Set hostname for the machine
# Add under the last line:
# 127.0.0.1   marc-arch.localdomain   marc-arch
nano /etc/hosts
echo "marc-arch" > /etc/hostname

# Enable network connection after next restart
# To find out your network link, type "ip link show" and find your network device.
systemctl enable dhcpcd@<Your network link>.service

# Set root password
passwd 
pacman -S sudo bash-completion

# Add a user
useradd -m -g users -G wheel,storage,power,log -s /bin/bash marc
passwd marc

# Allow the users in the wheel group to execute sudo commands
# Uncomment the line: %wheel ALL=(ALL) (remove the # infront)
EDITOR=nano visudo

# Install the GRUB boot loader
mkinitcpio -p linux
pacman -S grub os-prober efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot/efi /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

# Exit back to the arch iso, unmount and reboot
exit
umount -R /mnt
reboot

# Success! Login now with your username and password.
# You probably want to install packages from the aur, so let's install yay.
sudo pacman -S git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

# Let's install neofetch now to get a nice overview over our installed system.
yay -S neofetch
neofetch

# It should look something like this
#                   -`                    marc@marc-main-machine
#                  .o+`                   ----------------------
#                 `ooo/                   OS: Arch Linux x86_64
#                `+oooo:                  Host: MS-7A34 4.0
#               `+oooooo:                 Kernel: 4.14.12-1-ARCH
#               -+oooooo+:                Uptime: 19 mins
#             `/:-:++oooo+:               Packages: 1617
#            `/++++/+++++++:              Shell: zsh 5.4.2
#           `/++++++++++++++:             Resolution: 1920x1080, 1920x1080
#          `/+++ooooooooooooo/`           DE: GNOME
#         ./ooosssso++osssssso+`          WM: GNOME Shell
#        .oossssso-`''`/ossssss+`         WM Theme: Arc-Dark
#       -osssssso.      :ssssssso.        Theme: Arc-Dark [GTK2/3]
#      :osssssss/        osssso+++.       Icons: Numix-Circle [GTK2/3]
#     /ossssssss/        +ssssooo/-       Terminal: gnome-terminal
#   `/ossssso+/:-        -:/+osssso+-     CPU: AMD Ryzen 5 1600 (12) @ 3.200GHz
#  `+sso+:-`                 `.-/+oso:    GPU: NVIDIA GeForce GTX 1060 6GB
# `++:.                           `-/+/   Memory: 4431MiB / 16057MiB
# .`                                 `/ 

# The below is optional and is no longer required for further installation.

# Lets install drivers
sudo pacman -S nvidia nvidia-utils lib32-nvidia-utils # NVIDIA
sudo pacman -S mesa # AMD

# Restart now to enable the driver kernel modules.
reboot

# Let's install a desktop environment and a login manager. I'll be using Gnome and LightDM
sudo pacman -S gnome gnome-extra
yay -S lightdm lightdm-webkit2-greeter

# Edit the /etc/lightdm/lightdm.conf file to change the following lines to this:
# logind-check-graphical=true
# greeter-session=lightdm-webkit2-greeter
# Let's enable LightDM now
sudo systemctl enable lightdm.service
reboot

# LightDM should greet you now and you should be able to login.
@penguu
Copy link

penguu commented Mar 4, 2018

nice one marcypoo

@raspbianlike
Copy link

i want to kill myself

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