How to Install ArchLinux With SLiM and Cinnamon in 30 Minutes

Recently I decided to get rid of every previous distro on my laptop and install a clean and built from scratch “ArchLinux” setup on my IBM Thinkpad T520. Note that it can take some time to get it all done but remember that it will be wicked ;–)

Documentation

I googled a lot for good sources on documentation and tutorials, I’ve got a lot of information from the Muktware tutorial and the ArchLinux wiki/forum is really wicked. Never seen such a good documentated place about a distro as for ArchLinux, it’s even a shame to ask things after reading it.

Download ArchLinx

You can download the latest image of Arch from here: https://www.archlinux.org/download/. You can just burn the .ISO or install it on USB with the following command:

1
sudo dd if=/path_to_arch_.iso of=/dev/sd(?)

Once the USB is ready, plug it into your computer and boot into ArchLinux.

Arch Installation

It is highly recommendable to use an ethernet connection for the installation as your PC might need drivers for the wirelss chip and it will only complicate things. To keep it simple plug the ethernet cable in and check if you have the internet connectivity.

Run this command:

1
# ping -c 3 www.google.com

Preparing hard drive

We need to prepare the hard drive now for the installation. Note that when you’re not familiair with formatting, (re)creating partitions and so on that you use an alternative distro like LinuxMint, ArchBang or something else to make the desirable layout.

As for this tutorial I already created 3 partitions with my previous distro (LinuxMint) and now will clean all the partitions to recreate and format so I have a clean install. First run this command:

1
# cfdisk /dev/sda

(guessing that your hard drive is sda)

You will see this:

Name    Flags      Part Type   FS Type          [Label]       Size (MB)
-----------------------------------------------------------------------
sda1    Boot       Primary     Linux                          15360
sda2               Primary     Linux                          3000
sda3               Primary     Linux                          133000*

sda1 is the primary drive where the installation will be done
sda2 is the swap drive (normally about 25% of your amount of memory in GB)
sda3 is the primary drive where we will install /home/user and your data

Now let’s continue:

  • Choose the partition you want to format and select ‘Delete’ (for example sda1);
  • Choose the free space and then select “new” and hit enter;
  • Choose ‘Primary’;
  • Size;
  • Beginning;
  • Flag/choose ‘bootable’;
  • Write (it will ask you whether you want to save the changes and you can type ‘yes’)
  • Quit

Now select the partition which you want to use as swap:

  • Choose the partition you want to format and select ‘Delete’ (for example sda1);
  • Choose the free space and then select “new” and hit enter;
  • Choose ‘Primary’;
  • Size;
  • Beginning;
  • Write (it will ask you whether you want to save the changes and you can type ‘yes’)
  • Quit

It’s time to (re)create the home partition (THIS WILL ERASE ALL THE DATA)

  • Choose the partition you want to format and select ‘Delete’ (for example sda1);
  • Choose the free space and then select “new” and hit enter;
  • Choose ‘Primary’;
  • Size;
  • Beginning;
  • Write (it will ask you whether you want to save the changes and you can type ‘yes’)
  • Quit

Now it’s time to format the 2 primary partitions and convert to the ext4 file system. Run the following command as root:

1
2
# mkfs.ext4 /dev/sda1
# mkfs.ext4 /dev/sda3

Format swap:

1
2
# mkswap /dev/sda2
# swapon /dev/sda2

Wow, that easy? Yes, be sure to check whether you did your job well. Run this command:

1
# lsblk /dev/sda

Installing base system

The time has come to install ArchLinux. First we need to create a home partition and then mount the home and root partitions.

Create the home directory:

1
# mkdir /mnt/home

Mount home and root with the following command:

1
2
# mount /dev/sda1 /mnt
# mount /dev/sda3 /mnt/home

We are about to install base and devel packages (which you will need when compiling applications). You might consider changing the mirror to the closest one to your location through this howto: https://wiki.archlinux.org/index.php/Beginners%27_Guide#Select_a_mirror.

When ready run this command:

1
# pacstrap -i /mnt base base-devel

Once all the packages are installed you need to configure fstab. Do it with the following command (note: you can only run this once, even when you experience trouble – if so you need to edit manually). Run:

1
# genfstab -U -p /mnt >> /mnt/etc/fstab

Check if fstab entry is correct (otherwise your system won’t boot).

1
# nano /mnt/etc/fstab

This command will show you the root partition mounted:

It’s time configure your system. Chroot into your newly installed system

1
# arch-chroot /mnt

Language and location settings

Now it’s time to configure the language of the system. Since I am using English I’m choosing “en_US.UTF-8”. You can choose whatever language you want to use, there’s a large list of languages available through the next command:

1
# nano /etc/locale.gen

Uncomment your language:

en_US.UTF-8 UTF-8

Don’t you know how to save the file bytheway after opening with nano? Just click CTRL+X and type “y” and enter.

Set the locale:

1
2
3
# locale-gen
# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8

We can continue to configure the time zone for system. For example in my case the zone is “Europe” and sub-zone is Amsterdam.

To find your zone and sub-zone you can run this command:

1
# ls /usr/share/zoneinfo/

You can configure the zone

1
# ln -s /usr/share/zoneinfo/<Zone>/<SubZone> /etc/localtime

Example:

1
# ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime

Let’s configure the hardware clock. It is recommended to use UTC instead of localtime:

1
# hwclock --systohc --utc

Configure repositories

Language and time zone now arew set, get ready to configure repositories. Open the pacman.conf file:

1
# nano /etc/pacman.conf

If you are using an 64-bit system you should go ahead and uncomment (enable) the “multilib” repository:

