After installing Debian, people often want to do a few extra setup tasks which I’ll discuss in this article. I also provide an easy way for you to do them automatically.
What I Want You To Know About Debian
Debian is a rock-solid distro of choice for many Linux users, both new and skilled alike. It has a reputation of not breaking very often, and because of that, it’s used as a base for many other Linux distributions, such as Ubuntu, Linux Mint Debian Edition, Kali Linux, Devuan, Deepin, Raspberry Pi OS, BunsenLabs Linux, Qubes OS, Tails, SteamOS, and many others.
It’s one of the more mature Linux distros, with its first public release (version 0.01) on 1993-09-15, and its first stable release (version 1.1), named “buzz”, on 1996-06-17.
Many people know the core Debian tools quite well, although often because they are using a Debian derivative such as Ubuntu or Linux Mint (which is in fact an Ubuntu derivative). The popularity of these derived distros is mostly due to their creators’ small amount of effort making fancy-looking desktop themes, and their large marketing budgets. These distros are not much different than Debian itself, and they all have mostly the same free software available to install in their official online package repositories as Debian.
Other notable differences include the decision of which of those packages should be installed by default, and which Debian “update stream” they choose to base themselves off of. Debian has three main update streams, each with their own software repositories, which are known as “Stable”, “Testing”, and “Unstable (a.k.a. Sid)”. Stable is regularly audited by security researcher volunteers and other software experts, and any safety or stability issues found in any of the packages available in this update stream are promptly fixed.
For anyone who doesn’t need that level of safety and stability, it’s usually fine to use the Testing update stream. It can be beneficial in some cases, for example, if you want newer Windows games to work properly with Wine
or Proton
, sometimes you’ll need the newer Xorg
or GPU drivers
from the Testing stream for those games to run properly.
Criticisms of Debian
People who initially came to Linux through some Debian derivative distro like Ubuntu often claim that Debian is hard to use, or that Debian doesn’t work out-of-the-box, and so it’s not suitable for Linux beginners they say, but these claims are neither accurate, nor true at all.
Over the years I have encountered many more Ubuntu and Linux Mint releases which shipped with broken installers, and other bugs which needed some weird workarounds. There were very few similar types of problems on any Debian releases. It was in fact Debian which was usually working properly out-of-the-box, and some of its derived distros that weren’t, and this is no surprise, because a derived distro will almost always contain any bugs present in the parent distro, and will usually also contain extra bugs introduced when its creators make additional modifications. You might imagine that the people who are depending on some parent distro such as Debian for their own distro to work at all, might probably not have as much expertise or rigour as the people who make the distro which theirs depends on.
It’s an indisputable fact that Debian is almost always working properly out-of-the-box, and is hardly any different than these derived distros. There are simply not enough differences to cause Debian to be any harder to install or use than any of the other derived distros. People are just repeating this nonsense in most cases because they never tried Debian before, and/or they saw some Ubuntu or Linux Mint advertisements which caused them to prefer to use Ubuntu or some other derived distro.
Anyway, to get to the real purpose of this article: After installing Debian, many people want to make a few changes to the default configuration, to make it behave in a way that’s more similar to the default configuration of some of the Debian derivative distros, and these are usually the same small set of changes that almost everyone wants to do, so I’ll go over them here, and you can decide if you really want to make these changes or not the next time you install Debian. Maybe this list will be a useful reference to remind you of some of the changes you’ll be wanting to make, that you might not always remember once you finish the Debian install process.
Personally, I do all of the steps below after I install Debian for myself, and many of my customers have asked for most of these customizations without me suggesting them first.
Common Debian Post-Install Setup Steps
- Add your user account to the
sudo
group, so you can run commands asroot
by typing the wordsudo
before them. During the Debian install process, you are currently given the option to set aroot
password or not. If you choose to set aroot
password, your regular user account will not be givensudo
permissions by default. All of the following steps assume you have a root password set up already, and they won’t work if you don’t, so if you didn’t set one during the install process, you should do that first, using the commandsudo passwd
. To enablesudo
permission for your regular user account, run the following command in a terminal:su - -c 'gpasswd -a '$USER' sudo'
- Enable the official Debian
contrib
andnon-free
apt repositories, so you have access to more downloadable software:su - -c 'cat /etc/apt/sources.list | grep "contrib non-free" || \ sed -i "s/main/main contrib non-free/g" /etc/apt/sources.list'
- If on an
x86_64
system, enable thei386
architecture so that if you want to installwine
later, it might work properly for more things:su - -c 'uname -a | grep "x86_64"; \ if [ $? -eq 0 ]; then dpkg --add-architecture i386; fi'
- Update the system, including any available
dist-upgrade
packages in the current Debian release. Also, install thelsb-release
package so we can detect some things about the Linux distro to allow some future setup steps to be more automatic:su - -c 'apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && \ apt-get autoremove -y && apt-get install -y lsb-release'
- Install all available
free
andnon-free
device firmware:su - -c 'apt-get install -y firmware-linux firmware-misc-nonfree'
- Enable the official
backports
repository, so you can install some newer software when you want to by using the command:
sudo apt-get -t $(lsb_release -cs)-backports install <package name>
su - -c 'mkdir -p /etc/apt/sources.list.d && \ echo -e "deb http://deb.debian.org/debian $(lsb_release -cs)-backports main contrib non-free\ndeb-src http://deb.debian.org/debian $(lsb_release -cs)-backports main contrib non-free\n" | \ tee /etc/apt/sources.list.d/debian-backports.list && \ apt-get update'
- Install the correct nvidia video card driver and related packages if you have an nvidia GPU. This will install the latest version of the driver and the latest Linux kernel from the official
backports
apt repository, for best GPU compatibility:su - -c 'export DEBIAN_BACKPORTS_OPTS="-t $(lsb_release -cs)-backports"; \ apt-get ${DEBIAN_BACKPORTS_OPTS} install -y nvidia-detect; \ export NVIDIA_DRIVER_PACKAGE=`nvidia-detect 2>/dev/null | tail -n 2 | head -n 1 | xargs`; \ echo "$NVIDIA_DRIVER_PACKAGE" | grep nvidia-; \ if [ $? -eq 0 ]; then \ export DEBIAN_ARCH_NAME=`uname -r | rev | cut -d- -f1 | rev`; \ export DEBIAN_ARCH_NAME_FALLBACK=`uname -r | rev | cut -d- -f1,2 | rev`; \ apt-get ${DEBIAN_BACKPORTS_OPTS} install -y linux-image-${DEBIAN_ARCH_NAME} linux-headers-${DEBIAN_ARCH_NAME} || \ apt-get ${DEBIAN_BACKPORTS_OPTS} install -y linux-image-${DEBIAN_ARCH_NAME_FALLBACK} linux-headers-${DEBIAN_ARCH_NAME_FALLBACK}; \ apt-get ${DEBIAN_BACKPORTS_OPTS} install -y firmware-linux firmware-misc-nonfree; \ apt-get ${DEBIAN_BACKPORTS_OPTS} install -y build-essential ${NVIDIA_DRIVER_PACKAGE} && \ apt-get autoremove -y; \ else \ echo "No nvidia GPU was detected."; \ fi'
- After running that final series of commands, you need to reboot unless it outputs the message “No nvidia GPU was detected.”. If you see that message then you only need to log out and log back in to activate your new
sudo
permissions.
Automatic Method
I wanted to go over each of those steps one-by-one so you can take note of them. However, I’ve made a script which does all of the above steps automatically, that you can run by issuing a bash
one-liner in the terminal. If you’d rather do the above steps all at once, simply enter this in your terminal after installing Debian, and everything should happen automatically:
su - -c 'apt-get update && apt-get install -y wget' && \ bash <(wget -qO - https://bit.ly/debian-post-install)
Full details of the script, and the script itself can be viewed in my GitLab
repository here:
https://gitlab.com/defcronyke/debian-post-install
The above command runs the script directly from that repository, so you can always check the above link first before running it, if you want to verify that it will do what you expect. The script might change over time to add more features or to fix any issues if I become aware of any, so it might be wise to take a look at it each time before you run it. I take no legal responsibility whatsoever if my script does anything to your system that you’re not satisfied with, or if it harms your system in any way. I’m very sorry if it does anything undesirable. If that happens, please consider filing a bug report at the GitLab
repository link above, and I’ll do my best to fix any problems with the script right away.
Those are all the common changes I’m aware of that the majority of Debian users usually want to make after installing a new Debian system. If you can think of any other changes I’m missing here, as long as you think they are fairly minimal things that most Debian users usually like to do, feel free to mention them in the comments below and I’ll consider adding them to this list.
Extra Tips For Having The Best Debian Experience
- I always recommend using the
Xfce
desktop environment on desktop Linux installations for the least chance of problems. It’s not too heavy, but you can add lots of extras to it as you prefer. It’s fairly customizable and stable. Debian has this desktop environment available in its official releases, although sometimes it’s not the default. You can choose it during the install procedure, or by installing with the correct install image. - The Debian website publishes an unofficial Live CD installer version which includes all the available
non-free
device firmware which isn’t present in their official installation images. To avoid a rare potential situation where some of your hardware isn’t working properly during or immediately after Debian installation, I suggest that you consider using this unofficial installation image instead of their official one. It’s a bit hard to find by navigating their website, so I’m linking to it here for convenience:
https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/current-live/amd64/iso-hybrid/ - You should only use the above images if you’re okay with installing and using
non-free
device firmware which cannot be audited properly for safety and security issues, since the firmware source code isn’t available from the manufacturers of the associated devices. If you’d rather not be doing that, you can usually use their official installation images without any problems, which you can find here:
https://www.debian.org/distrib/
Disclosure: Jeremy is an online computer store owner whose store is listed as a “Debian pre-installed vendor” on https://debian.org, but is otherwise not currently affiliated with the Debian Linux distribution in any way. Still, because of this there may be some bias in favour of Debian in the writing above. The people in charge of Debian don’t necessarily condone or personally hold any of the views expressed above, they are only the author’s personal views, albeit somewhat influenced by several years spent supporting various free Linux distributions for his customers at his job.
Things Most People Do After Installing Debian by Jeremy Carter <jeremy@jeremycarter.ca> is licensed under the terms of the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International license.