My notes: Debian 9 installation & common fixes
Recently I decided to start using a GNU/Linux distribution as the main OS on my desktop instead of Windows 10 (why?).
I’ve tried various distributions, installation methods and window managers and finally found a setup that worked for me. In this post I’ll share my notes with you, so you can hopefully save some time and frustration.
By following the steps below, I’m able to set up a clean, error-free GNU/Linux environment in about 20-30 minutes.
Preparation
The plan
Distribution to install: Debian 9. (why?)
Window Manager to install: Xfce - because it’s light and works out of the box (unlike Gnome 3 in my case)
Before you start:
- Have a backup plan. Create backups of your important files.
- Unplug any harddisks you don’t want to mess with.
- Get yourself a separate harddisk if you want to use full disk encryption. After installing on a 250GB SSD, I have a /home folder of about 190GB by using the default Debian partitioning scheme.
Prepare a bootable USB drive
Download the Debian 9.2.1 AMD64 small USB image from https://www.debian.org/distrib/netinst#smallcd.
View my separate post on How to create a bootable USB drive from an ISO image on Mac OS X.
Installation details
Boot from the USB stick you’ve created. This will get you into the installation. Installation summary for Debian on a separate disk:
- Graphical install
- English - English
- Select your region
- locale: United States - en_US.UTF-8
- Keyboard: American English
- Pick your hostname and/or domain name
- Set root password
- Set user name + password
- Force UEFI installation: no
- Guided - use entire disk and set up encrypted LVM
- Separate /home, /var and /tmp partitions
- Write changes to disk and configure LVM?: yes
- Statistics: up to you
- Checked: Debian desktop environment, Xfce, print server & standard system utilities
- Install GRUB bootloader: yes
On the first login
Xfce will ask you how to set it up: Use default config
Open a terminal and add the user to the sudo group with log access:
su
apt install sudo
usermod -aG sudo <username>
usermod -aG adm <username>
reboot
sudo = for sudo (executing commands as the Superuser)
adm = for accessing logs
Check your installation for errors
Now comes the interesting part. There’s no “standard” way to check if everything is working correctly. You will have to check the system logs for this. One way to get started is journalctl.
journalctl | grep failed
or install the Logs application:
sudo apt install gnome-logs
After this, it’s a matter of fixing the issues that arise. A good start is fixing the issues under the “Important” section in the Logs application.
Fix the errors
Searching the Internet by the error messages will get you close to your solutions. Below you will find the issues I had to fix.
Install NVIDIA driver
Message:
kernel: nouveau 0000:01:00.0: Direct firmware load for nvidia/gm204/gr/sw_nonctx.bin failed with error -2
Nouveau is the Open Source driver for NVIDIA graphics cards. Unfortunately this didn’t work for me and I had to install the proprietary version.
The fix (source):
Add “contrib” and “non-free” components to /etc/apt/sources.list
sudo nano /etc/apt/sources.list
# Change to:
deb http://httpredir.debian.org/debian/ stretch main contrib non-free
deb-src http://httpredir.debian.org/debian/ stretch main contrib non-free
Then run:
sudo apt update
sudo apt install linux-headers-$(uname -r|sed 's/[^-]*-[^-]*-//') nvidia-driver
sudo reboot
You will get a message from Nouveau regarding conflicting drivers. This is normal. Just reboot after the installation.
Realtek 8168G driver issue
Message:
Direct firmware load for rtl_nic/rtl8168g-2.fw failed with error -2
The fix:
sudo apt install firmware-realtek
sudo reboot
Avahi-daemon issue
Message:
avahi-daemon[581]: chroot.c: open() failed: No such file or directory
The fix (source):
sudo nano /lib/systemd/system/avahi-daemon.service
Add at the end of the [Unit] block:
After=network-online.target
GRUB resolution fix
Message:
Nothing explicit. You will see abnormally large text during the startup.
The fix:
Some customisations to make the startup a bit more readable for my resolution (1680x1050):
sudo nano /etc/default/grub
# Modify:
GRUB_CMDLINE_LINUX="nomodeset"
#Modify & set to your resolution:
GRUB_GFXMODE=1680x1050
#Add after GRUB_GFXMODE:
GRUB_GFXPAYLOAD_LINUX=keep
sudo update-grub
Dual boot with Windows 10
Message:
None, but your Windows installation will not appear in the list of operating systems during startup.
The fix (source):
sudo nano /etc/default/grub
# Add at the end:
GRUB_DISABLE_OS_PROBER=true
sudo update-grub
Then determine the UUID of your Windows installation disk:
# List the drives
lsblk -f
# You're looking for the NTFS System Reserved partition
# If your Windows system partition is /dev/sda1
blkid /dev/sda1
Copy the UUID of the Windows system partition.
Then add the menu option manually:
sudo nano /etc/grub.d/40_custom
# Add this with your UUID:
menuentry "Windows 10" --class windows --class os {
insmod ntfs
search --no-floppy --set=root --fs-uuid [your-uuid-here]
ntldr /bootmgr
}
# After saving, run:
sudo update-grub
What’s next?
Update: As a follow-up to this post, I’ve written a post about Customise the Xfce user interface on Debian 9. This would be a good next step.
That’s it! From this point you can install all the software you would like to use. The software I run on my machine is out of the scope of this post, but maybe I’ll write a blog about it someday.
Sources
- Sources of information & fixes are referenced inline.
- Header image: Debian 9 wallpaper