Image108.System administration

8.1.The software sources

360Debian GNU/Linux uses the repository methodology to distribute applications. This methodology allows the software centralization and the usage of simple interfaces to administrate and upgrade your system: you have no need to visit the software sites themselves.

8.1.1.The sources.list file

The Internet addresses of the Debian repositories are stored in the /etc/apt/ sources.list and the files of the type /etc/apt/ sources.list .d/xxx.list .

The default ' sources.list ' file on Debian 8.5

Details concerning the various information found in the 'sources.list' file (the lines beginning with a "#" are just comments):


362 … why "jessie" and not "stable" since the system is based on Debian Stable ??

" jessie " is the precise version name of the installed system. It sets a given version of each packages included in the "jessie" repository (the version of the generic kernel, for example).
stable " is the generic name of the currently stable.
For the time being, "jessie" is the "stable" version, thus you could used either designation. But when the Debian "stable" version becomes "stretch", then "jessie" will change to "oldstable".
Using the precise name of your version allows you to control
if and when you want to upgrade your system to the next version, as opposed to some systems which want to impose their upgrades 363
For more detailed information, I invite you to visit the dedicated Debian wiki page

8.1.2.About repositories, branches and sections/components

Debian organizes its software within repositories . These repositories are divided into branches and sections/components. To learn more about the "testing" and "unstable" branch read the chapter 8.8 . One word, however, about the sections/components in the repositories .

There are 3 sections in the official Debian repositories:


component selection criteria for the packages


complies to the DFSG* without any "non-free" dependency


complies to the DFSG* with some "non-free" dependencies


does not comply to the DFSG*

* DFSG stands for D ebian F ree S oftware G uidelines 102

Only the packages within the main section/component are officially supported by the Debian project and are 100% free software . Rather, those proposed in contrib and non-free are partially or totally non-free.

Having said that, and depending on your type of hardware, it is very possible that some services do not function correctly without using specific (proprietary) drivers. In that case, you need to modify the /etc/apt/sources.list file (details in the following chapter)

More details about the Debian versions in the Debian Wiki: .

8.1.3.Modifying the Repositories

Before you start modifying the software sources of your system, you must be conscious of the risks your are taking by using the "contrib" or "non-free" components of the archived branch.

Now, that you are warned that the non-free people kill the pink rabbits, let's move on:

To modify your software sources, it is enough to edit the ' sources.list ' file. Open a terminal in terminal mode ( see chap.3.8.3 ), and enter:

apt edit-sources

This command opens the appropriated file with the default text editor (nano or vim). Once you are done with your modifications, save the file ("[Ctrl]+x" with nano, or ":wq" with vim).

Example of line entry for the free packages :

deb stable main

Example of line entry for the free packages and the proprietary packages :

deb stable main contrib non-free

Now you can help yourself in the 3 package sections and install the non-free codecs and drivers.

Note also that you can modify your software sources by using the graphical Synaptic package manager (see chap 8.3). the nearest repositories with httpredir

In order to obtain the software it needs, your system grab the packages on a Debian archive mirror, that is a server hosting a clone of the original Debian repositories.
During the installation process, we alreaday configured your mirror address, but it may happen that this mirror became unreachable fore some technical reasons, preventing you install or update your software. To avoid this situation, use "httpredir" 364.

httpredir 103 is a service which aims to solve the problem of choosing a Debian mirror. It uses the geographic and network location of the user and the mirrors, the architecture of the requested files, IP address family, the availability and freshness of the mirrors, and a few other things. The result: it selects the best mirror for your needs( )).

Installing in the sources

In order to utilize the httpredir functionality, it is enough to replace your currently configured Debian mirror in sources.list by "httpredir", except for the "security" repositories !

To edit your software sources, using a terminal in administrator mode ( see chap.3.8.3 ):

apt edit-sources

Then modify the sources.list file as follows: Do not modify the "security" lines !

deb jessie main
deb-src jessie main
deb jessie/updates main
deb-src jessie/updates main
deb jessie-updates main
deb-src jessie-updates main

Save by typing [Ctrl]+x in the Nano text editor, followed by "Y" (for "yes")

