Memento for APT to manage our package.
APT (Advanced Package Tool) is a package manager Debian and Debian's like distros.
Debian distors uses a packaging sytem called dpkg (Debian package). It provides programs and applications for installation in the way that we don't have to manually build a program from the source code. There is a dpkg manager but APT is more friendly to use.
Here we are using
apt
(new way) and notapt-get
(old way), apt has more advantages over apt-get such as aprogress bar, prompoting the number of package that can be upgraded, simplier commands, etc.
APT works on database of available packages, we have to update the repository of packages to know if thery are newer packages.
It will check all repository in /etc/apt/source.list. It is a command to do before installing or updating a program :
sudo apt update
Now we can upgrade all installed packages :
sudo apt upgrade
We can combine the two commands with &&
, with -y
to say yes we want to upgrade all the packages :
sudo apt update && sudo apt upgrade -y
We can use full-upgrade
to let APT remove all the necessary packages :
sudo apt full-upgrade
To install a package :
sudo apt install package_name
Or multiple packages :
sudo apt install packageName <packageName2
Install without upgrading :
sudo apt install packageName --no-upgrade
(Don't want to upgrade if it's installed)
Install only upgrading :
sudo apt install packageName --only-upgrade
(Don't want to install if it's not upgradable)
Install with specific version number (the latest is intalled by default) :
sudo apt install packageName=versionNumber
If we downloaded a .deb file, we can install it with :
sudo dpkg -i fichier.deb
sudo apt install -f
(intalling dependencies)
sudo apt remove packageName
(removes only binaries)
sudo apt autoremove
(removes binaries and dependencies if it's not used)
sudo apt purge packageName
(removes binaries and files configurations)
apt search packageName
(searhc a package)
apt show packageName
(search a package by a name or its description)
apt list --upgradeable
(list upgradable packages)
apt list --installed
(list installed packages)
sudo apt autoremove
(removes unused dependencies)
sudo apt clean
(removes oudated cache)
sudo apt autoclean
(removes cache)
Updated : 15/01/2021 Author : AnthonyF