Saturday, April 21, 2007

Linux Package Manager Quick Reference

Fedora, CentOSDebian, (K)Ubuntu
Install from a package filerpm -i (package file)aptitude -S (package file) -i
Install/Update from a package filerpm -U (package file)dpkg -i (package file)
Update from a package filerpm -F (package file)aptitude -S (package file) -u
Downgrade a packagerpm -U --oldpackage (package file)dpkg --force-downgrade -i (package name)
Reinstall packagerpm -Uvh --replacepkgs (package file)aptitude --reinstall install (package name)
Remove a packagerpm -e (package name)dpkg -r (package name)
Remove a package (Installed via repositories)yum -C remove (package name)aptitude remove (package name)
Update package informationyum makecacheaptitude update
Update current installed packagesyum -C updateaptitude safe-upgrade
Install repository packageyum -C install (package name)aptitude install (package name)
Upgrade to next distribution releaserpm -Uvh *****-release-n-n.noarch.rpm
yum upgrade
aptitude dist-upgrade
Search repository packagesyum -C list | grep (string)aptitude search (regex)
List installed packagesrpm -qa
or
yum list installed
dpkg -l
Find the package a file belongs torpm -qf (file name)dpkg -S (file)
or
apt-file find (file)
List the files that belong to a packagerpm -ql (package name)dpkg -L (package name)
Get package detailsyum -C info (package name)aptitude show (package name)
Clean cacheyum clean allaptitude clean
Search packages by nameyum -C search (string)apt-cache search (string)

No comments:

Post a Comment