This page is derived from my personal notes from setting up Arch Linux with Xfce on a laptop computer, in this case a Toshiba Tecra M6. It's a modernist, non-partisan, GUI-oriented setup that I originally worked out for someone who really isn't all that into computers.
This document is not a how-to or a tutorial, but if you are setting up Linux on a not-too-old laptop, you might find it useful. If you are using this as a "cheat sheet", you will of course need to adapt it to your system.
[Feb 11/2022] Updated! A lot has changed since 2018. For example, wifi-menu isn't used anymore, linux-base package no longer has a text editor included. Basically the 2018 instructions no longer worked at all and someone let me know about it. So, I've updated everything and it should work now. The 17 year old Toshiba laptop is still going strong.
Comments to haneda660@gmail.com
The first thing to do after booting the thumb drive is set up networking.
(Wireless) During the install, I'm using iwctl
to set up wireless networking.
# iw dev
or
# ip link
For this computer, it's wlan0
.
Follow the instructions for iwctl
to get connected to the wireless network, here: Arch page for iwctl.
(Wired) If wired ethernet is available, it should work with out doing anything.
Check the connection, eg.
# ping tedsims.com
¶Note: The particular computer we are setting this up on, already has 2 partitions of equal size, /dev/sda1 and /dev/sda2. I'm installing on /dev/sda2 and there's another Arch install (one definitely not for civilians) on /dev/sda1.
The laptop has BIOS, doesn't have a EFI system partition. Typically any computer made in the last 10 years uses UEFI and not BIOS. I'm sorry I don't cover UEFI booting here.
.
Setting up partitions is not covered here. I use parted
and there is plenty of documentation online.
Prepare a partition for installation. In this case, it's /dev/sda2. We're going to make an ext4 file system on it and get started:
# mkfs.ext4 /dev/sda2
# mount /dev/sda2 /mnt
# pacstrap /mnt base base-devel linux linux-firmware nano
¶
Create fstab. We'll edit it later to add the swapfile information:
# genfstab -U /mnt >> /mnt/etc/fstab
# arch-chroot /mnt
¶
Set the root password:
# passwd
¶
Set time zone:
# ln -sf /usr/share/zoneinfo/America/Kentucky/Louisville /etc/localtime
# hwclock --systohc
¶
Uncomment 'en_US.UTF-8'
in /etc/locale.gen
:
# nano /etc/locale.gen
Generate locales:
# locale-gen
Tell the system which locale to use (though we only made one):
# echo LANG=en_US.UTF-8 > /etc/locale.conf
¶
This computer is named after the cat:
# echo kittypet > /etc/hostname
Create or open /etc/hosts -
# nano /etc/hosts
and add the following:
127.0.0.1 localhost
::1 localhost
127.0.1.1 kittypet.localdomain kittypet
We need to set up swap to have hibernate working. Hibernate is a really, really useful thing to have working on a laptop.
Make a swapfile the same size as RAM, in this case, 4GB:
# fallocate -l 4G /swapfile
# chmod 600 /swapfile
# mkswap /swapfile
# swapon /swapfile
¶
Append the swap information to the end of /etc/fstab:
# echo /swapfile none swap defaults 0 0 >> /etc/fstab
¶
We don't really need swap, except that we are going to use it for hibernate, so let's make sure it stays out of the way:
# echo vm.swappiness=10 > /etc/sysctl.d/99-sysctl.conf
¶
Edit mkinitcpio.conf to add a hook for resume:
# nano /etc/mkinitcpio.conf
Add resume
somewhere after udev
but before fsck
like this:
HOOKS="base udev autodetect modconf block filesystems keyboard resume fsck"
Regenerate the initramfs:
# mkinitcpio -p linux
¶
Take a look at /etc/fstab and write down the uuid of root device.
Then find the first large number reported by
# filefrag -v /swapfile
under "physical offset" and write that down too. This is the offset number to be used for resume.
Need grub, os-prober and some other packages we will use later:
# pacman -Sv grub os-prober polkit dialog wpa_supplicant iwd dhcpcd openssh
¶
Now we are going to edit the grub config file so it knows where to resume from:
# nano /etc/default/grub
Replace
GRUB_CMDLINE_LINUX_DEFAULT = "quiet"
with
GRUB_CMDLINE_LINUX_DEFAULT = "resume=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx resume_offset=xxxxxx"
using the uuid and offset numbers written down earlier.
Uncomment GRUB_DISABLE_OS_PROBER=false
¶Mount the partition with the other system so that os-prober
can find it:
# mount /dev/sda1 /mnt
¶
Generate the grub.cfg
file and install grub
to MBR (note if this is the first time running grub-mkconfig, you need to create the directory /boot/grub)
:
# grub-mkconfig -o /boot/grub/grub.cfg
# grub-install /dev/sda
Shutdown (exit out of chroot first), remove the thumb drive, boot and log in to the new system. Check hibernate with:
# systemctl hibernate
¶
Add a non-privileged user:
# useradd --create-home ted
# passwd ted
# usermod -aG power,users,storage,wheel ted
Note: If you don't want a user to be able to make system changes, don't add them to group wheel, because we are going to enable sudo for group wheel. However, you need to add at least one user to group wheel, to complete installation.
¶Set up sudo
for users in wheel group:
EDITOR=nano visudo
Uncomment out
%wheel ALL=(ALL) ALL
Now enable networking services so networking starts right up after booting. We only need to do this until we get Network Manager going in a GUI environment:
# systemctl enable dhcpcd iwd
¶
Reboot and log back in as the non-privileged user. Log in to the wireless again if you need to.
Under user directory, create Documents, Music, Pictures directories
$ mkdir Documents Music Pictures Video temp
Install pamac to use as a GUI package manager, and for installing packages from AUR (Note this installs a lot of other things as dependencies of pamac, so if you decide not to install pamac, you could possibly have to install some of these explicitly at some point.):
$ sudo pacman -Sv git
$ cd ~/temp
$ git clone https://aur.archlinux.org/libpamac-aur.git
$ cd libpamac-aur
$ makepkg -si
$ cd ~/temp
$ git clone https://aur.archlinux.org/pamac-aur.git
$ cd pamac-aur
$ makepkg -si
Note: yay
is very good if you don't like pamac
, but you should like pamac
.
Before installing Xorg, make sure alsa is working:
$ sudo pacman -Syu alsa-utils
$ alsamixer
(Use 'm' to unmute pcm, master, etc and turn the volumes up)
$ speaker-test -c2
We'll try X by itself before setting up xfce. This laptop has integrated Intel video, so it's pretty easy. We're also going to install some things we need later:
$ sudo pacman -Syu xorg xf86-video-intel mesa xorg-twm xorg-xclock xterm xorg-xinit
$ startx
Xorg should start right up. If it doesn't, go figure out what went wrong. If it's working, ctrl-D out of all the windows.
$ sudo pacman -Syu xfce4 xfce4-goodies gvfs catfish ttf-dejavu ttf-liberation ttf-droid gspell
Make a simple .xinitrc in the user's home directory and make it executable:
$ cd
$ echo exec startxfce4 >> .xinitrc
$ chmod +x .xinitrc
Start up xfce:
$ startx
Spend some time admiring what a virgin xfce install looks like.
Open the Power Manager under settings, and turn on "Status Notifications"
$ sudo pacman -Syu lightdm-slick-greeter
$ sudo nano /etc/lightdm/lightdm.conf
Under [seat:*]
change greeter-session
to read as follows:greeter-session=lightdm-slick-greeter
Make sure the line is uncommented. Save and close.
Enable lightdm service
$ sudo systemctl enable lightdm.service
Reboot, and lightdm should come up. There will be an icon for pamac-manager in the notification bar. Click on it to start pamac-manager. Open preferences and enable AUR support.
¶$ sudo pacman -Syu network-manager-applet
$ sudo systemctl enable NetworkManager.service
Turn off some things we don't need anymore:
$ sudo systemctl disable dhcpcd iwd
Then reboot the computer. When you come back in, the Network Manager should be active on the task bar. Make sure it's working properly.
This is probably a good point to install a browser. I suggest Firefox:
$ sudo pacman -Syu firefox
If you want Google Chrome, you have to install it from AUR. It takes a while to build.
# pamac build google-chrome
Install Bluetooth packages along with pulseaudio. Install the following packages:
bluez
bluez-utils
pulseaudio
pulseaudio-alsa
pulseaudio-bluetooth
pulseaudio-zeroconf
libcanberra-pulse
pavucontrol
blueman
¶
Create the file
/etc/polkit-1/rules.d/51-blueman.rules
using the instructions on the Arch web site under Permissions.
Bluetooth service will usually need to be restarted after coming out of hibernate or suspend. This script will make that happen automatically (thanks, Dennis Field). Be sure to make the script executable.
/lib/systemd/system-sleep/00bluetooth
#!/bin/sh
if [ $1 = post ]
then
systemctl restart bluetooth
echo "Hello, I'm resuming from $2"
fi
Enable the bluetooth service:
$ sudo systemctl enable bluetooth.service
Reboot and make sure Bluetooth is working, for example, by pairing with a Bluetooth speaker. Bluetooth and expecially Blueman has a deserved reputation for being flaky. You might have to play with it. If you are having trouble, a good place to start is by seeing if it works using the command line utility bluetoothctl
.
Install the following packages:
Note: This is a "well-tinkered" setup for printing. Among other things, it can find networked printers and set them up as automagically as possible.
cups
cups-pdf
bluez-cups
cups-pk-helper
gutenprint
hplip
sane
python-pyqt5
splix
system-config-printer
Enable cupsd:
$ sudo systemctl enable cups.service
$ sudo systemctl start cups.service
Open Print Settings under Applications --> Settings and add your printers.
Install the following useful applications (office, mail, etc.):
libreoffice
audacious
audacity
vlc
atom
emacs
vim
gimp
gthumb
unzip
noto-fonts-cjk
ttf-ms-fonts [from AUR]
ttf-ms-win10-auto [from AUR]
etcher-bin [from AUR]
Recently, I'm using webmail. If you want to install a mail client a good lightweight one is claws. I also have used sylpheed a lot but I don't think it's maintained anymore. I've heard thunderbird is easier to set up but I haven't used it. You're on your own. There is a possibly useful, but surely outdated guide to setting up sylpheed on my home page.
$ pamac build fingerprint-gui
Add the following line to /etc/pam.d/lightdm
auth sufficient pam_fingerprint-gui.so
For each user that going to be using the fingerprint reader,
$sudo gpasswd -a user plugdev
Reboot. Open the "Fingerprint GUI" setup application in the settings menu, following the instructions. Note, we have it set up for lightdm only, not sudo.
$ sudo pacman -S nss-mdns
$ sudo nano /etc/nsswitch.conf
Add mdns_minimal
after hosts: files in /etc/nsswitch.conf
$ sudo systemctl enable avahi-daemon
Follow the instructions on the Arch wiki page on systemd-timesyncd.
sudo pacman -Syu fcitx5-im fcitx5-mozc
Log out and log back in. Follow the Instructions for fcitx5 on the Arch site