Skip to content

Machorius/ArchLinuxFiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Console keyboard layout

Find out which keyboard layout you are using and then set it using loadkeys:

$ ls /usr/share/kbd/keymaps/**/*.map.gz
$ loadkeys us

Console font

This step is not really necessary, but the Terminus font may appear cleaner than the default one:

$ setfont Lat2-Terminus16

Partitioning

Check the name of the hard disk:

fdisk -l

Use the name (in my case vda) to start the fdisk partitioning tool:

fdisk /dev/vda

UEFI or BIOS?

Run the following command:

$ ls /sys/firmware/efi/efivars

If the command shows the directory without error, then the system is booted in UEFI mode. Else you have to use BIOS mode.

UEFI with GPT

Press g to create a new GPT Partition Table.

We will do it according to the example layout of the Arch wiki:

Mount point Partition Partition type Suggested size
/mnt/boot /dev/efi_system_partition uefi At least 300 MiB
[SWAP] /dev/swap_partition swap More than 512 MiB
/mnt /dev/root_partition linux Remainder of device
Create boot partition
  1. Press n.
  2. Press Enter to use the default first sector.
  3. Enter +300M for the last sector.
  4. Press t and choose 1 and write uefi.
Create swap partition
  1. Press n.
  2. Press Enter to use the default first sector.
  3. Enter +512M for the last sector.
  4. Press t and choose 2 and write swap.
Create root partition
  1. Press n.
  2. Press Enter to use the default first sector.
  3. Enter Enter to use the default last sector.
  4. Press t and choose 3 and write linux.

⚠️* When you are done partitioning don't forget to press w to save the changes!

After partitioning check if the partitions have been created using fdisk -l.

Partition formatting
$ mkfs.ext4 /dev/root_partition
$ mkswap /dev/swap_partition
$ mkfs.fat -F 32 /dev/efi_system_partition
Mounting the file system
$ mount /dev/root_partition /mnt
$ mount --mkdir /dev/efi_system_partition /mnt/boot
$ swapon /dev/swap_partition

BIOS with MBR

Press o to create a new GPT Partition Table.

We will do it according to the example layout of the Arch wiki:

Mount point Partition Partition type Suggested size
[SWAP] /dev/swap_partition swap More than 512 MiB
/mnt /dev/root_partition linux Remainder of device
Create swap partition
  1. Press n.
  2. Press Enter to select the default primary partition type.
  3. Press Enter to use the default first sector.
  4. Enter +512M for the last sector.
  5. Press t and choose 1 and write swap.
Create root partition
  1. Press n.
  2. Press Enter to select the default primary partition type.
  3. Press Enter to use the default first sector.
  4. Enter Enter to use the default last sector.
  5. Press t and choose 2 and write linux.
Make partition bootable

Press a and choose 2 to make the root partition bootable.

⚠️* When you are done partitioning don't forget to press w to save the changes!

After partitioning check if the partitions have been created using fdisk -l.

Partition formatting
$ mkfs.ext4 /dev/root_partition
$ mkswap /dev/swap_partition
Mounting the file system
$ mount /dev/root_partition /mnt
$ swapon /dev/swap_partition

Package install

For a minimal system download and install these packages:

$ pacstrap -K /mnt base base-devel linux linux-firmware e2fsprogs dhcpcd networkmanager sof-firmware git nano vim neovim man-db man-pages texinfo

ℹ️ If you are installing Arch Linux on a computer with ARM architecture add the following to the above pacstrap command:

archlinuxarm-keyring

⚠️ If you get errors due to key then do the following:

  1. Initialize pacman keys and populate them:
pacman-key --init
pacman-key --populate
  1. Synchronize Arch keyring:
archlinux-keyring-wkd-sync

Last steps

Generate fstab file

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

Change root into new system

$ arch-chroot /mnt

Set time zone

$ ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
$ hwclock --systohc

Localization

Edit /etc/locale.gen and uncomment en_US.UTF-8 UTF-8 and other needed locales. Generate the locales by running:

$ locale-gen

Create /etc/locale.conf and set the LANG variable according to your preferred language:

LANG=en_US.UTF-8

Create /etc/vconsole.conf and set the following variables according to your preferred language:

KEYMAP=us
FONT=Lat2-Terminus16

Network configurations

Create /etc/hostname and type any name you wish as your hostname:

scooby

Edit /etc/hosts like this:

127.0.0.1 localhost
::1 localhost
127.0.1.1 (your host name here!)

Initramfs

$ mkinitcpio -P

Root password

Set a new password for root:

$ passwd

Bootloader

UEFI

Install grub and efibootmgr:

$ pacman -S grub efibootmgr

Run the following command:

$ grub-install --efi-directory=/boot --bootloader-id=GRUB

Then create a GRUB config file:

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

Install grub:

$ pacman -S grub

Check using fdisk -l to see the name of the disk (not partition!) and run the following command:

$ grub-install /dev/sdX

/dev/sdX could for example stand for /dev/sda (not /dev/sda1!)

Then create a GRUB config file:

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

Final step

Exit out of the chroot environment by typing exit or pressing Ctrl+d.

Unmount all the partitions:

$ umount -R /mnt

Then type poweroff and remove the installation disk from the virtual machine.

System-related Configurations

Enable network connection

To use pacman you first have to have a working internet connection by enabling NetworkManager:

$ systemctl start NetworkManager
$ systemctl enable NetworkManager

Check if you receive data from the Google Server by running this command:

$ ping 8.8.8.8

Update the system

First things first: Update the system!

$ pacman -Syu

sudo Command

$ pacman -S sudo

Add your personal user account

$ useradd -m -g users -G wheel,storage,power,video,audio <your username>
$ passwd <your username>

Grant root access to our user

$ EDITOR=nvim visudo

Uncomment the following line:

%wheel ALL=(ALL) NOPASSWD: ALL

You can then login as your newly created user:

$ su <your username>

If you wish to have the default XDG directories (like Downloads, Pictures, Documents etc.) do:

$ sudo pacman -S xdg-user-dirs
$ xdg-user-dirs-update

Install AUR package manager

To install yay:

$ sudo pacman -S git
$ mkdir aur
$ cd aur
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published