Index

Debian

Repositories

add repository
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
add unattended
sudo add-apt-repository -y ppa:openjdk-r/ppa
sudp apt-get update

package info

list packages consisely
dpkg -l
find specific packages
apt-cache search [query]
get status information for package
dpkg -s openjdk-8-jdk
display available information on package
apt-cache show [package]
list files in package
dpkg -L [package]
installing a downloaded .deb package
sudo dpkg -i *.deb

Apt

update package list
sudo apt-get update
install package
sudo apt-get install openjdk-8-jdk
install unattended
sudo apt-get install -y openjdk-8-jdk
remove binaries for package
sudo apt-get remove [package]
remove binaries for package without asking confirmations
sudo apt-get remove -y [package]
remove all openjdk packages
sudo apt-get remove openjdk*
remove package including its configuration files
sudo apt-get purge [package]
remove packages that were only installed to satisfy dependencies and are no longer used
sudo apt-get autoremove
remove packages that are no longer relevant
sudo apt-get autoclean

security updates

list security Updates only
sudo unattended-upgrade --dry-run -d
apt-get -s dist-upgrade| grep "^Inst" | grep -i security
install security upgrades using apt-get
apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install
install unattended upgrades to install security updates
sudo apt-get install unattended-upgrades
configure unattended upgrades to run automatically
sudo dpkg-reconfigure unattended-upgrades
install security updates once silently
sudo unattended-upgrades
install security updates once with output
sudo unattended-upgrades -d
simulate, but don't actually install
sudo unattended-upgrades --dry-run -d
unattended-updates log file
/var/log/unattended-upgrades
further reading
https://help.ubuntu.com/community/AutomaticSecurityUpdates
http://manpages.ubuntu.com/manpages/bionic/en/man8/apt-get.8.html

switch between alternative implementations

help
update-alternatives --help
list master alternative names and their status
update-alternatives --get-selections
list available alternatives
update-alternatives --list [master]
print current alternative, best alternative and options
update-alternatives --display [master]
select alternative
sudo update-alternatives --set [master] [path]
example
sudo update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
documentation
https://linux.die.net/man/8/update-alternatives