Size: 4040
Comment: cleanup "Using a graphical program" section
|
Size: 3905
Comment: simplify installing/reinstalling/removing/upgrading package sections
|
Deletions are marked like this. | Additions are marked like this. |
Line 38: | Line 38: |
== Installing Packages == | == Installing, removing and upgrading packages == |
Line 40: | Line 40: |
Open a root console {{{ # aptitude install <package> }}} where <package> is the name of the package (application) you want to install. |
There are many command-line tools dedicated to package management in Debian. Such programs include [[aptitude|Aptitude]], [[apt-get|Apt-get]] or {{{apt}}}. This example uses {{{apt}}} but other packages managers use identical commands. |
Line 46: | Line 42: |
== Reinstalling == | Replace {{{<package>}}} with the name of the package you want to act on. |
Line 48: | Line 44: |
To reinstall a package type in a terminal: {{{ aptitude reinstall <package> }}} To reinstall with all dependencies, type: {{{ # aptitude reinstall <package> $(apt-cache depends --recurse --installed <package> ||grep '[ ]') }}} == Removing a Package == {{{ # aptitude remove <package> }}} where <package> is the name of the package (application) you want to remove. To also delete files and directories created by the package after installation, such as configuration or status ('''Warning''': this may include files modified by the user), use: {{{ # aptitude purge <package> }}} == Updating a Package == Open a root console {{{ # aptitude upgrade <package> }}} where <package> is the name of the package (application) you want to update. |
* Installing a package: {{{apt install <package>}}} * Reinstalling a package: {{{apt reinstall <package>}}} * Reinstall a package and all dependencies {{{apt reinstall <package> $(apt-cache depends --recurse --installed <package> ||grep '[ ]')}}} * Removing a package: {{{apt remove <package>}}} * Removing a package and all its configuration and data files ('''Caution'''): {{{apt purge <package>}}} * Upgrading a Package: {{{apt upgrade <package>}}} |
Translation(s): English - Français - Italiano - ?Nederlands - 한국어(Korean)
This page describes how to use various CLI (command line interface) Apt tools.
Contents
Configuring Apt Sources
Apt downloads packages and installs them onto your computer. To do that it connects to software repositories, or sources, which contain all the packages you'd want. You can configure Apt to use a source (or multiple sources) to get these packages from. There are many sources - web (HTTP) servers, FTP servers, CD-ROM disks, network servers (etc). Generally users download packages from the internet, since most users don't download all 3 DVDs (for the current Debian Stretch release).
Editing sources directly
You can edit the file which determines your sources directly:
As root:
# nano /etc/apt/sources.list
or
# gedit /etc/apt/sources.list
You should read the manual for this configuration file first here or by typing man sources.list at a console window. You could also read the sources.list wiki page.
A root console (in GNOME) can most likely be found at Applications > System Tools > Root Terminal. You can also use sudo to edit these files from a console running as normal user account.
Using a graphical program
Some programs allow configuring Apt sources through a graphical interface. For example:
Applications menu > Settings > Software and updates (software-properties-gtk package)
Installing, removing and upgrading packages
There are many command-line tools dedicated to package management in Debian. Such programs include Aptitude, Apt-get or apt. This example uses apt but other packages managers use identical commands.
Replace <package> with the name of the package you want to act on.
Installing a package: apt install <package>
Reinstalling a package: apt reinstall <package>
Reinstall a package and all dependencies apt reinstall <package> $(apt-cache depends --recurse --installed <package> ||grep '[ ]')
Removing a package: apt remove <package>
Removing a package and all its configuration and data files (Caution): apt purge <package>
Upgrading a Package: apt upgrade <package>
Keeping your system up-to-date
Open a root console
# aptitude update # aptitude upgrade
This does all the "noninterfering" package upgrades.
# aptitude dist-upgrade
This does package upgrades that require installing or removing some other package. Check the packages to be REMOVED: Any package lib<foo> is fine. If it's removing something you use, and there is nothing obviously replacing it (e.g. emacs20 replaced by emacs21), you may want to make yourself a note so you can reinstall it later (when a compatible package is available), or "pin" that package (see "man apt_preferences") before doing the "dist-upgrade".
Search for packages
Open a console
$ apt-cache search <string>
where <string> is a list of keywords to search for.
You may want to pipe the output (redirect the output) into "less" (a scrollable viewer) since the list may be huge:
$ apt-cache search <string> | less
List installed packages
Open a console
$ dpkg --list
Further Reading
AptTools - Further Apt Tools
Synaptic - Graphical Apt System
Aptitude - Powerful ncurses-based Apt System
SecureApt - Cryptographic signatures
?CategoryQuickPackageManagement | CategoryPackageManagement