Reload your repositories and execute an control update:

apt update && apt upgrade

That's it; your system is now configured to fetch its software information from the repositories hosted by the nearest available mirror. external sources: Firefox and the Mozilla repositories

To benefit from more recent versions or from applications not distributed by Debian, you can add external repositories to your software sources, providing they remain compatible with your current Debian version.

By default, Debian includes the ESR (Extended Support Release) version of Firefox, stable but fixed version distributed by the Mozilla foundation.

As an example, find below how to proceed in order to get the Firefox latest version . This procedure request to use a terminal . Each command is detailed below.

  1. Close your firefox-esr if it is currently open. If you are reading this page on-line, copy these instructions and paste them into a text file 365.

  2. Open a terminal in administrator mode, using the application list or menu > system > Administrator Terminal ( see chap.3.8.4 ).

  3. Add the Mozilla foundation repository address in a specific file (/etc/apt/sources.list.d/mozilla.list) with this command:

    echo "deb jessie-backports firefox-release" > /etc/apt/sources.list.d/mozilla.list

    (here the ">" sign tells the system to copy the text between quotes in the file coming next after).

  4. Update the available package list, always in the administrator terminal:

    apt-get update

    A message tells you that a public key is missing in the given repositories. This is solved with the next point.

  5. Add the authentication key of the Mozilla repositories in your trusted keyring:

    apt-get install --allow-unauthenticated pkg-mozilla-archive-keyring

  6. Refresh the package list taking care of the new key:

    apt-get update

  7. Remove the obsolete version of Firefox, and install the latest one:

    apt-get remove firefox-esr* && apt-get install firefox

    A confirmation is requested.

That's it. Next time you launch Firefox, you will retrieve all tour bookmarks, and your preferences, but with a more recent navigator, which will remain up-to-date thanks to the Mozilla repositories 366.


8.2.APT in a terminal

367 The following sections present the graphical interface of the APT ( A dvanced P ackage T ool) program. This application is also available directly from the command line , allowing a better fine tuning of your system.

This section presents the basic APT commands to manage the Debian packages from a terminal.

Debian supports also "aptitude", another package manager, with a different syntax and behavior. This manual being intended for beginners, no need to explicit these commands here: to learn more about them, visit the dedicated Debian Aptitude Wiki104.

8.2.1.'User' command to search and display information

These commands can be executed as simple user, because they do not impact your system.



apt show xyz

display information about the package " xyz "

apt search <regular expression>

look for packages corresponding to the <regular expression>

apt-cache policy xyz

display the available version of " xyz "

Terminal : looking for "pacman" with apt

8.2.2.'Administrator' mode commands for system maintenance

These commands must be executed with the "root" administrator rights , because they impact the system. To move into the administrator mode from a terminal , type " su - ": the administrator password is requested.



apt update

Update the repositories metadata.

apt install xyz

Install the xyz package and its dependencies

apt upgrade

Secured update of the installed packages.

apt dist-upgrade

Update of the installed packet, by adding/removing other packages if necessary

apt remove xyz

Remove the package xyz, but leave the configuratrion files.

apt-get autoremove

Automatically remove the packages which are no longer necesssary.

apt purge toto

Purge the package xyz as well as its configuration files.

apt-get clean

Clean the local cache of the installed package.

apt-get autoclean

Clean the local cache of the obsolete packages.

apt-mark showmanual

Mark a package as being manually-installed.

For more detailed information and the apt/aptitude equivalence, visit the dedicated page105 of the Debian manual.

All-in-One command line (in administrator mode) to update the repositories information + update your system + clean the packages in cache:

apt update && apt dist-upgrade && apt-get autoclean

Which goes to show that managing your system with a terminal is not that complex 369.

Apt vs Apt-get

The Apt program is currently going through some streamlining and offers now a simplified syntax for its commands and options. Thus, you will find both syntax ( apt and/or apt-get ) in this manual as well as in most of the GNU/Linux documentations.

8.2.3.Backport packages

