Howto: Installing and configuring Debian Buster

Share your own howto's etc. Not for support questions!

Howto: Installing and configuring Debian Buster

Postby Hallvor » 2020-03-08 11:16

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 Buster, 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/unofficial/non-free/images-including-firmware/10.3.0-live+nonfree/
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/unofficial/non-free/images-including-firmware/10.3.0+nonfree/

Here is a video of an actual installation. (For any portable device, I strongly recommend selecting full disk encryption in the installer.) I also recommend KDE for new users, since it has more GUI features than any other desktop environment.

https://www.youtube.com/watch?v=tyD_EKFCigM

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

4. Post install

4.1 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.

Snaps and Flatpaks are distro agnostic and can be used as a last resort, but are more taxing on system resources.

Code: Select all
# apt install snapd flatpak


Get Snaps here: https://snapcraft.io/
Get Flatpaks here: https://flathub.org/home


4.2 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.

If you are not running KDE, 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.3 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


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.4 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

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

For KDE:

Code: Select all
# apt install redshift plasma-applet-redshift-control


Then add the plasmoid/widget to tweak your settings. If you are new in KDE, watch this: https://www.youtube.com/watch?v=Tcfi6fivGys


Gnome:
Code: Select all
# apt install redshift gnome-shell-extension-redshift



4.6 Enable DRM to watch Netflix, etc.
Open Firefox. Then Open the menu (the three black bars) --> Settings. Scroll down select the Enable DRM checkbox.


4.7 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.8 Further KDE configuration:
Here are some nice tips and tricks: https://www.youtube.com/watch?v=nRtyFtpf5yU

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

KDE can be made to look like Unity: https://www.youtube.com/watch?v=Gd5y7m9q3yg
… like Gnome: https://www.youtube.com/watch?v=qS6KH3HCVpA

...like Windows 10: https://www.youtube.com/watch?v=C5SQ_yURJ8I

...and like Mac OS: https://www.youtube.com/watch?v=UYn4UYQ-nTo

4.9 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.10 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-cache search nameofpackage


Then
Code: Select all
# apt install nameof package


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.11 Install Steam
Read this: https://wiki.debian.org/Steam

4.12 Backing up your system
Any computer user has lost data, or has not lost data *yet*. Fortunately, creating a backup is very easy.

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.13 Basic maintenance
Security upgrades should be installed automatically if the package unattended-upgrades are installed.

Code: Select all
# apt install 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.14 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 Bullseye will be released some time in 2021, so be patient. ;) https://en.wikipedia.org/wiki/Debian_version_history#Debian_11_(Bullseye)


That’s it. I hope it was useful.

Thanks to you guys below! :)
Last edited by Hallvor on 2020-05-20 21:22, edited 9 times in total.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 1062
Joined: 2009-04-16 18:35
Location: Norway

Re: Howto: Installing and configuring Debian Buster

Postby sunrat » 2020-03-08 11:50

Some good tips there. I usually install non-free netinstall as you suggested, untick "Desktop environment" and install kde-plasma-desktop after install finishes and rebooting. The KDE task in the installer and also kde-standard and kde-full always install lots of applications I never use, and I prefer to just add as I need them.
I must try that neat TLP tip on my new secondhand Thinkpad Yoga 11e.
KDE Discover seems to work fairly well these days for upgrades and installing packages. It was a steaming pile of crap a few years ago with Plasma 5.8 but is good in 5.14.
But microsoft fonts, seriously? Yuck. Noto fonts are really nice and I use Noto Sans as my default everywhere. Haven't needed any font rendering tweaks for ages either. YMMV.
Also I consider containerised applications like Snap to be a virus in Linux. They go against the whole ideal of shared libraries and I can see them undermining development. I didn't like systemd or pulseaudio when they first appeared but appreciate them now as they work well. Doubt I will ever appreciate containerised applications and they don't deserve a place in an install guide for beginners.
But yeah, thanks for the helpful writeup. I made sure to put praises first and criticisms last. :wink:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3086
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Howto: Installing and configuring Debian Buster

Postby Head_on_a_Stick » 2020-03-08 17:36

Some observations:
Hallvor wrote:Here is a video of an actual installation.

Why not link to the official installation guide instead?

Hallvor wrote:install Microsoft and liberation fonts

The Liberation fonts are metrically identical to the M$ alternatives and are free (as in speech), installing both seems unnecessary.

And use this instead of ~/.config/fontconfig/fonts.conf:
Code: Select all
# dpkg-reconfigure fontconfig fontconfig-config

^ That has options for antialiasing and the hinting method, etc.

Hallvor wrote:TLP

Debian's laptop task for buster now includes powertop, which suggests laptop-mode-tools as a power-saving solution. That package conflicts with TLP so I don't think the latter is recommended any more.

Hallvor wrote: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.

It's easier to just use the "workstation" profile for nftables, which does the same thing with fewer packages and no silly GUI:
Code: Select all
# apt install nftables iptables-
# cp /usr/share/doc/nftables/examples/workstation.nft /etc/nftables.conf
# systemctl restart nftables

