Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[HowTo] Install and configure Debian Bullseye

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 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 Add GPU acceleration in Firefox

Note: These steps will make Firefox use GPU acceleration to render web pages and video. This should result in lower CPU usage and smoother scrolling. GPU acceleration may not be compatible with your graphics card, and it may not offer a noticeable improvement on older hardware.

Open Firefox and type "about:config" in the address bar.
Click on "Accept the Risk and Continue" if a warning message appears.
In the search bar, type "layers.acceleration.force-enabled".
Double-click on the "layers.acceleration.force-enabled" preference to set it to "true".
In the search bar, type "gfx.webrender.all".
Double-click on the "gfx.webrender.all" preference to set it to "true".
Close the about:config tab and restart Firefox.

Check that it works:

Type "about:support" in the address bar and press Enter.
Scroll down to the "Graphics" section.
Look for the "Compositing" field, which should show "WebRender" if GPU acceleration is enabled.
Also, check the "GPU Accelerated Windows" field, which should show "1/1 Direct3D 12 (OMTC)" if GPU acceleration is enabled.


4.20 Use Bluetooth loudspeakers

In order to play music over Bluetooth, you need the Bluetooth module for PulseAudio sound server:

Code: Select all

# apt install pulseaudio-module-bluetooth

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

4.22 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.23 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.24 Swap less

A Debian installation that is automatically set up, will only set a 1GB swap partition. Modern computers usually have more than enough RAM to deal with the daily use of the system without the need for swap. Use of swap will slow down the system and causes wear on the SSD. In order to make the computer swap less, we can edit the /etc/sysctl.conf file.

Code: Select all

# nano /etc/sysctl.conf 
Then add these lines:

Code: Select all

vm.swappiness=10
vm.vfs_cache_pressure=50
Save and exit.


4.25 ZRam
ZRam is formerly known as compcache and will create a compressed block device in RAM. The block device created with ZRam can then be used for swap or as general-purpose RAM disk. See the Wiki for more info: https://wiki.debian.org/ZRam

To install:

Code: Select all

# apt install zram-tools
The configuration file is here:

Code: Select all

# nano /etc/default/zramswap
4.26 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.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
craigevil
Posts: 5391
Joined: 2006-09-17 03:17
Location: heaven
Has thanked: 28 times
Been thanked: 39 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: 251
Joined: 2013-10-01 22:49
Location: Puerto Rico
Has thanked: 4 times
Been thanked: 5 times

Re: Howto: Installing and configuring Debian Bullseye

#3 Post by eor2004 »

@ Halvor, kudos to you for this excellent HowTo!
Debian 12 Gnome on a MSI H61M-P25 (B3) PC & on a Dell Latitude E6410 & HP EliteBook 8540p Laptops.
LMDE 6 on a Panasonic ToughBook CF-C1 Laptop.
Bodhi Linux 7 on a HP Compaq DC5750 Small Form Factor PC.
Windows 11 on a Intel DH55TC PC.

User avatar
eor2004
Posts: 251
Joined: 2013-10-01 22:49
Location: Puerto Rico
Has thanked: 4 times
Been thanked: 5 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!
Debian 12 Gnome on a MSI H61M-P25 (B3) PC & on a Dell Latitude E6410 & HP EliteBook 8540p Laptops.
LMDE 6 on a Panasonic ToughBook CF-C1 Laptop.
Bodhi Linux 7 on a HP Compaq DC5750 Small Form Factor PC.
Windows 11 on a Intel DH55TC PC.

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: 120
Joined: 2022-09-09 02:30
Has thanked: 50 times
Been thanked: 5 times

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
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 times

Re: Howto: Install and configure Debian Bullseye

#8 Post by Hallvor »

Thank you for your kind words!
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
dirtydog
Posts: 4
Joined: 2021-10-15 18:39
Been thanked: 1 time

Re: Howto: Install and configure Debian Bullseye

#9 Post by dirtydog »

# 1 how to :D
"DirtyDog"

User avatar
kalwisti
Posts: 88
Joined: 2010-02-28 20:29
Has thanked: 1 time

Re: Howto: Install and configure Debian Bullseye

#10 Post by kalwisti »

@Hallvor,

Many thanks for sharing this guide with us! :) It's clear that you spent a lot of time preparing it.

I recently installed Bullseye after being away from Debian for several years. Your guide is very useful because I had forgotten some of these configuration tips.

As for possible improvements, the only suggestion I would make is that it might be worthwhile to mention that Bullseye has full support for Flatpaks and AppImages. However, I realize this is a somewhat controversial topic and folks can have strong opinions on these newer package formats ...
Registered Linux User # 442201

Debian 12.1 "Bookworm" Xfce (64-bit)

Lenovo ThinkCentre M800 SFF: Intel Core i3-6100, 16 GB RAM, Samsung 860 EVO 500 GB SSD, Intel HD Graphics 530

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 times

Re: Howto: Install and configure Debian Bullseye

#11 Post by Hallvor »

Thank you for your kind words.

I agree. That part was dropped for political reasons, but I'll add it again. Snaps, flatpaks and appimages have their place and their usefulness.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

SamuelMac
Posts: 19
Joined: 2023-03-23 04:05
Been thanked: 1 time

Re: [HowTo] Install and configure Debian Bullseye

#12 Post by SamuelMac »

Now that's the best HOW TO!

Thank You Hallvor!

CynicalDebian
Posts: 263
Joined: 2023-03-02 05:26
Location: USA
Has thanked: 50 times
Been thanked: 60 times
Contact:

Re: [HowTo] Install and configure Debian Bullseye

#13 Post by CynicalDebian »

Perhaps use adduser to add user to sudoers rather than usermod? Would be more consistent since most things done with usermod can be done with adduser.

https://wiki.debian.org/sudo

Like this

Code: Select all

# adduser jhon-smith sudo
Be seeing you...

arzgi
Posts: 1183
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: [HowTo] Install and configure Debian Bullseye

#14 Post by arzgi »

sudo has been a 'normal group' for a long time, just add user to sudo group

Code: Select all

# adduser $user sudo
logout, login.

Post Reply