Every distribution family ships its own package manager. Find yours in the table, then use the matching line in the sections below. Most install/remove operations need sudo.
Package manager
Distribution
apt, apt-get, dpkg
Debian, Ubuntu, Mint
dnf, yum, rpm
Fedora, RHEL, CentOS
pacman
Arch, Manjaro
zypper
openSUSE
emerge
Gentoo
apk
Alpine
pkg
FreeBSD, Termux
snap, flatpak
Distribution-independent app formats
apt is the friendlier front end to apt-get/apt-cache and the better choice for interactive use. On Fedora, dnf replaced yum.
apt purge also deletes the package's system-wide configuration files; pacman -Rs removes the package together with dependencies nothing else needs.Clean up dependencies that are no longer needed by anything.
On Arch, always sync and upgrade together with pacman -Syu. Refreshing the database with -Sy and then installing single packages can break the system (partial upgrade).