Debian offers also some special repositories called backport s , which contain more recent versions of some applications. These repositories are not activated by default, but do not present any particular risks for your system: the "regular" repositories have the highest priority during the update process , only the applications installed from the backport s will look into these specific repositories .


370 … what do you mean exactly by " backport s" ?

Nothing to do, in fact, with the "backdoors" used to spy on your machine running proprietary systems 371
backport is a mechanism allowing an application currently hold in the Debian development repositories , to be ported back to the "stable" version.
For example, the Debian developers take in the development
repositories the most recent version of Libre Office , and re-compile (re-build) the package holding the application, while taking care of all the dependencies existing in the "stable" version.

Example: install a newer version of LibreOffice

To take advantage of the "back-ported packages", you need to activate the backport s repositories , and then indicate to the Apt package manager which applications will be taken from these backport s.
This procedure requires a
terminal usage, and each command is detailed hereafter.

  1. Open a terminal in administrator mode from the application list or menu > system > Administrator Terminal ( see chap.3.8.4 ).

  2. Add the "backports" repositories to the list of active repositories (listed in the /etc/apt/sources.list file):

    echo "deb jessie-backports main" >> /etc/apt/sources.list

    The "»" sign tells the system to add the text between quotes into the file specified just after it.

  3. Reload the repositories metadata, always from the terminal in administrator mode:

    apt-get update

  4. Update LibreOffice from the new repositories:

    apt-get install -t jessie-backports libreoffice libreoffice-gtk

    A confirmation will be asked, with the list of the pending changes.

That's it, you can enjoy the new version of LibreOffice 372.

373These repositories are not specific to LibreOffice, and numerous other applications can also benefit from newer versions.
For more information on the backports, you can consult the Debian Backports Wiki106.
If you are looking for specific application, you have two solutions: use the search package tool107 or the search by category108.

8.3.Synaptic: the comprehensive package manager

374 Synaptic 109 is the comprehensive graphical interface of the Debian package manager . It allows a total vision of the proposed packages, whether installed or not. It is a lot more detailed than the Software Center, or Apper (see the following chapters) since it displays the full set of available packages (including the libraries).

8.3.1.Main interface

The Synaptic windows is divided in 4 areas: the tool bar at the top, the left pane allowing different ways of sorting and selecting the packages, the center pane displaying the package list itself, and below the pane hosting the description of the currently selected package (the selection is done with a click).

In front of each package, you notice a little box (white for non-installed packages, green when they are installed, red when they are broken). Next to this status box, a Debian logo indicates that this package is "free" (as in freedom).

Synaptic: the default interface of the package manager

The very first thing to do when you launch Synaptic, is to click on the "Reload" button in order to update all the information (metadata) concerning the repositories , the packages and the available applications.


Don't hesitate to click on all the menus to explore Synaptic and become more familiar with it. It is a good way to discover its numerous functionalities.

Don't be afraid to break your system since nothing will really happen until you click on the "Apply" button. On top of that, a message asking for confirmation will always be displayed first.

8.3.2.Managing the repositories

The repositories allow to update and install additional packages.

Open the Synaptic package manager (menu System > Synaptic package manager). In the top menu bar, click on "Settings, then "Repositories":

Synaptic: managing repositories

You'll notice that the list corresponds to the contents of the /etc/apt/sources.list file mentioned in chapter 8.1.1.

Now, you can modify your repository sources at your entire convenience. Simply click on a source to modify it, or on the "New" button to add a new source.

Once your modifications are validated, the application will invite you to reload the repositories list in order to take your changes into account.

8.3.3.Updating the system

Before updating the system, it is necessary to "Reload" the package list, by clicking on the corresponding button, or by going in the menu "Edit > Reload Packages Information" (or even [Ctrl]+r if you want to use a keyboard shortkey). This action checks if the version of the packages residing on your system is the most recent or not.


Then click on "Mark All Upgrades" or menu "Edit > Mark All Upgrades…".


A new window appears with the list of the packages to be upgraded as well as the additional dependencies, if some are required:


You only have to click on the "Apply" button, and accept the requested confirmation:



The system updating process begins with the package downloading, and continues with their installation. A message informs you that all the changes were applied.



8.3.4.Searching for a software

