分类: LINUX
2006-09-05 08:46:53
Operation |
Debian Command |
Red Hat Equivalent |
---|---|---|
Search for a package |
apt-cache search terms |
rpm -qa packagename |
Show a package;s details |
apt-cache show packagename |
rpm -qi packagename |
Install a package |
apt-get install packagename, or dpkg -i /path/to/file.deb |
rpm -ihv packagename |
Remove a package |
apt-get remove packagename, or dpkg -r packagename |
rpm -e packagename |
Purge a package |
apt-get -purge remove packagename, or dpkg -purge packagename |
------ |
Install a package, while replacing any missing configuration files |
dpkg -force-confmiss -i /path/to/file, deb |
rpm -Ihv -allfiles/packagename |
Reconfigure a package which uses debconf |
dpkg-reconflgure packagename |
------ |
Quick list of an installed package |
dpkg -l packagename |
rpm -qapackagename |
Quick list of all installed packages |
dpkg -l |
rpm -qa |
List files contained in a package |
dpkg -L packagename |
rpm -ql packagename |
Find which package contains a file |
dpkg -S /path/to/a/file |
rpm -qf /path/to/a/file |
Examine a downloaded .deb |
dpkg - I /path/to/file.deb |
rpm -qp -l /packagename |
Refresh local package lists |
apt-get update |
rpm -Uhv -justdb /packagename |
Upgrade installed packages |
apt-get -u upgrade |
rpm -freshen packagename |
Upgrade installed packages, while allowing package removals |
apt-get -u dist-upgrade |
------- |
Put a package on hold so it won't get upgraded |
echo packagename hold | dpkg -set-selections |
------- |
Allow a package which was previously on hold to be upgraded |
echo packagename install | dpkg -set-selections |
------- |