Howto: Install and configure Debian Bullseye

Share your own howto's etc. Not for support questions!
Post Reply
Message
Author
User avatar
Hallvor
Posts: 1571
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 40 times
Been thanked: 81 times

Howto: Install and configure Debian Bullseye

#1 Post by Hallvor »

1. Who is this for?
This howto is aimed at beginners, but assumes a little knowledge of GNU/Linux, but no experience of Debian should be necessary. The howto will contain useful tips for more advanced users to set up a working desktop very fast. It is also made for Debian Bullseye, so any other version may not work.

2. Advantages and drawbacks of Debian

There is no such thing as a perfect operating system, but Debian is pretty close.

Advantages
1. Debian is the second oldest distro in existence and with many developers.
2. Debian supports all major desktop environments and window managers.
3. The software is well tested and stable, and the repositories are huge.
4. You should be able to upgrade from the current to the next stable version without any problems. That means plenty of time for productivity, and very little needed time for maintenance.

Drawbacks (may) include
1. Old and sometimes outdated software. If you *must* have the latest software at all times, Debian is not for you.
2. Depending on your political/philosophical standpoints: No non-free software by default - and it contains systemd.

But this installation will include non-free firmware in order to work for hardware that in many cases will fail with the official installation media.

3. Installing Debian
A Debian installation on incompatible hardware is a nightmare, while running it on compatible hardware is a breeze, so you may want to check it your system is compatible by running a LiveDVD from here: https://cdimage.debian.org/images/unoff ... so-hybrid/
If you don’t want to use it for political reasons, you are of course free not to.
If everything works, I prefer to use the non-free netinstall: https://cdimage.debian.org/images/unoff ... 64/iso-cd/

Here is a video of an actual installation: https://www.youtube.com/watch?v=P4J_99cS7Bg (For any portable device, I strongly recommend selecting LUKS disk encryption in the installer.) I also recommend KDE for new users, since it has more GUI features than any other desktop environment. However, it is a good idea to do a little sesearch before deciding. Here is a comparison from 2021: https://fossbytes.com/best-linux-desktop-environments/

The Debian installation guide is highly recommended: https://www.debian.org/releases/stable/installmanual

4. Post install

Please don't blindly copy and paste the commands below. It is probably a good idea to think twice.

The commands are divided in two categories:

$ means that the command should be issued as regular user

# means that the command should be issued as root or with sudo

You switch from your regular user to root with $ su -
You switch from root to regular user with su - username, for instance # su - hallvor. Or just type "exit" or Ctrl-D.

4.1 Check for updates

Code: Select all

# apt update && apt upgrade

4.2 Install sudo

Sudo will be installed automatically if you leave your root password blank during installation. If you still set a root password and would like to use sudo, issue the following commands. Become root:

Code: Select all

$ su -
Install the sudo package

Code: Select all

# apt install sudo
Add your user to the sudo group

Code: Select all

# usermod -a -G sudo <username>
For instance like this:

Code: Select all

# usermod -a -G sudo hallvor
You will now find that you have been added to the sudo group with id <username>, for instance

Code: Select all

$ id hallvor
4.3 Fix the «failed to fetch cdrom»-error

Code: Select all

# nano /etc/apt/sources.list
Comment out with a # or remove the cdrom line, like this:

Code: Select all

