yum与apt命令比较

来源:互联网 发布:线程 java 编辑:程序博客网 时间:2024/05/23 23:59
TaskRed Hat/FedoraUbuntu/DebianAdding, Removing and Upgrading PackagesRefresh list of available packagesYum refreshes each time it’s usedapt-get updateInstall a package from a repositoryyum installpackage_nameapt-get installpackage_nameInstall a package fileyum installpackage.rpmrpm -ipackage.rpmdpkg –install package.debRemove a packagerpm -e package_nameapt-get removepackage_nameCheck for package upgradesyum check-updateapt-get -s upgradeapt-get -s dist-upgradeUpgrade packagesyum updaterpm -Uvh [args]apt-get dist-upgradeUpgrade the entire systemyum upgradeapt-get dist-upgradePackage InformationGet information about an available packageyum searchpackage_nameapt-cache searchpackage_nameShow available packagesyum list availableapt-cache dumpavailList all installed packagesyum list installedrpm -qadpkg –listGet information about a packageyum infopackage_nameapt-cache showpackage_nameGet information about an installed packagerpm -qi package_namedpkg –statuspackage_nameList files in an installed packagerpm -ql package_namedpkg –listfilespackage_nameList documentation files in an installed packagerpm -qd package_name-List configuration files in an installed packagerpm -qc package_name-Show the packages a given package depends onrpm -qRpackage_nameapt-cache dependsShow other packages that depend on agiven package (reverse dependency)rpm -q -whatrequires [args]apt-cache rdependsPackage File InformationGet information about a package filerpm -qpi package.rpmdpkg –info package.debList files in a package filerpm -qpl package.rpmdpkg –contentspackage.debList documentation files in a package filerpm -qpd package.rpm-List configuration files in a package filerpm -qpc package.rpm-Extract files in a packagerpm2cpio package.rpm | cpio -viddpkg-deb –extractpackage.deb dir-to-extract-toFind package that installed a filerpm -qf filenamedpkg –search filenameFind package that provides a particular fileyum provides filenameapt-file search filenameMisc. Packaging System ToolsShow stats about the package cache-apt-cache statsVerify all installed packagesrpm -VadebsumsRemove packages from the local cache directoryyum clean packagesapt-get cleanRemove only obsolete packages from the local cache directory-apt-get autocleanRemove header files from the local cache directory(forcing a new download of same on next use)yum clean headersapt-file purgeGeneral Packaging System InformationPackage file extension*.rpm*.debRepository location configuration/etc/yum.conf/etc/apt/sources.list