apt
The APT package manager in Debian, Ubuntu, and derived distributions.
apt vs apt-get
aptis for interactive use, including commonly-used commands fromapt-getandapt-cache. And it has a nice progress bar.apt-getis more inclined for non-interactive use in scripts because of its stable interface.
nala: a prettier and faster frontend
Nala is a front-end for libapt-pkg and is a (almost) drop-in replacement for apt.
- Better Text UI
- Parallel package downloads
- Discover fastest mirrors (
nala fetch)
To install nala:
sudo apt install nalaTo find fastest mirrors:
sudo nala fetchTo update the system:
sudo nala upgradeapt-fast: apt in parallel
https://github.com/ilikenwf/apt-fast is shell script wrapper for apt-get and aptitude that can drastically improve apt download times by downloading packages in parallel, with multiple connections per package.
One can use apt-fast commands just like apt e.g., sudo apt-fast update, sudo apt-fast dist-upgrade.
Should your downloads stall for any reasons, you’ll need to run apt-fast clean to fix it.
To install apt-fast:
sudo add-apt-repository -y ppa:apt-fast/stable
echo debconf apt-fast/maxdownloads string 16 | sudo debconf-set-selections
echo debconf apt-fast/dlflag boolean true | sudo debconf-set-selections
echo debconf apt-fast/aptmanager string apt-get | sudo debconf-set-selections
sudo apt update && sudo apt install apt-fast -ySynaptic : the GUI package manager for APT
The additional package apt-xapian-index gives a search box in synaptic.
sudo apt install synaptic apt-xapian-indexAdd signing keys
Use of
apt-keyis deprecated according to the Debian manpage
Here, we take adding signing keys for the Vivaldi browser as an example.
curl -fsSL https://repo.vivaldi.com/archive/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/vivaldi-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/vivaldi-keyring.gpg] https://repo.vivaldi.com/archive/deb/ stable main" | sudo tee /etc/apt/sources.list.d/vivaldi.list > /dev/null- Text key files (
.asc) should be converted to binary ones (.gpg) usinggpg --dearmor. - In the apt list, use
[signed-by=/path/to/key.gpg]to specify the location of the keyring. - Use
echo <stuff> | sudo tee <file>to add file content with sudo rights.
Fix APT package manager
Try these commands to fix broken apt package registry (from system76 docs).
sudo apt clean
sudo apt update -m
sudo dpkg --configure -a
sudo apt install -f
sudo apt dist-upgrade
sudo apt autoremove --purge