The comparison between Ubuntu package management and Redhat

Source: Internet
Author: User

About package Management thanks to this article for an introduction to the package management approach that inspired Ubuntu (Apt-get, dpkg, aptitude)

Especially for administrators who go from Rhel to Ubuntu, they can get started quickly.

Excerpt:

Apt-cache Search Package #搜索包 (equivalent to Yum list | grep pkg) Apt-cache Show package #显示包的相关信息, such as description, size, version Apt-cache SHOWPG package #显示包的相关信息, such as reverse Depends (reverse dependency), dependency, etc. a Pt-get Install package #安装包apt-get Reinstall package #重新安装包apt-get-f Install package #强制安装apt-get Remove PAC Kage #删除包 (just delete data and executables, do not delete configuration files) apt-get remove--purge package #删除包, including deleting profiles apt-get autoremove--purge packag e #删除包及其依赖的软件包 + config file, etc. apt-get update #更新源apt-get upgrade #更新已安装的包apt-get dist-upgrade #升级系统apt-get DSE Lect-upgrade #使用 Dselect Upgrade Apt-cache depends package #了解使用依赖apt-cache rdepends Package #查看该包被哪些包依赖apt-get BUILD-DEP Package #安装相关的编译环境apt-get Source package #下载该包的源代码apt-get clean && apt-get AutoClean #清理下载文件的存档 && only cleans up outdated packages apt-get Check #检查是否有损坏的依赖dpkg-s filename #查找filename属于哪个软件包apt-file search Filenam E #查找filename属于哪个软件包apt-file list packagename #列出软件包的内容apt-file update #更新apt-file database DPKg-l #列出当前系统中所有的包. Can be used with the parameter less in Split-screen viewing (similar to RPM-QA) dpkg-l |grep-i "pkg" #查看系统中与 "pkg" associated packages (similar to RPM-QA | grep pkg) dpkg-s pkg #查询一个已安装的包的详细信息 (similar to Rpm-qi) dpkg-l pkg #查询一个已安装的软件包释放了哪些文件 (similar to RPM-QL) dpkg-s file #查询系统中某个文件属于 Which package (similar to RPM-QF) dpkg-c Pkg.deb #查询一个未安装的deb包将会释放哪些文件 (similar to RPM-QPL) dpkg-i Pkg.deb #查看一个未安装的deb包的详细信息 (similar to RPM-QPI) dpkg- I pkg.deb #手动安装软件包 (cannot solve the soft dependency problem, can be solved with apt-get-f install) Dpkg-r pkg #卸载软件包 (not a full uninstall, its configuration file also exists) Dpkg-p pkg #全部卸载 (cannot Solve the dependency problem) dpkg-reconfigure pkg #重新配置dpkg-x pkg.deb dir #将一个deb包解开至dir目录dpkg--pending--remove #移除多余的软件

  

Force installation of a package (ignoring dependencies and other issues)

Dpkg-i pkg.deb--force-all    #可以参考dpkg--force-help

In addition, Ubuntu has another package management tool aptitude, the following are common usage

Aptitude Update   #更新可用的包列表 aptitude upgrade  #升级可用的包 aptitude dist-upgrade     #将系统升级到新的发行版 Aptitude Install Pkgname  #安装包 Aptitude Remove pkgname   #删除包 aptitude purge pkgname    #删除包及其配置文件 Aptitude search String    # Search package (equivalent to Yum list | grep pkg, important) Aptitude show Pkgname     #显示包的详细信息 (equivalent to Yum info pkg, important) aptitude clean            #删除下载的包文件 aptitude autoclean< c11/> #仅删除过期的包文件

Aptitude and Apt-get are complementary to each other, and there are some features on both sides.

Advantages of aptitude: Install, remove, reinstall (Apt-get without this function), show (Apt-get without this feature), search (Apt-get without this feature), hold (Apt-get without this feature), Unhold (Apt-get without this feature)

Advantages of Apt-get: source (aptitude without this function), BUILD-DEP (low version of aptitude without BUILD-DEP function)

Apt-get the same place as aptitude: Update, upgrade (Apt-get upgrade=aptitude Safe-upgrade, Apt-get dist-upgrade=aptitude Full-upgrgade)

In addition, if you want to search the network of BZIP2 software packages, with Apt-cache search bzip2, will search out a lot of clutter, and aptitude search bzip2 results are much more accurate. Because Apt-cache is based on full-text matching (including descriptions, etc.), aptitude is matched by file name.

The comparison between Ubuntu package management and Redhat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.