Skip to content

Instantly share code, notes, and snippets.

@darkslategrey
Created April 4, 2019 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkslategrey/b97c70bac49e90319a45428cdaf5c956 to your computer and use it in GitHub Desktop.
Save darkslategrey/b97c70bac49e90319a45428cdaf5c956 to your computer and use it in GitHub Desktop.
Installing Arch
O portatil precisa de pci=noaer e acpi_osi= nas boot options

Installing Arch Linux

Get the Wiki ready!

Installing the base system

  1. Set the keymap to fit your keyboard layout with loadkeys. The default keymap is US. To list all available keymaps do ls /usr/share/kbd/keymaps/**/*.map.gz.

  2. To verify that UEFI was used, do ls /sys/firmware/efi/efivars. If the folder doesn't exist, UEFI wasn't used.

  3. Verify that you have an internet connection with ping -c 4 www.google.com. If planning to use wifi, use the wiki.

  4. Use timedatectl set-ntp true to make sure the system clock is accurate. You can verify it worked with timedatectl status.

  5. Identify the hard drive you're going to use for the installation with lsblk. I'm using /dev/sda.

  6. Create a new GPT on the disk with gdisk /dev/sda, then o and then w.

  7. Create the partitions with cgdisk /dev/sda. I've created an EFI partition (code ef00), a SWAP partition (code 8200), and a root partition (code 8300). Don't forget to write your changes.

  8. Activate the SWAP partition with mkswap /dev/sda2 and then swapon /dev/sda2.

  9. Format your other partitions. I used mkfs.fat -F32 /dev/sda1 to format the EFI partition and mkfs.ext4 /dev/sda3.

  10. Mount your root partition with mount /dev/sda3 /mnt and then mount the EFI partition with mkdir /mnt/boot and then mount /dev/sda1 /mnt/boot.

  11. Update /etc/pacman.d/mirrorlist and install the base system with pacstrap -i /mnt base base-devel zsh zsh-completions git networkmanager openssh. Add nvidia to the list if you have an NVidia graphics card.

  12. Generate the fstab file with genfstab -U /mnt >> /mnt/etc/fstab.

  13. Chroot into your system with arch-chroot /mnt.

  14. Set your timezone. I live in Portugal so I'll do ln -sf /usr/share/zoneinfo/Europe/Lisbon /etc/localtime. I can see the other timezones with tzselect.

  15. Set the hardware clock with hwclock --systohc. Make sure the hardware clock is using UTC.

  16. Uncomment the locales you're going to use with nano /etc/locale.gen. Update the file with locale-gen.

  17. Select the system language with one of the locales you uncommented using echo LANG=en_US.UTF-8 > /etc/locale.conf.

  18. Do echo KEYMAP=us-acentos > /etc/vconsole.conf to set the system keymap. Replace us-acentos with the keymap you used in the beginning.

  19. Set the hostname with echo ArchBook > /etc/hostname. Replace ArchBook with whatever you want.

  20. Do nano /etc/hosts and add the following lines to the file:

127.0.0.1	localhost.localdomain	localhost
::1		localhost.localdomain	localhost
127.0.0.1	ArchBook.localdomain	ArchBook
::1		ArchBook.localdomain	ArchBook

Change ArchBook for the hostname you've choosen.

  1. Enable Network Manager with systemctl enable NetworkManager.

  2. Enable OpenSSH with systemctl enable sshd.

  3. Create a new initramfs by doing mkinitcpio -p linux.

  4. Do passwd to give the root user a password.

  5. Install refind with pacman -S refind-efi and install it with refind-install --usedefault /dev/sda1 --alldrivers. To make refind update itself, do mkdir /etc/pacman.d/hooks and then nano /etc/pacman.d/hooks/refind.hook and add the following to the file:

[Trigger]
Operation=Upgrade
Type=Package
Target=refind-efi

[Action]
When=PostTransaction
Exec=/usr/bin/refind-install --usedefault /dev/sda1 --alldrivers
  1. Do echo resume=$(blkid /dev/sda2 | cut -d ' ' -f 5 | tr -d '"') > /boot/refind_linux.conf, then echo root=$(blkid /dev/sda3 | cut -d ' ' -f 5 | tr -d '"') >> /boot/refind_linux.conf and then nano /boot/refind_linux.conf. Edit the file:
"Arch"		"resume=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX root=PARTUUID=YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY rw initrd=/intel-ucode.img initrd=/initramfs-linux.img quiet loglevel=3"
"Arch - CLI"	"resume=PARTUUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX root=PARTUUID=YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY rw initrd=/intel-ucode.img initrd=/initramfs-linux.img systemd.unit=multi-user.target"
  1. If using an Intel CPU do pacman -S intel-ucode. You can check your CPU with lscpu.

  2. Do exit, then umount -R /mnt and then poweroff.


Basic installations

  1. Login with root and the password you set earlier.

  2. Change the shell with chsh -s /bin/zsh.

  3. Add a group for sudoers with groupadd sudoers.

  4. Add a user with useradd -m -g sudoers -s /bin/zsh -c "Carlos Pinto" pill. Change pill for the username you want.

  5. Give your user a password with passwd pill.

  6. Do EDITOR=nano visudo and add %sudoers ALL=(ALL) ALL on the a new line right after root ALL=(ALL) ALL.

  7. Set your internet connection with nmtui.

  8. Do nano /etc/pacman.conf, uncomment the line #Color and add in a new line after it ILoveCandy. Also uncomment the line #[multilib] and the next one. Do pacman -Syyu to update the settings.

  9. Logout and login with the user you created earlier.

  10. Do the zsh configuration.

  11. Install home directories and neofetch with sudo pacman -S xdg-user-dirs neofetch.

  12. Create a directory and enter it mkdir aur && cd aur.

  13. Clone cower and pacaur with git clone https://aur.archlinux.org/cower.git and https://aur.archlinux.org/pacaur.git.

  14. Enter the cower directory cd cower and do makepkg -sri. (If it fails, do gpg --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53).

  15. Enter the pacaur directory cd ../pacaur and do makepkg -sri again.

  16. Go back to your home directory cd and remove the folder you created sudo rm -r aur.

  17. Do pacaur -S oh-my-zsh-git to install oh-my-zsh.

  18. Customize oh-my-zsh for the user and root.

  19. Do git clone https://github.com/PillTime/rEFInd-minimal-dark.git and enter the folder cd rEFInd-minimal-dark. Follow the instructions.

  20. After that, do cd and then sudo rm -r refind-minimal-dark.

  21. Reboot the computer reboot.


Graphic Installation

  1. Install lightdm-webkit2-greeter accountsservice xorg-server xorg-apps xf86-video-intel mesa lib32-mesa i3-gaps rofi rxvt-unicode.

  2. Enable lightdm (see the wiki page).

  3. Install fonts noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra otf-fira-code.

  4. Install neovim htop firefox feh gdb cgdb scrot youtube-dl.

  5. Install alsa-firmware alsa-utils alsa-oss alsa-plugins alsa-tools lib32-alsa-lib lib32-alsa-oss lib32-alsa-plugins.

  6. Install pulseaudio pulseaudio-alsa pulseaudio-equalizer pulseaudio-jack pulsemixer pulseaudio-ctl mpd ncmpcpp.

  7. Customize .zshrc, .Xresources, .config/nano/nanorc, .config/nvim/init.vim, .config/i3/config, .config/mpd/mpd.conf, .ncmpcpp/config.

  8. Fazer systemctl --user enable mpd.

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