Skip to content

Instantly share code, notes, and snippets.

@ll931217
Last active April 28, 2020 23:19
Show Gist options
  • Save ll931217/bf1f551d0dfdc69a9318e033c213313a to your computer and use it in GitHub Desktop.
Save ll931217/bf1f551d0dfdc69a9318e033c213313a to your computer and use it in GitHub Desktop.
Steps taken to install arch linux

Partitioning

Check the list of dists on the system

fdisk -l

Partitioning Utility

cfdisk <drive_name>

Enter dos, create 2 partitions:

  • swap partition: half the size of your RAM.
  • root partition: whatever the size you want and set it to bootable.
  • (Optional) home partition: some people like to have this partition, you can make the size of your root partition like 20% or the size of the home partition.

Formatting the root partition

mkfs.ext4 <root_partition_name>

Preinstallation

Internet connection

If you are using the ethernet cable then it should be connected by default. However, if you are using the the Wifi then enter wifi-menu to select the network.

Mounting the root drive

mount <root_partition_name> /mnt

Make the swap file on the swap partition

mkswap <swap_partition_name>

Utilising the swap

swapon <swap_partition_name>

Installation

Installing the base system

pacstrap /mnt base base-devel

Configuring Installation

Chroot into the partition to configure

arch-chroot /mnt

Create new root password

passwd

Install prerequesite programs

pacman -S vim vi dialog wpa_supplicant networkmanager nm-connection-editor network-manager-applet
systemctl enable networkmanager

Edit the locale.gen file

nano/vim /etc/locale.gen

Uncomment the languages you want to use then create the locale file:

locale-gen

Set up timezone

Check the folders and files in the /usr/share/zoneinfo directory. Find your country then create a symlink of it to the localtime file.

ln -s /usr/share/zoneinfo/<continent>/<city> /etc/localtime

If the localtime file exists, just remove it and run that command again.

Set your hostname

echo <your_choosen_hostname> > /etc/hostname

Installing grub bootloader

pacman -S grub-bios mkinitcpio linux

Install grub to hard drive

grub-install <the_hard_drive_not_partition>

Create init file containing info of your hardware

mkinitcpio -p linux

Generate the grub configuration file

grub-mkconfig -o /boot/grub/grub.cfg

Exit the chroot session by typing in exit

Generate fstab

A fstab file contains information to our partitions.

genfstab /mnt >> /mnt/etc/fstab

Unmount the root partition

umount /mnt

Setting up your Arch Linux for dual booting

Check if system is UEFI mode

ls /sys/firmware/efi/efivars

BIOS mode

Configuration

Find the bootmgr file

To find the bootmgr file you will need to find the partition that is labeled SYSTEM RESERVED or SYSTEM with the command:

blkid

Once you find the partition, mount it to a directory of your choice. I mounted mine onto /media/SYSTEM_RESERVED/

mount /dev/sda1 /media/SYSTEM_RESERVED

Get the Filesystem UUID

Make sure to take the output down somewhere

grub-probe --target=fs_uuid /media/SYSTEM_RESERVED/bootmgr

Get the filesystem info

Make sure to take the output down somewhere

grub-probe --target=hints_string /media/SYSTEM_RESERVED/bootmgr

Edit the grub.cfg

nano/vim /etc/grub.d/40_custom

or

nano/vim /etc/grub.d/custom

Add in this line:

if [ "${grub_platform}" == "pc" ]; then
	menuentry "Microsoft Windows Vista/7/8/8.1 BIOS-MBR" {
		insmod part_msdos
		insmod ntfs
		insmod search_fs_uuid
		insmod ntldr     
		search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE
		ntldr /bootmgr
	}
fi

Update the grub.cfg

grub-mkconfig -o /boot/grub/grub.cfg

Now reboot and you should see the window entry

Create a normal user

Creating the user

useradd -m -g users -s /bin/bash <username>

The -m is for creating the user home directory in /home/<username>. The -g is for creating the user in the users group. The -s /bin/bash is for setting the default bash as the user's default terminal.

Setting the password

passwd <username>

Give the user sudo

visudo

Scroll down until you find the line root ALL=(ALL) ALL then you enter below that line <username> ALL=(ALL) ALL

Installing Prerequisites

Internet Connection

First check if you have internet connection:

ping www.google.com

If the ping fails then check if dhcpcd.service is running, if not then run it

Display server

pacman -S xorg-server xorg-apps xorg-xinit

Display driver

The following are the fallback drivers:

  • AMD: xf86-video-amdgpu
  • Intel: xf86-video-intel
  • Nvidia: xf86-video-nouveau
  • Not sure/VirtualBox: xf86-video-vesa
  • VMWare: xf86-video-vmware

Display Manager

  • KDE Plasma 5: sddm
  • GNOME: gdm
  • LXDE: lxdm
  • Universal Display Managers: lightdm, mdm-display-manager, slim, xorg-xdm

lightdm needs to have a greeter installed otherwise it won't load. The default greeter is lightdm-gtk-greeter

Desktop Environment

  • KDE Plasma 5: plasma
  • Cinnamon: cinnamon
  • GNOME: gnome
  • LXDE: lxde-gtk3
  • MATE: mate-gtk3
  • Xfce: xfce4

DE Extras

  • KDE Plasma 5: kde-applications
  • Cinnamon: nemo-fileroller
  • GNOME: gnome-extra
  • LXDE: installed along with DE
  • MATE: mate-extra
  • Xfce: xfce4-goodies

Start DM on boot

systemctl enable <display_manager>

Installing a splash screen

Programs

  • Splashy
  • Plymouth

Programs to Install

Download This File

pacman -S wget
wget https://s3-ap-southeast-1.amazonaws.com/linuxconfigs/setup.sh

OR Yaourt

pacman -S wget git yajl
cd /tmp
git clone https://aur.archlinux.org/package-query.git
cd package-query
makepkg -si
cd ..
git clone https://aur.archlinux.org/yaourt.git
cd yaourt
makepkg -si
cd ..
rm -rf package-query yaourt

Install i3-gaps and dependencies

yaourt -S lightdm lightdm-webkit2-greeter lightdm-webkit-theme-sequoia-git i3-gaps playerctl cava rofi gnome-terminal dconf gsettings-desktop-schemas vte3 nautilus itstool desktop-file-utils appstream-glib lxappearance firefox polybar powerline-fonts awesome-terminal-fonts dconf-editor pulseaudio-alsa pavucontrol

Enable Timesync

timedatectl set-ntp true

Customizing GTK

nmcli examples

List nearby wifi networks:

nmcli device wifi list

Connect to a wifi network:

nmcli device wifi connect SSID password password

Connect to a hidden network:

nmcli device wifi connect SSID password password hidden yes

Connect to a wifi on the wlan1 wifi interface:

nmcli device wifi connect SSID password password ifname wlan1 profile_name

Disconnect an interface:

nmcli device disconnect ifname eth0

Reconnect an interface marked as disconnected:

nmcli connection up uuid UUID

Get a list of UUIDs:

nmcli connection show

See a list of network devices and their state:

nmcli device

Turn off wifi:

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