Update commands for linux

Update and upgrade commmands for various OSes

(Because some I don’t use often enough to remember them)

https://wiki.archlinux.org/title/Pacman/Rosetta

Check installed version

lsb_release  -a

Alpine linux

Install a package ’’’' apk add <package_name> apk add package_name1 package_name2 #add multiple packages ’’’’
Update ’’’' apk update apk upgrade ’’''

Arch linux

Install a package

sudo pacman -S package_name1

updates

sudo pacman -Syy
sudo pacman -Syu

Debian/Ubuntu

updates

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean

Repository 'http://deb.debian.org/debian bullseye InRelease' changed its 'Version' value from '11.6' to '11.7'
sudo apt-get update --allow-releaseinfo-change

The following packages have been kept back
sudo apt install --only-upgrade package_name

upgrade
Before starting the upgrade you must reconfigure APT source-list files (/etc/apt/sources.list and files under /etc/apt/sources.list.d/) to add sources for bookworm and typically to remove sources for bullseye.

sudo apt-get upgrade -y
sudo apt-get dist-upgrade
FreeBSD

updates

sudo pkg update
sudo pkg upgrade
sudo freebsd-update fetch
sudo freebsd-update install
For release upgrade:
sudo freebsd-update upgrade -r 12.0-RELEASE

Gentoo

updates (rolling release so no major upgrades)

sudo eix-sync
sudo emerge -aDvNu world
sudo dispatch-conf
updatedupdated2024-03-302024-03-30