If you don't know the name of the package you need, you can parse the list using the filtering by sections, status, origin, etc …

By example, if you are looking for a game, click on Sections in the bottom part of the left pane, scroll down to the "Games and Amusement" section, click on it, and the packages concerning games and amusement are listed in the center pane.

If you know the name of the package or if you are looking precisely for something, click on the search button (in the top bar) and enter the keywords of your search in the window which opens.

Other "Custom Filters" are available. Click on the button to explore them. at a package detailed information

By clicking on a package, its description is displayed on the bottom center pane of Synaptic. To obtain even more information on a package, right-click on it, and select Properties, or go to menu "Packages > Properties".

Then you will know everything - positively absolutely everything - on this package ; dependencies, installed files, size and version.

8.3.5.Installing / uninstalling softwares a package

To install one or several packages, right-click on the little box in front of the package name, and select the "Mark for Installation" option.

Synaptic: marking a package for installation

If, in order to be functional, this package requires the installation of other packages (the famous dependencies) they are automatically added to the selection.

Then, you simply need to click on the "Apply" button, and confirm the summary of the changes to be applied.

Synaptic: summary of the pending changes

Synaptic: changes being applied

Synaptic: installation of pacman a package

Like for the installation, right-click on the little box in front of the package name, and select the "Mark for Removal" option. Then click on "Apply".

The simple removal keep the package configuration files on your system, in case you would like to re-install it, later on.

To remove also the configuration files select the "Mark for Complete Removal" option (equivalent to the "purge" in a terminal command line ) a package

Sometimes we want to re-install a package which is already installed. In that case select the "Mark for Reinstallation" option. This allows, for example, to update the flashplayer plugin within the Firefox navigator: flashplugin-nonfree . useless packages

Often, when software is uninstalled, some packages (the dependencies) remain in the system while no longer useful, since all the packages needing them are gone. These useless packages can be easily removed with Synaptic.

When Synaptic is launched, click on the "Status" button at the bottom of the left pane. If the "Installed (Auto removable)" category shows up, click on it to display the corresponding package(s) (see image below):

Synaptic: auto removable packages

All you have to do next is a right-click on each package in the center pane, and select the "Mark for Complete Removal" option. Once all the packages are marked, click on the "Apply" button.
(sources: ) configuration residues

Although one choose to completely remove a software, some configuration residues might still remain in the system, bur they can be removed with Synaptic.

Click on the "Status" button at the bottom of the left pane. If the category "Not installed (residual config)" shows up, select it (see image below):

Synaptic: removing configuration residues

All you have to do next is a right-click on each package in the center pane, and select the "Mark for Complete Removal" option. Once all the packages are marked, click on the "Apply" button.
(sources: )

8.3.6.Synaptic preferences

"Preferences" is a well-named category, existing in most applications, and which is also present here …
But keep in mind that Synaptic is a very special case : it manages the full set of software installed on your system. When you remove a program, it does not go in the wastebasket (where you could have potentially retrieved it) !

After these scary warnings, let's move to the settings available for Synaptic. the Preferences window (launched via menu Settings > Preferences) displays 6 different tabs:

Synaptic: Preferences window

General : the options in there are rather explicit. Note: it is possible to un-tick the option "Consider recommended packages as dependencies", if that helps you keeping an ultra-light system. But this could induce problems when installing future new packages. Thus an option to be handled carefully.

Remember : by using a terminal (chap.8.2) you can achieve the same results more quickly and with less manipulations.

8.4.Apper: the KDE package manager

393 KDE does not use the Synaptic package manager presented in the previous chapter. You could install it though, but you dont need it because Apper is there to help you manage your applications.

To launch it, go to KDE KickOff button > Applications > System > Software Management


Apper: default software management interface on KDE

8.4.1.Updating applications with Apper

To maintain a stable and secure system, you need to update the software … Yes we told you that already … but this is very true !

Anyway, to check the changes in the repositories, and retrieve the software updates, click on the "Updates" button, then click on "Check for new Updates". Then you just need to select all the package updates by ticking the top box:


Apper: update manager on KDE

