apt command cheatsheet
check apt history for manually installed packages
$ zgrep 'Commandline: apt' /var/log/apt/history.log /var/log/apt/history.log.*.gz
upgrade all packages
$ sudo apt update && sudo apt full-upgrade (=> ubuntu & debian)
$ sudo apk update && sudo apk upgrade (=> alpine)
repository xxx changed its 'Version' value from 'x' to 'x'
apt-get update --allow-releaseinfo-change
install a new package
$ sudo apt install <packagename> (=> ubuntu & debian)
$ sudo apk add <packagename> (=> alpine)
un-install packages
$ sudo apt remove <packagename> (=> ubuntu & debian)
$ sudo apk del <packagename> (=> alpine)
execute a release upgrade (eg from 20.04 to 22.04)
$ screen do-release-upgrade
# Run this command in a separate screen, so you can recover in case of connection problems during the installation process.
# Alternative SSH-port usring installation is 1022
#
# reattach to a running screen: $ screen -r
#
# Some third party entries in your sources.list were disabled. You can
# re-enable them after the upgrade with the 'software-properties' tool
# or your package manager.
upgrade to a newer kernel
$ apt-cache search linux-image
linux-headers-5.10.0-16-amd64 - Header files for Linux 5.10.0-16-amd64
linux-headers-5.10.0-16-cloud-amd64 - Header files for Linux 5.10.0-16-cloud-amd64
linux-headers-5.10.0-16-rt-amd64 - Header files for Linux 5.10.0-16-rt-amd64
linux-headers-5.10.0-18-amd64 - Header files for Linux 5.10.0-18-amd64
linux-headers-5.10.0-18-cloud-amd64 - Header files for Linux 5.10.0-18-cloud-amd64
~
linux-image-5.10.0-18-amd64 - Linux 5.10 for 64-bit PCs (signed)
linux-image-5.10.0-18-cloud-amd64 - Linux 5.10 for x86-64 cloud (signed)
linux-image-5.10.0-18-rt-amd64 - Linux 5.10 for 64-bit PCs, PREEMPT_RT (signed)
~
pve-kernel-5.19.7-1-pve - Proxmox Kernel Image
pve-kernel-5.19.7-2-pve - Proxmox Kernel Image
pve-kernel-5.19 - Latest Proxmox VE Kernel Image
$ sudo apt install pve-kernel-5.19
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
pve-kernel-5.19.17-1-pve
The following NEW packages will be installed:
pve-kernel-5.19 pve-kernel-5.19.17-1-pve
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 77.6 MB of archives.
After this operation, 412 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://download.proxmox.com/debian/pve bullseye/pve-no-subscription amd64 pve-kernel-5.19.17-1-pve amd64 5.19.17-1 [77.6 MB]
Get:2 http://download.proxmox.com/debian/pve bullseye/pve-no-subscription amd64 pve-kernel-5.19 all 7.2-14 [5,028 B]
Fetched 77.6 MB in 7s (11.5 MB/s)
Selecting previously unselected package pve-kernel-5.19.17-1-pve.
(Reading database ... 43826 files and directories currently installed.)
Preparing to unpack .../pve-kernel-5.19.17-1-pve_5.19.17-1_amd64.deb ...
Unpacking pve-kernel-5.19.17-1-pve (5.19.17-1) ...
Selecting previously unselected package pve-kernel-5.19.
Preparing to unpack .../pve-kernel-5.19_7.2-14_all.deb ...
Unpacking pve-kernel-5.19 (7.2-14) ...
Setting up pve-kernel-5.19.17-1-pve (5.19.17-1) ...
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.19.17-1-pve /boot/vmlinuz-5.19.17-1-pve
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.19.17-1-pve /boot/vmlinuz-5.19.17-1-pve
update-initramfs: Generating /boot/initrd.img-5.19.17-1-pve
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
run-parts: executing /etc/kernel/postinst.d/proxmox-auto-removal 5.19.17-1-pve /boot/vmlinuz-5.19.17-1-pve
run-parts: executing /etc/kernel/postinst.d/zz-proxmox-boot 5.19.17-1-pve /boot/vmlinuz-5.19.17-1-pve
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 5.19.17-1-pve /boot/vmlinuz-5.19.17-1-pve
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.19.17-1-pve
Found initrd image: /boot/initrd.img-5.19.17-1-pve
Found linux image: /boot/vmlinuz-5.15.74-1-pve
Found initrd image: /boot/initrd.img-5.15.74-1-pve
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
Setting up pve-kernel-5.19 (7.2-14) ...
Back-up a list of all installed packages on your system
dpkg --get-selections > packages.lst
Restore a list of all installed packages on your system