apt update
apt upgrade
apt full-upgrade
apt install
apt list --upgradable
apt list --installed
apt-mark hold <package>
apt-mark unhold <package>
apt download <package>
Pin a repo or specific package to prefer it over another repo.
Create a new preference file in /etc/apt/preferences.d/
vim /etc/apt/preferences.d/<package-name>
Use the following config (modify as necessary)
Package: nodejs
Pin: origin deb.nodesource.com
Pin-Priority: 600
Setup the keyrings
directory if it hasn't already been
install -m 0755 -d /etc/apt/keyrings
Converting a PGP key to GPG
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | gpg --dearmor -o /usr/share/keyrings/elastic-7.x.gpg
Downloading a GPG key, no need to convert
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | tee /usr/share/keyrings/elastic-7.x.gpg
Reference the installed key when defining the repo in the source file
deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/elastic-7.x.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main