Then left-click on the "Apply" button at the bottom of the window to execute the modifications.


And a message informs you when the process is complete.


8.4.2.Install or remove software with Apper

To install software with Aper you can either:

Apper: looking for software

Apper: marking software for install

Once you are done with the selection, click on the "Apply" button at the bottom right of the window, and the software will then be installed. The administrator password is required.

To remove software with Apper, click on the "Installed software button" then navigate to your application. When you hover the mouse pointer over it, the Remove option is proposed: click to accept !

Apper: marking software for removal

Like for the installation, you then click on "Apply". A confirmation window opens (because on GNU/Linux one keeps you fully informed):

Apper: list of the pending changes

Apper: list of the additional requested dependencies

You can watch the various downloading, installing and/or removing steps directly on the main Apper window.

8.5.Packages: the simplified installation interface

405The majority of the Debian GNU/Linux desktops uses the "Packages" program to manage the software packages. The simplified Gnome Software Center allows you to execute on your system all the package administration tasks.

To launch it, click on the Gnome "Activities" button then enter the beginning of the application name in the search field:

Packages: launching from the Gnome -Shell

To launch it from the classic menus (Xfce, LXDE, Mate Cinnamon), open the application menu > "System" category > "Packages" application.

8.5.1.Install or remove software with the "Packages" application

The "Packages" simplified interface allows you to look for an application by name (using the serach bar at the top left pf the winfow), or by category. When you select an application, either it is installed and "Packages" propose you to remove it, or, in the opposite casse, propose to install it … it's that easy:

Packages: install or remove an application

Like for all the administrative tools, the "root" passsword is requested, and a confirmation message will require your acceptance.

Gnome -Shell : administrator password request

Packages also allows you to display additional information concerning the software included in the Debian repositories , to access its main page or to list the additional software needed to install it (the dependencies).

8.5.2.System updates with "Packages"

"Packages" allows you also to check for and apply system updates. To do this, you go in the "Packages" menu > "Check for Updates" (here with Gnome-Shell):

Packages: updating the system

Note that you can also check for updates from the main menu > System > " Software Updater".

8.6.Cleaning the system

410 Even if the capacity of hard disks increased dramatically during the last years, you might need some free space. Several script s automate the disk cleaning process, however I prefer to check before using the rm command (standing for r e m ove. see chap.11.2 ) 411 .

8.6.1.Disk space information

The first thing to do, of course, is to find out the used space on your disk. Several tools are available to you:

Ncdu launched in the user personal folder

Xdiskusage in action

Baobab: disk space analyzer on Gnome

8.6.2.Cleaning the packages

Apt /aptitude/dpkg are the usual Debian package manager s. When you install a package its archive-source/deb file is stored in your system (in the /var/cache/apt/archives/ folder) to enable a potential re-installation without Internet connection. To clean the "apt cache" use a simple command in administrator mode ( see chap.3.8.3 ):

apt-get clean

Once the cache of the installed packages is cleaned, you can also remove the useless packages from your system, as well as the configuration files. Warning ! Remember to check carefully the list of the packages planed for removal, before accepting the operation:

apt-get autoremove --purge

8.6.3.Cleaning locales

The Debian packages are installed with the complete set of available languages. But usually only one or two are really needed. To clean up the useless language translations of your system, as well as the configuration files, we suggest you install the localepurge package in administrator mode ( see chap.3.8.3 ):

apt install localepurge

During its installation, localepurge gives you information on how it functions, and ask you to select the languages you want to keep, using an interface of type "dialog".

Localepurge: installation message

You can navigate in the installed language list with the keyboard direction arrows, and then select the languages you want to retain using the space bar.

Localepurge: selecting the languages to retain

Once the selection of the language(s) is complete, press on the [Tab] key to jump the "<Ok>" button and validate your list. Then the terminal display comes back:

Localepurge: installation

During each package installation, localepurge will run automatically in order to clean the useless locales/man/doc.

8.6.4.Emptying the trash bins

Three different bins must be taken into account:

8.6.5.Purging application caches

