This commit is contained in:
Xingyu Wang 2020-04-26 23:02:41 +08:00
parent 01fe66eb42
commit 36d5a40746
2 changed files with 66 additions and 77 deletions

View File

@ -1,77 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The Difference Between DNF and YUM, Why is Yum Replaced by DNF?)
[#]: via: (https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
The Difference Between DNF and YUM, Why is Yum Replaced by DNF?
======
**[Yum Package Manager][1]** has been replaced by **[DNF Package Manager][2]** since many long-standing issues in Yum remain unresolved.
These problems include poor performance, excessive memory usage, slowdown for dependency resolution.
DNF uses “libsolv” for dependency resolution, developed and maintained by SUSE to improve performance.
It was written mostly in python, and it has its own way of coping with dependency resolution.
Its API is not fully documented, and its extension system only allows Python plugins.
Yum is a front-end tool for rpm that manages dependencies and repositories, and then uses RPM to install, download, and remove packages.
Why would they want to build a new tool instead of fixing existing problems?
Ales Kozamblak explained that the fixing was not technically feasible and that the yum team was not ready to accept the changes immediately.
Also, the big challenge is that there are 56K lines for yum, but only 29K lines for DNF.
So there is no way to fix it, except the fork.
However yum was working fine.
S.No | DNF (Dandified YUM) | YUM (Yellowdog Updater, Modified)
---|---|---
1 | DNF uses libsolv for dependency resolution, developed and maintained by SUSE. | YUM uses the public API for dependency resolution
2 | API is fully documented | API is not fully documented
3 | It is written in C, C++, Python | It is written only in Python
4 | DNF is currently used in Fedora, Red Hat Enterprise Linux 8 (RHEL), CentOS 8, OEL 8 and Mageia 6/7. | YUM is currently used in Red Hat Enterprise Linux 6/7 (RHEL), CentOS 6/7, OEL 6/7.
5 | DNf supports various extensions | Yum supports only Python based extension
6 | The API is well documented so it's easy to create new features | It is very difficult to create new features because the API is not properly documented.
7 | The DNF uses less memory when synchronizing the metadata of the repositories. | The YUM uses excessive memory when synchronizing the metadata of the repositories.
8 | DNF uses a satisfiability algorithm to solve dependency resolution (It's using a dictionary approach to store and retrieve package and dependency information). | Yum dependency resolution gets sluggish due to public API.
9 | All performance is good in terms of memory usage and dependency resolution of repository metadata. | Over all performance is poor in terms of many factors.
10 | DNF Update: If a package contains irrelevant dependencies during a DNF update process, the package will not be updated. | YUM will update a package without verifying this.
11 | If the enabled repository does not respond, dnf will skip it and continue the transaction with the available repositories. | If a repository is not available, YUM will stop immediately.
12 | dnf update and dnf upgrade equals. | It's different in yum
13 | The dependencies on package installation are not updated | Yum offered an option for this behavior
14 | Clean Up Package Removal: When removing a package, dnf automatically removes any dependency packages not explicitly installed by the user. | Yum didnt do this
15 | Repo Cache Update Schedule: By default, ten minutes after the system boots, updates to configured repositories are checked by dnf hourly. This action is controlled by the system timer unit named "/usr/lib/systemd/system/dnf-makecache.timer". | Yum do this too.
16 | Kernel packages are not protected by dnf. Unlike Yum, you can delete all kernel packages, including one that runs. | Yum will not allow you to remove the running kernel
17 | libsolv: for solving packages and reading repositories.
hawkey: hawkey, library providing simplified C and Python API to libsolv.
librepo: library providing C and Python (libcURL like) API for downloading linux repository metadata and packages.
libcomps: Libcomps is alternative for yum.comps library. Its written in pure C as library and theres bindings for python2 and python3 | Yum does not use separate libraries to perform this function.
18 | DNF contains 29k lines of code | Yum contains 56k lines of code
19 | DNF was developed by Ales Kozumplik | YUM was developed by Zdenek Pavlas, Jan Silhan and team members
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
[2]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/

View File

@ -0,0 +1,66 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The Difference Between DNF and YUM, Why is Yum Replaced by DNF?)
[#]: via: (https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
DNF 和 YUM 的区别,为什么 YUM 会被 DNF 取代?
======
由于 Yum 中许多长期存在的问题仍未得到解决,因此 [Yum 包管理器][1]已被 [DNF 包管理器][2]取代。这些问题包括性能差、内存占用过多、依赖解析速度变慢等。
DNF 使用 `libsolv` 进行依赖解析,由 SUSE 开发和维护旨在提高性能。DNF 主要是用 Python 编写的,它有自己的应对依赖解析的方法。
Yum 是 RPM 的前端工具,它管理依赖关系和资源库,然后使用 RPM 来安装、下载和删除包。它的 API 没有完整的文档,它的扩展系统只允许 Python 插件。
为什么他们要建立一个新的工具,而不是修复现有的问题呢?
Ales Kozamblak 解释说,这个修复在技术上是不可行的,而且 Yum 团队还没有准备好立即接受修改。
另外最大的挑战是Yum 有 56000 行代码,但 DNF 只有 29000 行代码。
所以除了分叉,没有办法解决。
不过 Yum 的运行情况还算可以。
编号 | DNFDandified YUM | YUMYellowdog Updater, Modified
---|---|---
1 | DNF 使用 libsolv 来解析依赖关系,由 SUSE 开发和维护 | YUM 使用公开的 API 来解析依赖关系
2 | API 有完整的文档 | API 没有完整的文档
3 | 由 C、C++、Python 编写的 | 只用 Python 编写
4 | DNF 目前在 Fedora、RHEL 8、CentOS 8、OEL 8 和 Mageia 6/7 中使用 | YUM 目前在 RHEL 6/7、CentOS 6/7、OEL 6/7 中使用
5 | DNf 支持各种扩展 | Yum 只支持基于 Python 的扩展
6 | API 有良好的文档,因此很容易创建新的功能 | 因为 API 没有正确的文档化,所以创建新功能非常困难
7 | DNF 在同步存储库的元数据时,使用的内存较少 | 在同步存储库的元数据时YUM 使用了过多的内存
8 | DNF 使用满足性算法来解决依赖关系解析(它是用字典的方法来存储和检索包和依赖信息)| 由于使用公开 API 的原因Yum 依赖性解析变得迟钝
9 | 从内存使用量和版本库元数据的依赖性解析来看,性能都不错 | 总的来说,在很多因素的影响下,表现不佳
10 | DNF 更新:在 DNF 更新过程中,如果包中包含不相关的依赖,则不会更新 | YUM 将在没有验证的情况下更新软件包
11 | 如果启用的存储库没有响应DNF 将跳过它,并继续使用可用的存储库出来事务 | 如果有存储库不可用YUM 会立即停止
12 | `dnf update``dnf upgrade` 是等价的 | 在 Yum 中则不同
13 | 安装包的依赖关系不更新 | Yum 为这种行为提供了一个选项
14 | 清理删除的包当删除一个包时DNF 会自动删除任何没有被用户明确安装的依赖包 | Yum 不会这样做
15 | 存储库缓存更新计划:默认情况下,系统启动后 10 分钟后DNF 每小时检查一次对配置的存储库的更新。这个动作由系统定时器单元 `/usr/lib/systemd/system/system/dnf-makecache.timer` 控制 | Yum 也会这样做
16 | 内核包不受 DNF 保护。不像 Yum你可以删除所有的内核包包括运行中的内核包 | Yum 不允许你删除运行中的内核
17 | libsolv用于解包和读取资源库。hawkey: 为 libsolv 提供简化的 C 和 Python API 库。librepo: 提供 C 和 Python类似 libcURLAPI 的库,用于下载 Linux 存储库元数据和软件包。libcomps: 是 yum.comps 库的替代品。它是用纯 C 语言编写的库,有 Python 2 和 Python 3 的绑定。| Yum 不使用单独的库来执行这些功能
18 | DNF 包含 29000 行代码 | Yum 包含 56000 行代码
19 | DNF 由 Ales Kozumplik 开发 | YUM 由 Zdenek Pavlas、Jan Silhan 和团队成员开发
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
[2]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/