Hallvor wrote:
Code: Select all
# apt autoclean && apt autoremove

The autoremove command might remove wanted packages (or even the entire graphical desktop in some circumstances) and so should not be used indiscriminately. See also viewtopic.php?t=104157

Apart from that, nice guide. Thanks!
User avatar
Head_on_a_Stick
 
Posts: 12129
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Howto: Installing and configuring Debian Buster

Postby Hallvor » 2020-03-08 18:48

Sunrat: OK, no more Microsoft fonts. You convinced me. :) As for Snaps. I don't like them, I only accept them as a very last option.

Head_on_a_Stick: Thank you very much for your constructive feedback. I have incorporated your suggestions with changes or warnings.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 1062
Joined: 2009-04-16 18:35
Location: Norway

Re: Howto: Installing and configuring Debian Buster

Postby sunrat » 2020-03-08 21:22

Head_on_a_Stick wrote:
Hallvor wrote:TLP

Debian's laptop task for buster now includes powertop, which suggests laptop-mode-tools as a power-saving solution. That package conflicts with TLP so I don't think the latter is recommended any more.

I'm most interested in enabling battery charging thresholds which appears to be only supported by TLP and only for ThinkPads. The Yoga 11e has SSD so spindown times are unimportant. TLP does appear to have a lot of configuration options and appears to be actively developed.

@Hallvor, I didn't mean that MS fonts are awful, just unnecessary. And Redshift is marvelous; I always install it. :)
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3086
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Howto: Installing and configuring Debian Buster

Postby Hallvor » 2020-03-08 21:34

sunrat wrote:I'm most interested in enabling battery charging thresholds which appears to be only supported by TLP and only for ThinkPads. The Yoga 11e has SSD so spindown times are unimportant. TLP does appear to have a lot of configuration options and appears to be actively developed.


Laptop-mode-tools was my first choice, but would not play nicely with my ThinkPad. One of them has an internal battery in addition to the external removable one. Laptop-mode-tools would suddenly make the computer lose power and shut down (hard) once the first battery had run down, while TLP would work perfectly.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 1062
Joined: 2009-04-16 18:35
Location: Norway

Re: Howto: Installing and configuring Debian Buster

Postby sunrat » 2020-03-08 22:28

I just watched that install video you linked and wouldn't recommend it for beginners. It doesn't use DD mode in Rufus, only shows MBR install mode, no UEFI, and doesn't warn that Guided partitioning will wipe out Windows.

Another video popped up on YT straight after which is much better - https://www.youtube.com/watch?v=tyD_EKFCigM
For starters it recommends to try MX or Manjaro instead for total n00bs which is great advice. It mentions using the non-free iso which I would recommend for everyone unless they have a philosophical aversion to nonfree software, and also several options for writing the disk image in different OS. It also shows UEFI install which would be preferred for computers with UEFI.
There are several things in it I wouldn't recommend like using sudo but I guess that's easier for learners, and installing Xfce for which I'd recommend MX instead if you want that. Of course I always install DE, usually minimal KDE Plasma, post install anyway, but that's not so n00b-friendly either. Maybe I should make a video showing how to do that. :|

Also fonts-liberation is included in the DVD-1 install image.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3086
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Howto: Installing and configuring Debian Buster

Postby NFT5 » 2020-03-09 02:56

@Hallvor - good guide. If I can just add a couple of things from my experience...

KDE/Plasma is awesome and I use it on my two main desktops. But it is a bit heavy on resources for some notebooks, where I use MATE. It is also, IMHO, a better option where the machine is a production unit and others are the primary users - lets them concentrate on the task at hand rather than how the desktop looks.

The Liberation fonts don't include a substitute for Verdana and don't always substitute for MS fonts when receiving a document or email that was prepared in Windows. For this reason I install the mscore fonts.

If, when installing, you specify a root password your main user won't be given sudo privileges automatically. For many operations sudo is enough, i.e. root is not necessary. I specify a root password during the installation and then, once the new installation boots up:
Code: Select all
# su -
# adduser <username> sudo


While I agree with the powers of apt/aptitude/apt-get, a new user may find a GUI interface less challenging. My personal preference is Synaptic (which works across all desktops that I've tried) but the default search function is clumsy. So, first thing I install is apt-xapian-index. Install and logout/login or reboot, sometimes takes a couple of times.

Lots of other good suggestions by other posters too.
User avatar
NFT5
 
Posts: 391
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: Howto: Installing and configuring Debian Buster

Postby Hallvor » 2020-03-09 19:04

sunrat: Thanks for the video. You are right, it was better than the one I had included. Updated the link.

Yes, a video like that would be very nice. Go for it. :)

NFTS: There are pros and cons to every desktop environment. KDE can look daunting and unintuitive, for sure, but if you want to do anything out of the ordinary, there is a good chance you can use the GUI in KDE instead of diving straight into the CLI. That is not a bad thing for beginners, I think.

As for resource usage, I am typing this on a seven year old HP Elitebook, and KDE is blazing fast. Mind you, this is KDE 5.18.2, and not the one in the Debian repositories.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 1062
Joined: 2009-04-16 18:35
Location: Norway

Re: Howto: Installing and configuring Debian Buster

Postby sunrat » 2020-03-09 20:10

Hallvor wrote:...
NFTS: There are pros and cons to every desktop environment. KDE can look daunting and unintuitive, for sure, but if you want to do anything out of the ordinary, there is a good chance you can use the GUI in KDE instead of diving straight into the CLI. That is not a bad thing for beginners, I think.

As for resource usage, I am typing this on a seven year old HP Elitebook, and KDE is blazing fast. Mind you, this is KDE 5.18.2, and not the one in the Debian repositories.


I try a different DE occasionally but always end up back with KDE. Currently Plasma 5.17.5 in siduction, on my daily machine which started life in 2008 but had a few upgrades - Core2Duo E8500, 4GB RAM, 120GB SSD & spinny disks for data. It runs so nicely I'm not even tempted to use my 3 year old production machine except for production (audio).

I also have a notebook to which I just installed Buster/KDE, and it boots in ~450MB RAM which is even less than MX with Xfce! The KDE devs have done wonderful work in that regard.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!
User avatar
sunrat
 
Posts: 3086
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Howto: Installing and configuring Debian Buster

Postby NFT5 » 2020-03-09 22:21

Hallvor wrote:There are pros and cons to every desktop environment. KDE can look daunting and unintuitive, for sure, but if you want to do anything out of the ordinary, there is a good chance you can use the GUI in KDE instead of diving straight into the CLI. That is not a bad thing for beginners, I think.


Agree. But with great power comes great responsibility and sometimes people get into strife adjusting settings that they don't understand. I was also referring to machines used by employees and/or users that I want to just concentrate on the job, rather than spend time on the interface. Even MATE gives a user more control than they're used to in Windows and is, IMHO, a good way to get used to Debian without too many distractions.
User avatar
NFT5
 
Posts: 391
Joined: 2014-10-10 11:38
Location: Canberra, Australia

Re: Howto: Installing and configuring Debian Buster

Postby Hallvor » 2020-03-10 06:27

sunrat wrote:I also have a notebook to which I just installed Buster/KDE, and it boots in ~450MB RAM which is even less than MX with Xfce! The KDE devs have done wonderful work in that regard.


Yes, they do know how to optimize a system.

NFTS wrote:But with great power comes great responsibility and sometimes people get into strife adjusting settings that they don't understand.


That may have been a bigger problem in the past. The KDE desktop is all plasmoids, and back in the day you could for instance remove the bottom panel without warning, and getting it back the way it was, was no easy task. These days, you can press a button if you have made a disaster to regret your action. It makes everything less risky even if you don't know what you are doing. A second exmaple: If you make some weird settings in Systemsettings and don't remember the default, you can press a "Standard" button to get back to default settings. Recovering from misconfigurations is no problem these days.

Designing a desktop environment is always about tradeoffs. Simplicity is fine, but not when it doesn't let you do what you want. Complexity in a desktop environment will let you do more, but is, well, more complex. :)
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 1062
Joined: 2009-04-16 18:35
Location: Norway

Re: Howto: Installing and configuring Debian Buster

Postby Hallvor » 2020-03-19 09:56

Thanks for the tip. It was very detailed indeed.

Debian-multimedia gave me dependency issues. Haven't used it ever since.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 1062
Joined: 2009-04-16 18:35
Location: Norway

Re: Howto: Installing and configuring Debian Buster

Postby Head_on_a_Stick » 2020-03-19 16:44

john123son wrote:Apparently, the advice to add deb-multimedia to your sources list /etc/apt/sources.list is debated, but I haven't yet heard exactly the reason that this is not recommended.

Search these forums, we've had *many* problem threads caused by adding those sources.

That repository is also discouraged on Debian wiki:
DebianMultimedia FAQ wrote:A recent upgrade of ffmpeg/libav-related library packages (e.g. libavcodec) has broken related software (e.g. Totem, MPlayer, VLC, Xine)

This is probably caused by unofficial packages from third-party repositories, e.g. 'deb-multimedia.org' (formerly 'debian-multimedia.org'). These packages are known to not integrate well with other software packages in Debian and cause breakage regularly.

It is highly recommended to remove these unofficial packages from your system and replace them with the official ones provided by Debian instead.

https://wiki.debian.org/DebianMultimedi ... 2C_Xine.29
User avatar
Head_on_a_Stick
 
Posts: 12129
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Howto: Installing and configuring Debian Buster

Postby Bulkley » 2020-03-19 17:11

Many years ago I tried using deb-multimedia. It worked . . . for a while. I made the mistake of leaving the repository open and things went awry. It looked to me that deb-multimedia packages were out of sync with Stable, as if they were jumping the curve to be ahead of Debian. They simply didn't mesh properly.

If you choose to use deb-multimedia packages only install one at a time and test it thoroughly. Don't let it install other packages and don't leave the repository open. Personally, I learned my lesson and don't use it.
Bulkley
 
Posts: 5942
Joined: 2006-02-11 18:35

Next

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable