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 -
Code: Select all
# apt install sudo
Code: Select all
# usermod -a -G sudo <username>
Code: Select all
# usermod -a -G sudo hallvor
Code: Select all
$ id hallvor
Code: Select all
# nano /etc/apt/sources.list
Code: Select all
#deb cdrom:[Debian GNU/Linux 11.0 _Bullseye_ - Official amd64 NETINST / bullseye contrib main non-free
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
Save and exit with Ctrl-X and then y to exit.
Update your sources.list:
Code: Select all
# apt update
Install Isenkram
Code: Select all
# apt install isenkram
Code: Select all
# isenkram-autoinstall-firmware
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
Code: Select all
# apt install intel-microcode
Code: Select all
# apt install amd64-microcode
Code: Select all
# apt install firmware-misc-nonfree
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
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
/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
Code: Select all
# systemctl list-timers --all
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 -
Code: Select all
# apt install fonts-liberation
Code: Select all
# apt install ttf-mscorefonts-installer
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
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
Code: Select all
# tlp-stat -s
Code: Select all
# apt install laptop-mode-tools
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
Code: Select all
# ufw status verbose
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
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
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
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
Code: Select all
# apt install nameofpackage
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
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
Code: Select all
# dpkg-reconfigure unattended-upgrades
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
Code: Select all
vm.swappiness=10
vm.vfs_cache_pressure=50
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
Code: Select all
# nano /etc/default/zramswap
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.