[multilib]
Include = /etc/pacman.d/mirrorlist

Remember: hit CTRL+X and then type “y” and enter.

Now it’s time to update the repositories by running the following command:

1
# pacman -Sy

Create users and password

We first need to give a root password so we can perform administrative tasks and we will also create a user for the system (as it is not a good idea to run your system as root).

First set root password:

1
# passwd

Create a user for the system and also add some groups to it (useraccount = your name):

1
# useradd -m -g users -G wheel,storage,power,network,audio -s /bin/bash useraccount

Enter a password for this new user (again useraccount = your name):

1
# passwd useraccount

Install sudo:

1
2
# pacman -S sudo
# pacman -Ss sudo

Once it’s done we will now allow the users in wheel group to be able to perform administrative tasks with sudo. Run the following command to edit the sudoers:

1
# EDITOR=nano visudo

The sudoers-file will open now and you’ll have to uncomment this line:

%wheel ALL=(ALL) ALL

The following command will install bash-completion, so run it:

1
pacman -S bash-completion

Install boot loader

We continue the installation of grub and configure the boot loader. Not that I have a BIOS system, if you have an UEFI system it is recommendable to check out the ArchLinux wiki with this URL: https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface

First install grub for bios and configure it. Run these commands:

1
2
3
# pacman -S grub-bios
# grub-install --target=i386-pc --recheck /dev/sda
# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo

Some people run multiple operating systems, I don’t (ArchLinux is the host/base and I run VirtualBox for other guest/instances). Nonetheless it’s always good to install proper, even if you don’t have more operating systems running:

1
# pacman -S os-prober

Once it is installed you ’ll have to update grub so ArchLinux knows about the other operating system:

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

Wow, guess what? We’re now done with the (base) installation (and configuration) of ArchLinux. There are plenty things to configure later (display, touchpad, desktop environment). First exit from the chroot environment:

1
# exit

Unmount root, home and reboot the system:

1
2
3
# umount /mnt/home
# umount /mnt
# reboot

First booting

Boot into your new system with the user you’ve created (useraccount). Since you are not logged in as root you will need to sudo in order to perform administrative tasks:

1
# sudo

Network

Since ArchLinux has switched to systemd the name of the network will change after reboot. Now enter the following to find the name:

1
# ip link

In my case:

enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000 link/ether ff:dd:ff:be:1b:96 brd ff:ff:ff:ff:ff:ff

Enable/start the network:

1
2
# sudo systemctl enable [email protected]<interface>.service
# sudo systemctl start [email protected]<interface>.service

As an example:

1
2
# sudo systemctl enable [email protected]
# sudo systemctl start [email protected]

Check if the network is working run:

1
# ping -c 3 www.google.com

Basic needings

Now comes the part where we are going to install x server, touchpad and video drivers:

1
# sudo pacman -S xorg-server xorg-xinit xorg-server-utils

We will install mesa for 3D support:

1
# pacman -S mesa

Continue install the video drivers. I assume you know which GPU you are using, you have to run:

1
# lspci | grep VGA

The wiki again did a great job on describing what driver you need to install here: https://wiki.archlinux.org/index.php/Beginners%27_Guide#Install_a_video_driver

IBM Thinkpad T520 has an Intel graphics GPU, I had to run:

1
# sudo pacman -S xf86-video-intel

If you have a laptop you also need to install the touchpad drivers:

1
# sudo pacman -S xf86-input-synaptics

Install the default environment before we move to install the prefered desktop environment later:

1
# pacman -S xorg-twm xorg-xclock xterm

Test X for the first time:

1
# startx

SLiM

First of all I deciced to install SLiM because I was curious about it, read a lot of good things (and yes it was a good choice). You can use any display manager of your choice (feel free).

Install SLiM:

1
# sudo pacman -S slim slim-themes archlinux-themes-slim

Now enable the SLiM daemon:

1
# sudo systemctl enable slim.service

SLiM needs to be configured now so we will continue to do so. Edit the config file:

1
# sudo nano /etc/slim.conf

Uncomment the following 2 lines and enter the username you’ve created (don’t enter root!):

# default_user        useraccount
# auto_login          no

Don’t close the file because we need to configure the theme. For now I’m a big fan of the ArchLinux theme for SLiM so let’s configure it by entering this line into the config file:

current_theme       archlinux

If you need some more information check the Wiki: https://wiki.archlinux.org/index.php/SLiM

Cinnamon

Last but not least we will now install the desired desktop environment, for me Cinnamon is the most LinuxMint-like desktop (and to be honest I like it together with OpenBox). OpenBox however is kind of more work to achieve it like you want.

Install the needed packages now:

1
# sudo pacman -S cinnamon cinnamon-control-center cinnamon-screensaver nemo

Once this is ready I suppose you have no .xinitrc. but we now create one:

1
# cp /etc/skel/.xinitrc ~

Make it executable:

1
chmod +x ~/.xinitrc

Add a line with exec command to .xinitrc:

1
# sudo nano ~/.xinitrc
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec cinnamon-session

Test the environment by running:

1
# startx

Network

Make sure to install the networkmanagement. Check it here: https://wiki.archlinux.org/index.php/NetworkManager

Audio

Same goes for the audio, also that needs to be configured (alsa), open it from the wiki and read it: https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture

Finished

30 minutes right?

Enjoy your desktop:

Packages

Here some useful commands for using packages:

  • Update the repositories:
1
# sudo pacman -Sy
  • Update system
1
# sudo pacman -Syu
  • Remove any package
1
# sudo pacman -Rns

Update packages from AUR

1
# sudo packer -Syu

Comments