Knowledge base dedicated to Linux and applied mathematics.
All the versions of this article: <English> <français>
In this tutorial, we shall see how to install software packages under Debian and Ubuntu. In the program, we shall have a look at already-installed packages, search packages, information related to software packages, how to update packages and the software list.
To visualize the list of installed packages, we use the following command
~# dpkg-query -W
To visualize an installed package whose name is scilab for example, we use the previous command and a redirection (or pipeline) to the ’grep’ command. Practically, we have:
~# dpkg-query -W | grep -i scilab
The description of the set of installed packages is obtained via the command
~# dpkg -l
The list of available packages is obtained as follows:
~# apt-cache pkgnames
We clearly see that the list is not in alphabetical order. To resolve this issue, we redirect and sort the output:
~# apt-cache pkgnames | sort
To search a software package, we proceed as follows:
~# apt-cache search flashplayer
flashplayer-mozilla - Macromedia Flash Player
This command displays software packages containing the expression
To display information related to a package, for instance the
flashplayer-mozilla package, we proceed as follows:
~# apt-cache show flashplayer-mozilla
Maintainer: Christian Marillat <email@example.com>
Depends: libc6 (>= 2.4-1), libx11-6, libxext6, libxt6, zlib1g (>= 1:1.2.1), mozilla-browser | www-browser
Description: Macromedia Flash Player
The Flash Player lets you experience animation and entertainment in your
Mozilla web browser.
Note that the exact name of the package should be entered ! For example,
~# apt-cache show flash
W: the package flash could not be found
E: No package has been found
does not yield any result since flash is not he name of a package.
Assume we want to install firefox. We type:
~# apt-get install firefox
To uninstall a package, we can proceed in two ways. Either 1) we uninstall only the software or 2) the software and its configuration files. In the first case, assuming we want to uninstall the mplayer software, we type:
~# apt-get remove mplayer
In the second case, if we want to uninstall both ’mplayer’ and its configuration files, we type:
~# apt-get remove --purge mplayer
Updating a list of software is not the same as updating the software per se. Only the list is actually updated:
~# apt-get update
The upgrade command installs the most recent versions of all packages on the system.
~# apt-get upgrade
To simulate an update installation, i.e. to see which software will be updated, we type:
~# apt-get -s upgrade
The dist-upgrade command has the same effect as the ’upgrade’ except that a smart management is used in changes of dependencies in new versions: conflict resolution and discarding less important packages for more important ones, for example.
~# apt-get dist-upgrade