#deb cdrom:[Debian GNU/Linux 11.0 _Bullseye_ - Official amd64 NETINST / bullseye contrib main non-free
The sources.list for Bullseye should according to the Debian Wiki (https://wiki.debian.org/SourcesList) look like this:

Code: Select all

deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free

deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free

deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
Keep in mind that you can safely comment out the repositories beginning with deb-src unless you are going to build applications from source. This will use less data.

Save and exit with Ctrl-X and then y to exit.

Update your sources.list:

Code: Select all

# apt update
4.4. Detect and install missing firmware

Install Isenkram

Code: Select all

# apt install isenkram
Autoinstall necessary firmware

Code: Select all

# isenkram-autoinstall-firmware
https://manpages.debian.org/testing/ise ... .8.en.html

4.5 Install microcode
Processor microcode is akin to processor firmware. The kernel is able to update the processor’s firmware without the need to update it via the BIOS update. Processors from Intel and AMD may need updates to their microcode to operate correctly.
Type the following to detect your processor type:

Code: Select all

$ lscpu
For Intel:

Code: Select all

# apt install intel-microcode
For AMD:

Code: Select all

# apt install amd64-microcode
If you haven’t already done so, it may be a good idea to install the firmware-misc-nonfree package containing various binary firmware: https://packages.debian.org/bullseye/fi ... sc-nonfree

Code: Select all

# apt install firmware-misc-nonfree
4.6 Nvidia or AMD graphics drivers

NVIDIA
In order to install the correct driver, you need to install the headers. For the typical amd64-computer:

Code: Select all

# apt install linux-headers-amd64
Then follow these instructions:

https://wiki.debian.org/NvidiaGraphicsD ... ullseye.22

AMD/ATI
https://wiki.debian.org/AtiHowTo


4.7 Packages from outside the repository:

A word of caution. Never ever install packages from distros like Ubuntu or its PPAs. Never ever install packages from Debian Testing or Debian Sid. You will probably end up breaking your install:https://wiki.debian.org/DontBreakDebian

If you need more recent software, use backports (but keep in mind that this is not as well tested as the software in the respository): https://backports.debian.org/Instructions/

If it is not found in backports, ask in the forum for a solution. A little word of advice: The forum members usually have little patience for beginners who haven’t actively tried to find a solution. Please read this: viewtopic.php?t=47078


4.8 SSD optimization

Add noatime: If you use an SSD, there are certain things to optimize the performance:

Code: Select all

# nano etc/fstab
Then add the noatime parameter like in the example below to reduce disk writes. Noatime is a little (probably not noticable) faster than relatime.

/dev/mapper/debian--thinkpad--vg-root /               ext4    errors=remount-ro,noatime 0       1

(The discard option is sometimes recommended, but is not needed if you have enough free space. The discard option also has drawbacks when it comes to cryptography.)

Save and exit.

Enabling fstrim: Fstrim is used on a mounted filesystem to discard/trim blocks which are not in use by the filesystem.

Code: Select all

# systemctl enable fstrim.timer
# systemctl start fstrim.timer
Verify that the timer is enabled:

Code: Select all

# systemctl list-timers --all
Your system should now TRIM all mounted filesystems once weekly.

Further SSD optimization is found here: https://wiki.debian.org/SSDOptimization


4.9 Font rendering
One of the first things I do is altering the font rendering. First we’ll install liberation fonts. These are metrically identical to Microsoft fonts, so they should yield the same result.

Open the terminal, log in as root with

Code: Select all

$ su -
Then (as root):

Code: Select all

# apt install fonts-liberation
If you want to install Microsoft's fonts as well, you can install them with:

Code: Select all

# apt install ttf-mscorefonts-installer
If you are running KDE, you can enter Systemsettings in the menu --> Fonts and then experiment with the settings. I have enabled Sub pixel rendering, Type: RGB and Hinting: Full. Then reboot your computer. You may want to experiment with these settings to find your optimal settings.

GNOME fonts can also be adjusted in the GUI.

If you are not running a desktop environment with GUI options, you can use the following command:

Code: Select all

# dpkg-reconfigure fontconfig fontconfig-config
Type Ctrl + x to save and Y to exit. Reboot to see the difference.

4.10 Improve your laptop’s battery life
This is very straight forward. TLP will have good default settings, so no tweaking should be necessary. If you already have laptop-mode-tools installed, TLP will conflict with it, so you must not have both installed at the same time.

Run the following command to remove laptop-mode-tools if installed and install TLP:

Code: Select all

# apt remove laptop-mode-tools && apt install tlp tlp-rdw
The following command lets you view system info and status of tlp

Code: Select all

# tlp-stat -s
OR just use laptop-mode-tools:

Code: Select all

# apt install laptop-mode-tools
If you have a ThinkPad, you may want to use TLP with battery charging thresholds. Read this:
http://forums.debian.net/viewtopic.php?f=16&t=140768

Reboot when done.

4.11 Firewall

If you want a basic firewall that blocks incoming traffic while allowing outgoing traffic, one of the easiest ways to administer the Debian Netfilter firewall is by using ufw.

Code: Select all

# apt install ufw

Code: Select all

# ufw enable
# ufw default deny incoming
# ufw default allow outgoing
Check that everything works

Code: Select all

# ufw status verbose
A different option can be found here: http://forums.debian.net/viewtopic.php?f=16&t=143876
Just add the ports you would like to keep open in the text file. Very conventient.

4.12 Night colours
Night colours are nice if you can’t resist using the computer at night:

KDE:
Open system settings and search for night colours. Tick the checkbox, adjust the settings to your liking and enable.

Gnome:
GNOME should have a native blue light filter called Night Light.


Redshift is a good option for everyone else:

Code: Select all

# apt install redshift redshift-gtk
4.13 Enable DRM to watch Netflix, etc.[/u][/i]
Open Firefox. Then Open the menu (the three black bars) --> Settings. Scroll down select the Enable DRM checkbox.

4.14 Fix non-working plasmoids in KDE
On a new installation, KDE will complain about a missing file when adding some plasmoids. To avoid it, run the following command (as root):

Code: Select all

# apt install qml-module-qtquick-xmllistmodel
4.15 Further KDE configuration:
Here are some nice tips and tricks: https://www.youtube.com/watch?v=exQh0_JKBJQ

If you want to really change the default look, KDE is extremely flexible. Here are some examples:

… like Gnome: https://www.youtube.com/watch?v=qS6KH3HCVpA

...like Windows 10: https://www.youtube.com/watch?v=Cv-PhOMa1go

...and like Mac OS: https://www.youtube.com/watch?v=DX_gQTQLUZc

4.16 Adding more users
If multiple users will use the same computer, it is highly recommended to create separate user accounts.
You can add new user in KDE in Systemsettings → Manage users → Add user
It is of course also possible to create a new user account from the command line (as root):

Code: Select all

# adduser nameofuser
You will then be prompted to type name, password, etc.
If you want to delete a user completely, just type (as root)

Code: Select all

# deluser --remove-home nameofuser

4.17 Useful browser addons

I highly recommend the following browser addons to block ads and trackers:
Ublock Origin: https://ublockorigin.com/
Privacy Badger: https://privacybadger.org/
Cookie Autodelete: https://github.com/Cookie-AutoDelete
I don't care about cookies: https://www.i-dont-care-about-cookies.eu/

4.18 Install additional applications

No package manager is needed to install applications. You can easily search for and install applications using apt.

Code: Select all

# apt search nameofpackage
Then

Code: Select all

# apt install nameofpackage
To see GNU/Linux alternatives for Windows applications, see here: https://www.linuxalt.com/
You can also install package managers like Discover (KDE) or Synaptic, if they are not already installed.

4.19 Install Steam
Read this: https://wiki.debian.org/Steam

4.20 Backing up your system
Any computer user has lost data, or has not lost data *yet*. Fortunately, creating a backup is very easy.
KDE has an integrated backup utility in Systemsettings.

Timeshift is a different option

Code: Select all

# apt install timeshift
Launch the application and choose RSYNC as snapshot type. Select where you want to save your backup and when the backup needs to be created. Then click finish.

4.21 Basic maintenance

Security upgrades should be installed automatically if the package unattended-upgrades are installed and configured.

Code: Select all

# apt install unattended-upgrades
Then enable it with

Code: Select all

# dpkg-reconfigure unattended-upgrades
The largest desktops also include update notifiers, so you’ll know when updates are ready.
Other than that, these commands will keep your system updated and in good order. A word of caution: If you have uninstalled a package belonging to a larger metapackage with, say, your desktop environment, it will be marked for uninstallation with autoremove, and you'll end up with a command line interface. It is a powerful tool, so don't blindly press yes to remove whatever comes up.

Code: Select all

# apt update && apt upgrade
# apt autoclean && apt autoremove

4.21 Dist-upgrades

You should always read the release notes for the next version before attempting a dist-upgrade: https://www.debian.org/releases/stable/releasenotes Debian Bookworm will be released some time in 2023, so be patient. https://en.wikipedia.org/wiki/Debian_ve ... (Bookworm)


That’s it. I hope it was useful.
Comments or tips for improvement are always welcome.
Last edited by Hallvor on 2021-12-26 22:10, edited 4 times in total.
How to install firmware: viewtopic.php?f=16&t=151785
Installing and configuring Debian Bullseye: viewtopic.php?f=16&t=150334

User avatar
craigevil
Posts: 5399
Joined: 2006-09-17 03:17
Location: heaven
Has thanked: 22 times
Been thanked: 31 times

Re: Howto: Installing and configuring Debian Bullseye

#2 Post by craigevil »

Awesome Howto!!!
Raspberry PI 400 Distro: Raspberry Pi OS Base: Debian Sid Kernel: 5.15.69-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"
My Giant Sources.list

User avatar
eor2004
Posts: 241
Joined: 2013-10-01 22:49
Location: Puerto Rico
Has thanked: 2 times
Been thanked: 3 times

Re: Howto: Installing and configuring Debian Bullseye

#3 Post by eor2004 »

@ Halvor, kudos to you for this excellent HowTo!
OS: Debian 10 Buster 64-bit DE: MATE 1.20 CPU: AMD Phenom II X4 925 @ 2.8GHZ RAM: 8GB CORSAIR XMS2 PC2-6400U DDR2 (CM2X2048-6400C5C) GPU: ATI Radeon HD 3200 Mobo: Gigabyte GA-MA78GPM-DS2H HDD: HGST 4TB SATA 7200RPM (HUS724040ALA640) 8)

