.gitignore | ||
Getting_Debian.md | ||
README.md | ||
update_index.py |
Getting Debian
This is a short guide explaining how to install and configure Debian like I normally do. Some solutions are the same for everyone, while some problems can be solved in many ways and here I only suggest the solutions I prefer. This guide does not cover basic GNU/Linux knowledge, like how to use the command line: it is focused on more specific topics and it does take some things for granted. I recommend that you read each section before starting to do what it says. The main sources I took my information from are the Debian Wiki and the Arch Wiki. I decided not to link every article that helped me because this document aims to gather many pieces of information in one place and in a concise, clear way.
Index
- Installing Debian
- Upgrading to Debian Unstable
- Getting WiFi and Ethernet to work
- Getting audio to work
- Configuring the touchpad
- Removing default folders from Home
- Disabling recent files
- Changing GRUB background
- Quick adjustments
- Additional software
- Footnotes
Installing Debian
-
Before starting, backup all the files you want to keep on your next Debian installation. These normally include most of your Home folder, potential configuration files located outside of it, browser bookmarks and emails saved locally. You can use an external drive, like a USB stick, or a cloud service. You can directly copy or upload your files, but it may be more convenient to create a ZIP or TAR archive.
-
Download the correct ISO from the Debian site. I usually choose a netinst ISO for Debian Stable.1 A netinst ISO is small in size but requires an Internet connection during installation, so you will need an Ethernet cable or a similar method of going online without WiFi. To check your processor architecture you can run
dpkg --print-architecture
: in my case, it is amd64. Important note: if you do not have an Ethernet cable and plan to use WiFi on your system, consider choosing an ISO with non-free firmware included, as it will be impossible for you to download WiFi drivers later on. -
Create an installation medium. For this process you will need an external drive. Please note that all of its content will be overwritten and lost. If you decide to use a USB stick, you can follow this guide on the Arch Wiki.
-
Power off your computer and make sure its charger is plugged in: it is important that the device does not run out of power during the process. If you have chosen a netinst ISO, connect your Ethernet cable.
-
Switch on your computer and quickly open the boot options before the operating system starts loading. Usually you can do this by pressing
F12
, but the actual key may be different on your device. To make sure the key stroke gets recognised, press it three or four times quickly. Select the installation medium instead of the internal hard disk. You should be able to navigate through a list of devices using the arrow keys and confirm withEnter
. -
A screen with the Debian logo and a list of options should appear. You can choose to proceed with a graphical interface or a command-line one. I recommend the latter. At this point you only have to follow the intructions that appear on the screen. I recommend that you also read this page on the Installation Guide while you go on with the installation. It describes the whole process and explains some important concepts.
Links you might find useful
About the desktop environment
I like having a minimal operating system, so during the installation I select not to install any desktop environment. However, since I still want a GUI, I later install and configure a window manager, along with all the programs I need. If you prefer an OS that already comes with a full desktop experience and all the programs you need, or if you do not have time to configure Debian, you can select a desktop environment. I like XFCE as it is lightweight, but functional. It provides all the tools I need while remaining simple and usable.
Upgrading to Debian Unstable
At this point, you have installed either Debian Stable or Testing. However, you might want to upgrade to Debian Unstable, which is the version I personally prefer.
To upgrade to Debian Unstable, you have to change the respositories that will be used to download packages. In order to do that, you must change the content of the file located at /etc/apt/sources.list
, so run sudoedit /etc/apt/sources.list
and enter your password. The file should contain some lines looking more or less like this and other commented lines, namely lines starting with #
that are totally ignored:
deb http://deb.debian.org/debian/ bullseye main
deb-src http://deb.debian.org/debian/ bullseye main
deb http://security.debian.org/debian-security/ bullseye-security main
deb-src http://security.debian.org/debian-security/ bullseye-security main
deb http://deb.debian.org/debian/ bullseye-updates main
deb-src http://deb.debian.org/debian/ bullseye-updates main
In the first two lines, replace the code name of the Debian version ("bullseye" for Debian 11) with "unstable". The following two lines must be deleted or commented (I recommend the latter), because they are for security updates, which Debian Unstable never gets. The last lines must be deleted or commented as well. Save the changes (Ctrl+S
if sudoedit
opened Nano) and close the text editor (Ctrl+X
in Nano).
Now run the following commands:
sudo apt update
sudo apt full-upgrade
Finally, reboot the system. If you cannot, or do not want to, leave the command line, you can use systemctl reboot
.
Best practices
- Only upgrade packages when you have some time to fix pontential problems. Do not upgrade before important events like a presentation or a business trip: your system will break at the worst times!
- Do not blindly accept the actions proposed by the package manager: make sure they are in line with your wishes and expectations.
- Avoid
apt full-upgrade
as it may remove packages you depend on. - Install the packages
apt-listbugs
andapt-listchanges
: they will tell you when a package you are about to install or upgrade has bugs or important changes. - Backup your system frequently.2
Getting WiFi and Ethernet to work
It is a very common problem that WiFi does not work out of the box after installing Debian. This happens because WiFi often needs non-free, proprietary software, which is not included in the Debian repositories by default.
To install the correct drivers and get WiFi to work, follow this guide on the Debian Wiki and the other guides linked in it. First, you must identify your WiFi device, then install the correct drivers, possibly the free ones, and maybe other important packages. After that, I recommend that you disable the non-free repositories, if you had to enable them to install the drivers. This will prevent you from installing other non-free software later. To make sure everything works correctly, reboot your computer.
If you are using a desktop environment, you should now be able to manage WiFi through the preinstalled graphical tools. To do it on the command line, use nmcli
or nmtui
, both included in the package network-manager
. NetworkManager may have some problems handling wired networks, though: this is because it does not manage this kind of interfaces by default. To enable them, edit the file /etc/NetworkManager/NetworkManager.conf
and change the line managed=false
to managed=true
. Then, restart NetworkManager with sudo service NetworkManager restart
.
Getting audio to work
Sound functions in Debian are provided by the Advanced Linux Sound Architecture (ALSA), which is an essential part of the kernel, almost always in combination with a sound server. If you have installed a full DE, a sound server like PulseAudio, JACK, or PipeWire probably is already present on your system, and audio should work just fine. If you have done a minimal installation and intend to use ALSA alone, though, you may encounter some complications. In case the audio does not work right after your minimal installation, install the package alsa-utils
, run the command sudo alsactl init
to initialize ALSA, then reboot. This should do the trick.
alsa-utils
also includes useful tools to manage audio directly through ALSA. For example, amixer
is a command-line mixer that will be especially useful if you have to configure keyboard shortcuts to adjust the volume. Then there is alsamixer
, a cool mixer with a semi-graphical interface that works inside the terminal.
Note that some programs depend on a sound server to manage sound. For example, without PulseAudio, Firefox used to give me some problems as it did not receive any input from the microphone. Luckily, there is a nice workaround that does not use PulseAudio and will solve these issues: you can install the package apulse
, which is basically a partial PulseAudio emulator for ALSA. It allows you to use programs like Firefox simply by launching them with the command apulse <program>
.
Configuring the touchpad
The following instructions assume that the package xserver-xorg-input-libinput
is installed.
You may want to configure your touchpad in a way that is more comfortable to you; for example, you may want to enable the tap-to-click option, which is often disabled by default. To do so, copy the file /usr/share/X11/xorg.conf.d/40-libinput.conf
in the folder /etc/X11/xorg.conf.d
. Now open the file you have just created and delete everything except the section that looks similar to the following (you do not have to do this if the file was already there):
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection
You can configure the touchpad by adding the appropriate options, listed in man libinput
, at the bottom of this section. For example, in order to enable tap-to-click, simply add the line Option "Tapping" "on"
. This should also allow you to right-click by tapping with two fingers and to drag by tapping twice.
Finally, for changes to take effect, you will need to restart X (rebooting is not necessary, although it would do the job).
Removing default folders from Home
In your Home folder there are some default directories, like Desktop or Pictures. If you do not need them, you may try to remove them. However, they would be recreated automatically after a while. If you want to prevent this, you can delete the folders you do not need and then run xdg-user-dirs-update
. The command should tell you that some default folders were removed, and that the corresponding variables now point to your Home directory.
Disabling recent files
I do not really like that my system remembers the recently used files. I think it is a useless feature: just because I have recently opened a file, it does not mean that I want to open it again, does it? If you agree with me, here is how I managed to disable this misfeature. You will have to add the following lines in the file located at ~/.config/gtk-3.0/settings.ini
:
gtk-recent-files-max-age=0
gtk-recent-files-limit=0
gtk-recent-files-enabled=0
If these options are already specified inside settings.ini
, just change their values to 0
. At this point, the problem is not fully solved yet. It is possible that your file chooser still defaults to the Recent
folder. To change this behaviour and set your Home
folder as the default, add the following lines inside ~/.config/gtk-2.0/gtkfilechooser.ini
:
StartupMode=cwd
DefaultFolder=cwd
Again, if the options are already specified, just change their values. The last step is to delete the file ~/.local/share/recently-used.xbel
.
Changing GRUB background
GRUB, the boot loader, can be customised to match your preferences. One of the many things you can change is the background splash image you see before the OS starts loading. To do this, you have to change the content of /etc/default/grub
. First, set the following options, replacing the tags between <
and >
with the actual values:
GRUB_GFXMODE=<screen_width_in_px>x<screen_height_in_px>
GRUB_GFXPAYLOAD_LINUX=keep
Then, make sure that the line GRUB_TERMINAL=console
is absent, or commented by a #
at the beginning. Now, choose your new background image. It must have the following properties to work properly:
- PNG, JPG or TGA format;
- resolution equal to that of your screen; this is not essential, but recommended;
- RGB mode, not indexed, 8-bit.
Make also sure that the image is in an unencrypted partition, otherwise GRUB will not be able to read it. Even on encrypted systems, usually /boot
is necessarily unencrypted, so /boot/grub
, where other configuration files are, is a good choice. Now, you can add the line GRUB_BACKGROUND="/full/path/to/image"
inside /etc/default/grub
, obviously using the real full path. Finally, run sudo update-grub
. If everything went well, the output should contain the line Found background image: ...
.
Quick adjustments
This section contains short notes about things you might want to do on Debian. Some of them could be further developed in the future.
- Add this line:
export QT_QPA_PLATFORMTHEME="gtk3"
to~/.bashrc
to tell Qt to follow, more or less, GTK theme (better than nothing). - You can deactivate Bluetooth in the following ways:
sudo systemctl stop bluetooth.service
stops the Bluetooth unit now, but it may start again on the next boot or when manually started;sudo systemctl disable bluetooth.service
disables the Bluetooth unit: it will not start on boot anymore;- setting the option
AutoEnable=false
(this is the default value) in the[Policy]
section of/etc/bluetooth/main.conf
will prevent the Bluetooth adapter to power on after a reboot.
- If you want to transfer files between a smartphone and your Debian computer through a USB cable, you may want to install the package
mtp-tools
. - To use a scanner, install
sane-utils
and then use the commandscanimage
.
Additional software
This is a list of the software I use for different purposes. This is only a personal recommendation and if you have installed a desktop environment you will probably have most of the programs you need.
- Window manager: openbox
- Terminal emulator: xfce4-terminal
- Web browser: firefox
- File manager: thunar
- Image viewer: ristretto
- Image editor: gimp3
- Vector image editor: inkscape
- Media player: parole
- Video downloader: yt-dlp
- Song metadata editor: exfalso
- Basic video/audio editing: ffmpeg
- Document reader: atril
- Document editor: libreoffice-writer45
- Instant messaging: telegram-desktop
- Version control system: git
- C++ compiler: g++
- Panels: polybar
- Wallpaper changer: hsetroot
- Screen locking tool: xtrlock
- Night light tool: sct
- Fonts: fonts-freefont-ttf
Footnotes
-
Learn more about the releases of Debian:
I would like to point out that despite its name Debian Unstable is not as unstable as the documentation suggests. It hardly ever happens that an upgrade breaks your system, it is not like new packages are thrown in the unstable repositories completely at random, and although the repositories receive daily updates, you do not have to upgrade everything all the time. Moreover, bugs are fixed in a couple of days. ↩︎
-
In the following pages you can find information about backups and many example tools. Personally, I like using TAR.
↩︎ -
You may notice that GIMP has an ugly interface, with buttons in relief looking as if they came from the 1990s. To solve this, launch
gimp
from a terminal. You should get this error:GTK theme error: Unable to locate theme engine in module_path: "pixmap"
If that is the case, simply install the package
gtk2-engines-pixbuf
. ↩︎ -
If you use LibreOffice, you should also install the package
libreoffice-gtk3
: it will allow LibreOffice to integrate with the system theme. ↩︎ -
If you want to use a spell checker on LibreOffice, you need the corresponding package. Most of them are
hunspell-...
packages: for examplehunspell-it
is for the Italian spell checker. ↩︎