Package managers quick sheet
Given the most of the time I was RH-based Linux user, apt thing is new to me. I knew how to do basic stuff, like install/get info/remove/purge. But advanced things I needed were hidden. So here are some commands I had to pick up quickly:
Debian-based | RHEL-based | Arch-based | What it does |
---|---|---|---|
Basic stuff | |||
apt list --installed | rpm -ql yum list installed |
pacman -Q | list all installed packages |
yum list kernel | list installed kernels | ||
apt-mark showmanual | yum history userinstalled yumdb search reason user |
pacman -Qe | list explicitly installed packages |
apt update | yum check-update | pacman -Syy | updates a local cache of available packages |
apt search [package] | yum search [package] | pacman -Ss [package] | searches for a package among the local cache |
apt info [package] | yum info [package] | pacman -Si [pkgname] | info about a package |
apt upgrade [package] | yum upgrade/update [package] upgrade and update are synonyms |
pacman -Syu [package] | upgrade a package / all pacakges |
yum update --security | install only security updates | ||
apt install [package] | yum install [package] | pacman -S [package] | installs a package |
apt purge [package] && apt autoclean | yum remove [package] | pacman -Rns [package] | removes the package and all dependant packages |
apt clean | yum clean all |
pacman -Scc | cleans the package cache |
Advanced stuff | |||
dpkg -S <file> | rpm -qf <file> | what package some file belongs to | |
dpkg -L <package> |
rpm -ql <package> |
lists all files some installed package consists of | |
dpkg -l [package] |
rpm -qa [package] |
lists all installed packages / brief info about specific package | |
dpkg -V <package> |
rpm -qv <package> |
Verifies the package (if any of the files were modified) | |
apt-cache policy <package> |
from which repo package was installed | ||
apt-file update
apt-file find <file> |
yum what provides <file> |
pkgfile -u
pkgfile <file>
|
finds a package which provides specific file |
apt list -a apache2 |
list all available versions of some package | ||
apt install apache2=2.1.2.4. |
installs a specific version of package | ||
apt-mark hold apache2 |
keep this version of package from being updated | ||
apt-rdepends -r <package> | what REPOSITORY packages are depending on a given package | ||
aptitude why <package> | rpm -q --whatrequires <package> |
what INSTALLED packages are depending on a given package. E.g. if you installed "game" and that installed "game-data", this command will show you "game-data" | |
yum deplist <package> |
for a given package, show what INSTALLED packages are needed. Usually it's a quite big list with a lot of system packages | ||
dpkg-reconfigure [package] |
reconfigures an already installed package - i.e. runs post install scripts in an interactive manner (rather than using debconf). Give it a try like this: dpkg-reconfigure ddclient | ||
dpkg -C |
performs a consistency check |
No comments:
Post a Comment