yum与apt命令比较

Task Red Hat/Fedora Ubuntu/Debian
Adding, Removing and Upgrading Packages
Refresh list of available packages Yum refreshes each time it’s used apt-get update
Install a package from a repository yum installpackage_name apt-get installpackage_name
Install a package file yum installpackage.rpmrpm -ipackage.rpm dpkg –install package.deb
Remove a package rpm -e package_name apt-get removepackage_name
Check for package upgrades yum check-update apt-get -s upgradeapt-get -s dist-upgrade
Upgrade packages yum updaterpm -Uvh [args] apt-get dist-upgrade
Upgrade the entire system yum upgrade apt-get dist-upgrade
Package Information
Get information about an available package yum searchpackage_name apt-cache searchpackage_name
Show available packages yum list available apt-cache dumpavail
List all installed packages yum list installedrpm -qa dpkg –list
Get information about a package yum infopackage_name apt-cache showpackage_name
Get information about an installed package rpm -qi package_name dpkg –statuspackage_name
List files in an installed package rpm -ql package_name dpkg –listfilespackage_name
List documentation files in an installed package rpm -qd package_name -
List configuration files in an installed package rpm -qc package_name -
Show the packages a given package depends on rpm -qRpackage_name apt-cache depends
Show other packages that depend on agiven package (reverse dependency) rpm -q -whatrequires [args] apt-cache rdepends
Package File Information
Get information about a package file rpm -qpi package.rpm dpkg –info package.deb
List files in a package file rpm -qpl package.rpm dpkg –contentspackage.deb
List documentation files in a package file rpm -qpd package.rpm -
List configuration files in a package file rpm -qpc package.rpm -
Extract files in a package rpm2cpio package.rpm | cpio -vid dpkg-deb –extractpackage.deb dir-to-extract-to
Find package that installed a file rpm -qf filename dpkg –search filename
Find package that provides a particular file yum provides filename apt-file search filename
Misc. Packaging System Tools
Show stats about the package cache - apt-cache stats
Verify all installed packages rpm -Va debsums
Remove packages from the local cache directory yum clean packages apt-get clean
Remove only obsolete packages from the local cache directory - apt-get autoclean
Remove header files from the local cache directory(forcing a new download of same on next use) yum clean headers apt-file purge
General Packaging System Information
Package file extension *.rpm *.deb
Repository location configuration /etc/yum.conf /etc/apt/sources.list
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值