Skip to content

Instantly share code, notes, and snippets.

@bertabus-zz
Forked from alphazo/archlinux-install-guide.md
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save bertabus-zz/b321ce660da1366481c5 to your computer and use it in GitHub Desktop.

Select an option

Save bertabus-zz/b321ce660da1366481c5 to your computer and use it in GitHub Desktop.

ArchLinux Installation guide

This will use GPT partitions and GRUB2 on a BIOS enabled PC (see Wiki for EFI). The Installation Guide can be found at /root/install.txt.

Prepare USB stick

Get 2012.08.04 image or later from http://www.archlinux.org/download. Following tutorial requires at least 2011.07.15 image.

dd if=/dev/zero of=/dev/sdx  bs=1k count=1
dd if=archlinux-2012.08.04-dual.iso of=/dev/sdx

Replace sdx by your thumbdrive reference.

Install from USB

Boot & select x86_64 (or i686 if you want to stay with i686 architecture, max. 3GB SRAM)

Change keyboard layout

loadkeys fr

Get IP address

2012.08.04 image automatically starts the network and get an IP address via DHCP so the following step is not required.

Assuming you are on ethernet with a DHCP server.

dhcpcd

Manually partition hard drives

gdisk /dev/sda

Remove old partitions then create the following partitions:

  • 2MB, type EF02 (BIOS partition). This is used by GRUB2/BIOS-GPT.
  • 100MB, type 0800 (Linux). This will store /boot (/dev/sda2)
  • 4GB, type XXX (swap). This is our swap partition. (/dev/sda3)
  • Remaining space, type 0800 (Linux). Store both / and /home. (/dev/sda4). You can have a separate /home if you prefer.

Configure block devices, filesystems, and mountpoints

Format /boot and /root

mkfs.ext2 /dev/sda2 mkfs.ext4 /dev/sda4

Format and activate the swap partition

mkswap /dev/sda3 && swapon /dev/sda3

Mount the partitions

mount /dev/sda4 /mnt mkdir /mnt/boot mount /dev/sda2 /mnt/boot

Select installation mirror

ftp.archlinux.org is throttled to 50KB/s.

Before installing, you may want to edit /etc/pacman.d/mirrorlist such that your preferred mirror is first. This copy of the mirrorlist will be installed on your new system by pacstrap as well, so it's worth getting it right.

Install the base system

pacstrap /mnt base base-devel

Install a bootloader

Folllowing will install GRUB2. If you want EFI please refer to Wiki. pacstrap /mnt grub-bios

Generate fstab

Generate an fstab with the following command (if you prefer to use UUIDs or labels, add the -U or -L option, respectively): genfstab -p /mnt >> /mnt/etc/fstab

Edit and correct /mnt/etc/fstab so it shows the right disk ID for the swap partition (it was wrongly empty on mine).

Chroot into our newly installed system

arch-chroot /mnt

Configure system

Root password

Set a root password with: passwd

Hostname

Add your hostname in /etc/hostname.

<file - /etc/hostname> myhostname

Set it to your liking. This is the name of your computer.

Add also your hostname in /etc/hosts, coinciding with the one specified in /etc/hostname as an alias, so that it looks like this:

<file - /etc/hosts> 127.0.0.1 localhost.localdomain localhost myhostname ::1 localhost.localdomain localhost myhostname

Note: ::1 is the IPv6 equivalent of 127.0.0.1

Console fonts and keymap

Set keymap and font name in /etc/vconsole.conf.

# /etc/vconsole.conf
KEYMAP=dvorak

Timezone

Edit the file /etc/timezone and write your Zone/Subzone. Available time zones and subzones can be found in the /usr/share/zoneinfo// directories. Example: <file - /etc/timezone> Europe/Paris

Additionaly, create a symbolic link /etc/localtime to the same /usr/share/zoneinfo// using this command:

ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime

Locale

Enable locales

Edit /etc/locale.gen and uncomment:

<file - /etc/locale.gen> en_US.UTF-8 UTF-8 fr_FR.UTF-8 UTF-8 fr_FR ISO-8859-15 fr_FR@euro ISO-8859-15

Generate locales
locale-gen
Setting up system-wide locale

Add your language to /etc/locale.conf. <file - /etc/locale.conf> LANG=fr_FR.UTF-8

Keep the default sort order (e.g. files starting with a '.'

should appear at the start of a dir

LC_COLLATE="C"

Export current language for initramfs creation

We will be adding keymap to mkinicpio.conf therefore we need to environment variable LANG.

export LANG=fr_FR.UTF-8

Hardware clock time

When using UTC launch the following command:

hwclock --systohc --utc

Configure the network

If not using DHCP or network manager, please see wiki for rc.conf configuration.

Prepare initramfs build

Add keymap to kernel for non-US keyboard on boot.

Edit /etc/mkinitcpio.conf and insert "keymap" after "sata" (no quote required).

Create an initial ramdisk environment

mkinitcpio -p linux

Configure the bootloader

Install GRUB2 to hard-drive
grub-install /dev/sda

To prevent a (harmless) error message at boot time execute:

cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
Generate GRUB2 configuration
grub-mkconfig -o /boot/grub/grub.cfg

Unmount the partitions

If you are still in the chroot environment then type exit or Ctrl+D in order to exit chroot. Since the partitions are mounted under /mnt, we use the following command to unmount them.

umount /mnt/boot umount /mnt

Reboot

Execute the following command and remove the installation media. reboot

Daemons

Can stay in rc.conf Alternatively, you may remove the /etc/rc.conf file entirely and enable services in systemd (see wiki).

Kernel modules

Tip: Normally all needed modules are automatically loaded by udev, so you will rarely need to add something here. Only add modules that you know are missing.

Edit /etc/modules-load.d/ to configure kernel modules to load during boot in a static list. Each configuration file is named in the style of /etc/modules-load.d/.conf. The configuration files should simply contain a list of kernel module names to load, separated by newlines. Empty lines and lines whose first non-whitespace character is # or ; are ignored. Example:

<file - /etc/modules-load.d/virtio-net.conf>

Load virtio-net.ko at boot

virtio-net

Networking

To get the network working I first ran dhcpcd (may need to specifiy device found from ip link so dhcpd enp1s0) to manually enable networking. Make it permanent with:

systemctl enable dhcpcd@enp1s0.service
systemctl start dhcpcd@enp1s0.service

Add Default user with permissions

useradd -m -G wheel -s /bin/bash archie
visudo
# add the following to the file replacing bertabus with your username
bertabus ALL=(ALL) ALL

better shell

Install zsh and set shell, install goodies as well

chsh -s /bin/zsh
#relogin or open new terminal
#follow my dotfiles readme, essentially
mkdir ~/.config
mkdir ~/.cache
cd ~/.config
git clone https://github.com/bertabus/dotfiles .
ln -s ~/.config/zsh/.zshenv ~/.zshenv
# do I really put oh-my-zsh in my .config, .gitignore doesn't seem to show any exclusion
# not sure how I have been getting away with a submodule without declaring it there?
git clone https://github.com/robbyrussel/oh-my-zsh ~/.config/oh-my-zsh/
# install vundle plugins
vim +BundleInstall
# install libclang (for arch) and compile youcompleteme
sudo pacman -Sy clang cmake
cd ~/.config/vim/bundle/YouCompleteMe
./install.sh --clang-completer --system-libclang

profit

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