Flaxplax

Personal documentation

Arch Installation

This is a guide on how to install Arch linux.

You can find all the information you need to install in the Wiki here.

You will need the latest ISO. You can find it here.

I’m doing this in a virtual machine in virtualbox. It has 15G of space 2G of ram and 2 cpu cores.

When you boot up Arch you will get a Terminal and all you see is:

  root@arhciso~#

The first you should do is change the keyboard layout.

  loadkeys sv-latin1

“sv-latin1” is for a Swedish layout. You have to find your layout

Later you should try ping “8.8.8.8” to see if you have a Internet connection. Do that by typing “ping 8.8.8.8”

  ping 8.8.8.8
  PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
  64 bytes from 8.8.8.8: icmp_seq=1 ttl=63 time=17.6 ms
  64 bytes from 8.8.8.8: icmp_seq=2 ttl=63 time=17.5 ms
  64 bytes from 8.8.8.8: icmp_seq=3 ttl=63 time=17.6 ms
  64 bytes from 8.8.8.8: icmp_seq=4 ttl=63 time=17.8 ms

If your output looks like this, you have internet.

You can stop the ping by pressing “Ctrl+c”

After the ping you need to update the system clock:

  timedate set-ntp true

Run “lsblk” to see Your disk/disks.

  lsblk
  loop0 7:0 0 529.7M  1 loop0/run/archiso/sfs/airootfs
  sda   8:0 0    15G  0 disk

Here we can see that the disk is named “sda” and has 15G of space

The wiki recomends that you use fdisk but we’re going to use cfdisk

  cfdisk

Chose “dos” as label type

cfdisk

press enter om “New”

cfdisk

Make the partittion size 13G and press eneter

cfdisk

Chose as “primary”

cfdisk

Go to “Free space” and press enter.

cfdisk

Make the second partition the last 2G of space

cfdisk

Chose this as “Primary”

cfdisk

Chose /dev/sda2 and go to “Type”

cfdisk

Select “82 Linux Swap”

cfdisk

Go to “Write” press enter end type “yes” for it to make changes and then “Quit”

cfdisk

If you type “lsblk” again you can see your 2 partitions you have just made.

  lsblk
  loop0 7:0 0 529.7M  1 loop0/run/archiso/sfs/airootfs
  sda   8:0 0    15G  0 disk
  |-sda1
  |-sda2

after this you have to format your first partition and make the second one a swap drive.

  mkfs.ext4 /dev/sda1
  mkswap    /dev/sda2
  swapon    /dev/sda2

Then you’re going to mount the first partition.

  mount /dev/sda1 /mnt

Now you’re going to install Arch base package.

  pacstrap /mnt base linux linux-firmware

After the installation you will generate an fstab.

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

change root into the new system

  arch-chroot /mnt

now you are setting the correct time zone

  ln -sf /usr/share/zoneinfo/Region/City /etc/localtime

run hwclock to gen adjtime

  hwclock --systohc

run locale-gen

  locale-gen

now you will install an editor

  pacman -S vim

Press Y and then enter to install.

Use vim to create and edit the locale.conf.

Press " i " to insert text and escape to stop.

  vim /etc/locale.conf
  LANG=en_US.UTF-8
  :wq!

" :wq! " is what you use to save and exit the editor.

Use vim to edit your keyboard layout.

  vim /etc/vconsole.conf
  KEYMAP=sv-latin1

Create and edit an hostname file. I’m naming the machine “vm”

  vim /etc/hostname
  vm

Now you are adding entries to your host file.

  vim /etc/hosts
  127.0.0.1	localhost
  ::1	    	localhost
  127.0.1.1	vm.localdomain	vm

Next you have to set your root password.

  passwd

We are going to install and use grub as our bootloader.

  pacman -S grub
  grub-install --target=i386-pc /dev/sda
  grub-mkconfig -o /boot/grub/grub.cfg

Install dhcpcd as our dhcp client and reboot the machine.

  pacman -S dhcpcd
  systemctl enable dhcpcd
  exit
  reboot

Now you will see a login screen and the installation is complete.

login

Last updated on 9 Jul 2020
Published on 9 Jul 2020