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]

Rate this article :

5/5 | 1 opinion

This article was useful to you ?

Article utileYes

Article non utileNo

Vous souhaitez nous laisser un commentaire concernant cet article ?

Si cela concerne une erreur dans la documentation ou un manque d'informations, n'hésitez pas à nous en faire part depuis le formulaire.

Pour toute question non liée à cette documentation ou problème technique sur l'un de vos services, contactez le support commercial ou le support technique

MerciMerci ! N'hésitez pas à poser des questions sur nos documentations si vous souhaitez plus d'informations et nous aider à les améliorer.


Vous avez noté 0 étoile(s)

Similar articles

2mn reading

How do I configure the firewall on a dedicated VPS server?

1mn reading

How can I connect as root on a dedicated VPS server with Putty?

0mn reading

Linux / Debian SSH commands

0mn reading

SSH - Access rights on files or directories (Chmod)


Ask the LWS team and its community a question