SSH - Apt-get command: Installing and uninstalling packages

Procédure

Apt-get SSH command: easy package installation and uninstallation

Apt-get is a command-line software tool. It allows you to easily install and uninstall packages from an apt repository.

Using the ssh apt-get command

  • Installing
apt-get install 

The install option passed to apt-getinstalls the packages indicated. This command can also be used to update a specific package.

  • Force Install
apt-get -f install

When an installation fails for various reasons, you can force the installation by installing the dependencies!

  • Find a package
apt-cache search 

The search option passed to apt-cache allows you to search for packages containing certain words. The answers depend on your repositories.

  • Obtaining source code
apt-get source 

The source option passed to apt-get allows you to download the source code packages indicated.

  • Removing
apt-get remove 

The remove option is used to uninstall the indicated packages. However, this leaves the configuration files for these packages in place.

  • Remove + purge
apt-get remove --purge 

The -purge option, passed to the remove command, removes the indicated packages and their configuration files.

  • Removing installation packages

APT keeps a copy of each installed and uninstalled package on your hard disk. Using the options below allows you to recover disk space by cleaning the corresponding option.

sapt-get clean

The radical clean option deletes copies of installed packages(note that this has no impact on installed packages).

apt-get autoclean

The autoclean option removes copies of uninstalled packages. This allows you to recover a lot of disk space.

  • Update repositories
apt-get update

The update option updates the list of files available in the APT repositories in the /etc/apt/sources.list configuration file. Running it regularly is good practice, to keep your list of available packages up to date.

  • Updating packages
apt-get upgrade

The upgrade option updates all installed packages to the latest versions.

apt-get dist-upgrade

The dist-upgrade option updates all installed packages to the latest versions, installing new packages if necessary, as opposed to the simple upgrade which does not add new packages.


Error: GPG error

If you get an error like this:

GPG error: http://ftp.fr.debian.org etch Release: The following signatures could not be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B


1. Copy the last 8 letters of the key:

55BE302B


2. Run the command :

gpg --keyserver pgpkeys.mit.edu --recv-key 55BE302B [enter]


3. Run the command :

gpg -a --export 55BE302B | apt-key add - [enter]


4. Update the software database:

apt-get update [enter]

help.lws.net/a/440
Was this article helpful?

Yes

No

Read 46 419 times

Thank you! Feel free to ask questions about our documentation if you would like more information, and help us improve it.

Similar articles

A question about this article?

Ask the LWS team and the community. Answers are published after moderation.

Ask the LWS team and its community a question

RGPD : Responsable LWS-Ligne Web Services. Finalité : modération et publication publique de votre question, notification éventuelle d'une réponse. Base légale : consentement (art. 6.1.a RGPD). Conservation des emails : 90 jours après notification, 12 mois maximum sans réponse. Vous pouvez exercer vos droits via notre nos CGV - section RGPD.