Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5762529
  • 博文数量: 675
  • 博客积分: 20301
  • 博客等级: 上将
  • 技术积分: 7671
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-31 16:15
文章分类

全部博文(675)

文章存档

2012年(1)

2011年(20)

2010年(14)

2009年(63)

2008年(118)

2007年(141)

2006年(318)

分类: LINUX

2006-09-05 08:46:53

Debian Commands: Quick Reference

provides a comparison between some of the most commonly used Debian and Red Hat commands.


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


-------



阅读(702) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~