User avatar
eor2004
Posts: 241
Joined: 2013-10-01 22:49
Location: Puerto Rico
Has thanked: 2 times
Been thanked: 3 times

Re: Howto: Installing and configuring Debian Bullseye

#4 Post by eor2004 »

Hallvor wrote: 2021-09-26 11:02A word of caution: If you have uninstalled a package belonging to a larger metapackage with, say, your desktop environment, it will be marked for uninstallation with autoremove, and you'll end up with a command line interface. It is a powerful tool, so don't blindly press yes to remove whatever comes up!
As a general rule I only use "apt autoremove" when upgrading to a new version or release of debian!
OS: Debian 10 Buster 64-bit DE: MATE 1.20 CPU: AMD Phenom II X4 925 @ 2.8GHZ RAM: 8GB CORSAIR XMS2 PC2-6400U DDR2 (CM2X2048-6400C5C) GPU: ATI Radeon HD 3200 Mobo: Gigabyte GA-MA78GPM-DS2H HDD: HGST 4TB SATA 7200RPM (HUS724040ALA640) 8)

peterbata
Posts: 7
Joined: 2021-10-25 13:48
Has thanked: 2 times

Re: Howto: Install and configure Debian Bullseye

#5 Post by peterbata »

Thank you @Hallvor

User avatar
Linuxembourg
Posts: 25
Joined: 2021-11-24 00:41
Has thanked: 4 times
Been thanked: 3 times

Re: Howto: Install and configure Debian Bullseye

#6 Post by Linuxembourg »

This should be some made into some sort of sticky thread. It's absolutely fabulous.

wonder
Posts: 23
Joined: 2022-09-09 02:30
Has thanked: 12 times
Been thanked: 1 time

Re: Howto: Install and configure Debian Bullseye

#7 Post by wonder »

After several years in derivatives, I must say that this thread, this How To, is the best I have found for an installation, configuration, understanding...
I should have come to Debian a long time ago...

Thank you @Hallvor !

User avatar
Hallvor
Posts: 1571
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 40 times
Been thanked: 81 times

Re: Howto: Install and configure Debian Bullseye

#8 Post by Hallvor »

Thank you for your kind words!
How to install firmware: viewtopic.php?f=16&t=151785
Installing and configuring Debian Bullseye: viewtopic.php?f=16&t=150334

Post Reply