Last active
June 5, 2023 17:37
-
-
Save davidpeach/71de7a956f913805b65911fee3050c68 to your computer and use it in GitHub Desktop.
Arch Linux Installation on EFI laptop (Thinkpad T470)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These are the steps I take to install a fresh copy of Arch Linux on to my Lenovo Thinkpad T470 | |
# Spec: i5; 16gb RAM; Integrated Intel 620 graphics; SSD; | |
# This will go from the very start up to having a base installation ready to add you chosen window manager or desktop environment. | |
# Make a bootable usb stick with the latest version of Arch Linux on. | |
# Plug to into computer and boot. | |
# Connecting to Internet (wifi) | |
iwctl device list | |
iwctl station wlan0 scan | |
iwctl station wlan0 get-networks | |
iwctl --passphrase <YOUR_PASSPHRASE> station wlan0 connect <YOUR_SSID> | |
loadkeys uk | |
# Partition the hard drive | |
cfdisk | |
# Delete all old partitions using to ui | |
# Create a new partition of 100M in size | |
# Create a new partition of 16G in size | |
# Create a new partition of the rest of the disk (leave the size as what it puts in for you) | |
# Select "write" and type yes and hit enter for each partition | |
# Making the filesystems in the partitions | |
mkfs.ext4 /dev/sda3 | |
mkfs.fat -F32 /dev/sda1 | |
mkswap /dev/sda2 | |
# Mount a prepare new boot directories | |
mount /dev/sda3 /mnt | |
mkdir -p /mnt/boot/efi | |
mount /dev/sda1 /mount/boot/efi | |
swapon /dev/sda2 | |
# Initial pacman setup | |
pacman -Sy archlinux-keyring | |
pacstrap /mnt base linux-lts linux-firmware base-devel grub efibootmgr neovim networkmanager | |
genfstab /mnt > /mnt/etc/fstab | |
arch-chroot /mnt | |
# Timezone configuration | |
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime | |
hwclock --systohc | |
nvim /etc/locale.gen | |
# uncommet the line with `eb_GB.UTF-8 UTF-8 | |
# Save and exit | |
locale-gen | |
nvim /etc/locale.conf | |
# Add "LANG=eb_GB.UTF-8" | |
# Save and exit | |
nvim /etc/vconsole.conf | |
# ADD "KEYMAP=uk" | |
# Save and exit | |
nvim /etc/hostname | |
# Add your chosen hostname | |
# Save and exit | |
passwd | |
# Add and confirm root password | |
# Create non-root user | |
useradd -m -G wheel,audio,optical,storage,video <YOUR_NAME> | |
passwd <YOUR_NAME> | |
# Add and confirm your user password | |
EDITOR=nvim visudo | |
# Uncomment the line with "%wheel ALL=(ALL)ALL" | |
# Save and exit | |
systemctl enable NetworkManager | |
grub-install /dev/sda | |
grub-mkconfig -o /boot/grub/grub.cfg | |
exit | |
umount -a | |
reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo pacman -S \ | |
acpid \ | |
alsa-utils \ | |
curl \ | |
xorg-server \ | |
xorg-xinit \ | |
git \ | |
libva-utils \ | |
libva-intel-driver \ | |
i3-wm \ | |
dmenu \ | |
dunst \ | |
bashtop \ | |
firefox \ | |
fontconfig \ | |
fzf \ | |
github-cli \ | |
kitty \ | |
libnotify \ | |
lynx \ | |
openssh \ | |
picom \ | |
ranger \ | |
rofi \ | |
stow \ | |
task \ | |
tmux \ | |
unzip \ | |
xclip | |
sudo systemctl enable --now acpid | |
git clone https://github.com/davidpeach/dotfiles dots | |
rm ~.,bashrc | |
stow bashtop | |
stow bin | |
stow dunst | |
stow home | |
stow home | |
stow i3 | |
stow kitty | |
stow lynx | |
stow nvim | |
stow picom | |
stow pictures | |
stow ranger | |
stow rofi | |
stow ssh | |
stow task | |
stow tmux | |
startx | |
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm | |
# Install plugins in tmux | |
git config --global user.name "<YOUR_NAME>" | |
git config --global user.email "<YOUR_EMAIL>" | |
git config --global push.autoSetupRemote true | |
git config core.fileMode false | |
gpg --full-generate-key | |
# Choose "1 RSA and RSA" | |
# Keysize 4096 | |
# Key doesn't expire | |
# Answer all questions and create key | |
# Link gpg key with git | |
gpg --list-secret-keys --keyid-format=long | |
# Copy the section of "sec" after "rsa4096" | |
git config --global user.signingkey "YOUR_SIGNING_KEY_IDENTIFIER" | |
# Tell github about gpg | |
gpg --armor --export YOUR_SIGNING_KEY_IDENTIFIER | xclip -sel clipboard | |
# paste into new gpg field in github website settings. | |
# Setup Github cli | |
# Create a legacy access token in github developer settings with your required scopes (i choose all) | |
gh auth login | |
# Choose GitHub.com | |
# Set preferred protocol for git to ssh | |
# Say yes to generating ssh key and adding it to account | |
# No passphrase | |
# give the key a name (not important) | |
# Authentication choose "Paste an authentication token" | |
# Paste in your token and hit Enter | |
# Setup ssh key | |
ssh-keygen -t rsa | |
# Keep defaults and create the keys1 | |
cat ~/.ssh/id_rsa.pub | xclip -sel clipboard | |
# Paste into github account ssh area | |
# Copy id to my main other workstation | |
ssh-copy-id [email protected].??? | |
# Setup local network stuff | |
# Add Include directive to local `.ssh/config` file | |
Include ~/.config/ssh.d/* | |
# Update git remote for dotfiles to use ssh | |
git remote set-url origin [email protected]:davidpeach/dotfiles.git | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment