Skip to content

通过知识获得解放,通过技术获得自由

Menu
  • 专题目录
  • 液压相关
    • 液压技术
    • 液压相邻技术
    • 液压应用
  • 计算机相关
    • 计算机和软件
    • 网络和网站技术
  • 哲学
  • 关于本站
Menu

linux软件包管理器[0]

Posted on 2023年11月14日 by

什么是包管理器?

大多数现代类 Unix 操作系统都提供了一个集中的软件包管理机制,以帮助用户搜索、安装和管理软件。而软件通常以包的形式存储在仓库(repository)中,对软件包的使用和管理被称为包管理。而 Linux 包的基本组成部分通常有:共享库、应用程序、服务和文档。

包管理器又称软件包管理系统,它是在电脑中自动安装、配制、卸载和升级软件包的工具组合,在各种系统软件和应用软件的安装管理中均有广泛应用。

在Linux发行版中,几乎每一个发行版都有自己的包管理器。

常见的有:

  • Debian的dpkg以及它的前端

前端apt(使用于Debian、Ubuntu)。

  • Red Hat的RPM包管理器以及它的
前端dnf(使用于Fedora)
前端yum(使用于Red Hat Enterprise Linux)
前端ZYpp(使用于openSUSE)
前端urpmi(使用于Mandriva Linux、Mageia)等。
  • 其他包管理器有
ArchLinux中使用的Pacman
Gentoo使用的基于源代码的Portage
Mac系统下的Homebrew等。

使用包管理器将大大简化在Linux发行版中安装软件的过程。

有了包管理器为什么还要有其前端工具?

包管理器如RPM与DPKG只能做到检查相依性,在安装或移除时告知相依性的不满足,接下来就需要用户自行去找出所需的组件来安装。 这样非常不方便,为了实现可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装,前端工具如 APT及YUM就诞生了!

  • dpkg

“dpkg ”是“Debian Packager ”的简写。为 “Debian” 专门开发的套件管理系统,方便软件的安装、更新及移除。软件都是以deb结尾的编译好的二进制包。所有源自“Debian”的“Linux ”发行版都使用 “dpkg”,例如 “Ubuntu”、“Knoppix ”等。

  • apt

APT(全称为Advanced Packaging Tools)与 YUM对应, 是Linux下的一款安装包管理工具。APT由几个名字以“apt-”打头的程序组成。apt-get、apt-cache 和apt-cdrom是处理软件包的命令行工具。

  • rpm

RPM包管理员(简称RPM,全称为The RPM Package Manager或Redhat Package Manager)是在Linux下广泛使用的软件包管理器。使用RPM的发行版:Fedora和Red Hat Enterprise Linux,openSUSE和SUSE Linux Enterprise,Mandriva Linux和Mageia,PCLinuxOS.RPM软件包分为二进制包(Binary)、源代码包(Source)和Delta包三种。二进制包可以直接安装在计算机中,而源代码包将会由RPM自动编译、安装。源代码包经常以src.rpm作为后缀名。RPM仅适用于安装用RPM来打包的软件,目前是GNU/Linux下软件包资源最丰富的软件包类型之一。

  • yum

yum是一个用于管理rpm包的后台程序,用python写成,可以非常方便的解决rpm的依赖关系。在建立好yum服务器后,yum客户端可以通过 http、ftp方式获得软件包,并使用方便的命令直接管理、更新所有的rpm包,甚至包括kernel的更新。

  • dnf

DNF 是新一代的rpm软件包管理器。他首先出现在 Fedora 18 这个发行版中。而最近,它取代了yum,正式成为 Fedora 22 的包管理器。DNF包管理器克服了YUM包管理器的一些瓶颈,提升了包括用户体验,内存占用,依赖分析,运行速度等多方面的内容。DNF使用 RPM, libsolv 和 hawkey 库进行包管理操作。尽管它没有预装在 CentOS 和 RHEL 7 中,但你可以在使用 YUM 的同时使用 DNF 。

  • zypp

ZYpp(或称libzypp) 是一个软件包管理引擎,通常在openSUSE/SUSE以YaST、Zypper或PackageKit为前端使用。

Linux应用软件安装包

解析Linux应用软件安装包,通常Linux应用软件的安装包有四种:

1)tar包,如software-1.2.3-1.tar.gz。他是使用UNIX系统的打包工具tar打包的。
2)rpm包,如software-1.2.3-1.i386.rpm。他是Redhat Linux提供的一种包封装格式。
3)dpkg包,如software-1.2.3-1.deb。他是Debain Linux提供的一种包封装格式。
4)bin包,如jdk-1_5_0_05-linux-i586.bin,有些Linux软件不公开源代码,只发布二进制可执行程序,这类程序一般会以bin来标记。
而且,大多数Linux应用软件包的命名也有一定的规律,他遵循:名称-版本-修正版-类型

参考资料:

  1. https://www.ctolib.com/topics-99192.html
  2. https://zhyjc6.github.io/posts/2019/09/21/Linux%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8.html
  3. https://distrowatch.com/dwres.php?resource=package-management

欢迎回来

希望本站对你有所帮助!

如有疑问请联系info@fanlog.org
2023 年 11 月
一二三四五六日
 12345
6789101112
13141516171819
20212223242526
27282930 
« 6 月    

AI辅助 (17)

© 2025 | Powered by Superbs Personal Blog theme
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT