Skip to content

Instantly share code, notes, and snippets.

@hoel-bagard
Last active August 17, 2021 06:20
Show Gist options
  • Select an option

  • Save hoel-bagard/37f1aa8d38bb780c1c72bc3e390ec211 to your computer and use it in GitHub Desktop.

Select an option

Save hoel-bagard/37f1aa8d38bb780c1c72bc3e390ec211 to your computer and use it in GitHub Desktop.
Arch Linux install commands

Main Install

Early commands

loadkeys jp106
Check if in efi mode: ls /sys/firmware/efi/efivars (should execute without error)
timedatectl set-ntp true

Partition the disks

Create the partitions

List devices: fdisk -l
fdisk /dev/sda (or whichever device is to be used) 1G for boot 4G swap Rest to root partition

Format the partitions:

mkfs.vfat /dev/boot_partition -n BOOT
mkswap /dev/swap_partition -L SWAP
mkfs.ext4 /dev/root_partition -L ROOT

Mount the file systems

mount /dev/root_partition /mnt
mkdir /mnt/boot
mount /dev/boot_partition /mnt/boot
swapon /dev/swap_partition

Select mirrors

reflector --verbose --protocol https --latest 50 --sort rate --save /etc/pacman.d/mirrorlist

Install essential packages

pacstrap /mnt base base-devel linux-lts linux-lts-headers nvidia-dkms linux-firmware bash-completion vim nano dhcpcd

Configure the system

Fstab:

genfstab -U /mnt >> /mnt/etc/fstab

Chroot:

arch-chroot /mnt

Remove the annoying beeping sound with rmmod pcspkr.

Time:

ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
hwclock --systohc

Localization:
Uncomment en_US.UTF-8 UTF-8 in /etc/locale.gen and then run locale-gen

echo "LANG=en_US.UTF-8" >> /etc/locale.conf
echo "KEYMAP=jp106" >> /etc/vconsole.conf

Network configuration (change myhostname to a proper name):

echo "myhostname" >> /etc/hostname
echo "127.0.0.1	localhost" >> /etc/hosts
echo "::1		localhost" >> /etc/hosts
echo "127.0.1.1	myhostname.localdomain	myhostname" >> /etc/hosts
systemctl enable dhcpcd

Set root password: passwd

Install more packages:
(Replace amd-ucode by intel-ucode depending on the cpu brand)\

sudo pacman -S amd-ucode wget git exa htop nvtop bat mlocate

(Use the updatedb command to create the locate database)

Boot loader (grub):

grub-mkconfig will automatically detect the microcode update and configure GRUB appropriately. After installing the microcode package, regenerate the GRUB config to activate loading the microcode update by running:

pacman -S grub efibootmgr
mkdir /boot/efi
mount /dev/sda1 /boot/efi
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

Sudo

pacman -S sudo
groupadd sudo
EDITOR=vim visudo

--> uncomment sudo ALL=(ALL) ALL

Add a sudo user:

useradd -m hoel
usermod -aG sudo hoel
passwd hoel

Others:

SSH

Install and enable (especially for servers)

pacman -S openssh
systemctl enable sshd.service

Generating keys and adding them to github

TODO https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

KDE

chrome firefox, etc...
Don't install all the KDE bloatware

Yay

Must be done as a normal sudo user.

git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd ..
sudo rm -r yay

Fonts

pacman -S noto-fonts adobe-source-han-sans-otc-fonts adobe-source-han-serif-otc-fonts adobe-source-code-pro-fonts ttf-roboto ttf-dejavu ttf-liberation

Spacemacs

sudo pacman -S emacs
git clone --single-branch --branch develop https://github.com/syl20bnr/spacemacs ~/.emacs.d

zsh

sudo pacman -S zsh neofetch

oh-my-zsh

sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

Changes in config

In ~/.oh-my-zsh/lib/misc.zsh, change:
env_default 'LESS' '-R' (when using git diff (or other similar commands), shows results in an alternate screen)
to:
env_default 'LESS' '-FRSX' ("Usual" console output)

powerlevel10k

Install fonts

mkdir temp_fonts
cd temp_fonts
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf
sudo mv *.ttf  /usr/share/fonts/
cd ..
rmdir temp_fonts

Install powerlevel10k

yay -S --noconfirm zsh-theme-powerlevel10k-git
echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc

Clone .dotfiles

git clone --separate-git-dir=$HOME/.dotfiles git@github.com:hoel-bagard/.dotfiles.git $HOME/myconf-tmp --recurse-submodules
mv -v ~/myconf-tmp/.* ~/
mv -v ~/myconf-tmp/README.md ~/
rmdir myconf-tmp
source .zshrc

Install plugins

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
source .zshrc

In /etc/pacman.conf, to go back to 2021-05-15:

[core]
SigLevel = PackageRequired
Server=https://archive.archlinux.org/repos/2021/05/15/$repo/os/$arch

[extra]
SigLevel = PackageRequired
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch

[community]
SigLevel = PackageRequired
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch

And to go back to normal usage:

[core]
Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

[community]
Include = /etc/pacman.d/mirrorlist

Office vpn

https://gist.github.com/pastleo/aa3a9524664864c505d637b771d079c9

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