Some applications use a "cache" folder, where they store images, videos, and miscellaneous information in order to run faster. Usually these data do not occupy too much disk space, however if (using the tools described above) you detect that a folder becomes too fat, don't hesitate to remove it.

Each application has its own way to manage its own cache: some purge it systematically when they close, others store their data in the /temp folder, which will be cleared during the session logout, others keep all their information in a specific folder.

For Firefox, as an example , you can purge the cache from the preferences menu, and even automate this action every time the application is closed.

8.6.6.Purging the thumbnails

Every time you open a folder containing pictures or videos, thumbnails are created to represent these graphic files. These thumbnails are stored in a specific folder to reuse them, rather than being forced to recompute them, every time you access this kind of file.
The problem raised when you delete a graphic file, because its thumbnail is kept in the system, and this leads to a certain amount of disk space used to store obsolete thumbnails 418.
To purge them, it is enough to remove their corresponding folder:

rm -Rf ~/.thumbnails

This folder will be created again, the next time the system needs to store a newly generated thumbnail.

8.7.Installing external ".deb" packages

Debian GNU/Linux uses the package repository system to better manage the software and increase the security of your system. But it may happen that you need an external package of the ".deb" format

419 … but who is this "deb" ??

deb is the short for "debian", the mother company 420 . To distribute its software , Debian uses a specific archive file format: ".deb". It is a compressed format, like the ".zip" that you use to save your data. These ".deb" archives are recognized by the different Debian package manager s (APT and its graphical interface Synaptic) and thus can be handled more easily.

8.7.1.Installation in graphic mode with gdebi

gdebi is a graphical utility with allows the installation of external packages of the ".deb" format, while managing the dependencies.

To install it, look for "gdebi" in your favorite package manager (Synaptic, Apper, Packages) or more simply from a terminal in administrator mode (using " su " see chap.3.8.3 ):

apt update && apt install gdebi

When you download a Debian external package, right-click on it and select "Open with gdebi".

8.7.2.Installation in terminal mode with Dpkg

Dpkg is a software utility handling the packages like apt, but it does not manage the dependencies. This means that if you use dpkg to install external packages, you need to install the "dependent" packages one by one from your terminal. Dpkg is integrated in Debian by default, and must be used in administrative mode.

To install an external package:

dpkg -i package_address.deb

An error message will let you know if some dependencies are missing, an error message will let you know, and then simply install them the classic way with apt:

apt install dependent_package_1  dependent_package_2   ...

Then relaunch the installation of your external package:

dpkg -i package_address.deb

To remove an external package

dpkg --purge name_of_the_software

8.8.Who is this Sid guy?

First of all, one must know that several Debian distribution branches exist in parallel.

Namely the oldstable , stable , testing and unstable distributions, as well as an experimental branch.

The Stable distribution is the Debian official distribution, the one released at this moment, with is maintained and updated par the Debian teams. The only changes made concern the security updates and the bug fixes. It is recommended to favor this Version.

The Oldstable distribution is the previous stable version. It is usually supported by the Debian teams during one year after the release of the new stable version. Then it might live longer if enough individuals or companies continue to assure its maintenance. Then it is called a LTS (standing for Long Term Support) distribution: we extend its life span.

The Testing distribution is the future Stable version. It is used to prepared the next stable version. When everything is OK, when all the bit and pieces are functioning well together, when all the features targeted by the Debian teams are included, and after a period of software freeze and bug hunting, then the Testing version becomes the official new Stable distribution.

The *Unstable distribution , nicknamed Sid is the version which receives all the new packages versions, and sits at the cutting edge of innovation, but is not very stable: it's a research lab. Nevertheless some brave adventurers use it on a daily basis.

The Experimental distribution is not a Debian distribution per se , but rather a repository where alpha or beta software versions are tested.

All these distributions are given a name picked among the characters of the Toy Story ® cartoon. Currently, the name of the stable version is Jessy , the name of the testing version is Stretch , the name of the oldstable version is Wheezy , the Experimental as no nickname.

421 The name of unstable is Sid , but who is this Sid guy ?
Sid is the little boy, in the Toy story® cartoon, who breaks all his toys
110 .

More detailed information on the dedicated Debian Wiki111.