Centos 7 上的 dnf 升级内核...

Centos 7 上的 dnf 升级内核...

在一次安装中,dnf成功升级了该内核。在较新的计算机(今天安装并升级)上,它失败了。不知道为什么……

这是完整的运行:

; sudo dnf upgrade -y
Last metadata expiration check: 5:42:13 ago on Wed 06 Mar 2019 10:56:30 GMT.
Dependencies resolved.

 Problem 1: cannot install both kernel-3.10.0-957.5.1.el7.x86_64 and kernel-3.10.0-957.5.1.el7.x86_64
  - cannot install the best update candidate for package kernel-3.10.0-957.5.1.el7.x86_64
  - cannot install the best update candidate for package kernel-3.10.0-957.el7.x86_64
 Problem 2: cannot install both kernel-devel-3.10.0-957.5.1.el7.x86_64 and kernel-devel-3.10.0-957.5.1.el7.x86_64
  - cannot install the best update candidate for package kernel-devel-3.10.0-957.5.1.el7.x86_64
  - cannot install the best update candidate for package kernel-devel-3.10.0-957.el7.x86_64
================================================================================
 Package            Arch         Version                    Repository     Size
================================================================================
Reinstalling:
 kernel             x86_64       3.10.0-957.5.1.el7         updates        48 M
 kernel-devel       x86_64       3.10.0-957.5.1.el7         updates        17 M
     replacing  kernel-devel.x86_64 3.10.0-957.5.1.el7

Transaction Summary
================================================================================

Total size: 65 M
Downloading Packages:
[SKIPPED] kernel-3.10.0-957.5.1.el7.x86_64.rpm: Already downloaded
[SKIPPED] kernel-devel-3.10.0-957.5.1.el7.x86_64.rpm: Already downloaded
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Reinstalling     : kernel-devel-3.10.0-957.5.1.el7.x86_64                 1/4
  Running scriptlet: kernel-devel-3.10.0-957.5.1.el7.x86_64                 1/4
  Reinstalling     : kernel-3.10.0-957.5.1.el7.x86_64                       2/4
  Running scriptlet: kernel-3.10.0-957.5.1.el7.x86_64                       2/4
  Obsoleting       : kernel-devel-3.10.0-957.5.1.el7.x86_64                 3/4
  Running scriptlet: kernel-3.10.0-957.5.1.el7.x86_64                       4/4
  Cleanup          : kernel-3.10.0-957.5.1.el7.x86_64                       4/4
  Running scriptlet: kernel-3.10.0-957.5.1.el7.x86_64                       4/4
  Verifying        : kernel-3.10.0-957.5.1.el7.x86_64                       1/5
  Verifying        : kernel-3.10.0-957.5.1.el7.x86_64                       2/5
  Verifying        : kernel-devel-3.10.0-957.5.1.el7.x86_64                 3/5
  Verifying        : kernel-devel-3.10.0-957.el7.x86_64                     4/5
  Verifying        : kernel-devel-3.10.0-957.5.1.el7.x86_64                 5/5
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Traceback (most recent call last):
  File "/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 123, in cli_run
    ret = resolving(cli, base)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 154, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 240, in do_transaction
    tid = super(BaseCli, self).do_transaction(display)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 872, in do_transaction
    tid = self._run_transaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 1021, in _run_transaction
    self._verify_transaction(cb.verify_tsi_package)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 1059, in _verify_transaction
    self.history.end(rpmdbv, 0)
  File "/usr/lib/python2.7/site-packages/dnf/db/history.py", line 504, in end
    bool(return_code)
  File "/usr/lib64/python2.7/site-packages/libdnf/transaction.py", line 758, in endTransaction
    return _transaction.Swdb_endTransaction(self, dtEnd, rpmdbVersionEnd, state)
RuntimeError: TransactionItem state is not set: kernel-devel-3.10.0-957.el7.x86_64

根据评论者的要求:

; dnf repolist
Extra Packages for Enterprise Linux 7 - x86_64  3.6 MB/s |  16 MB     00:04    
CentOS-7 - Base                                 5.6 MB/s |  10 MB     00:01    
CentOS-7 - Updates                              4.1 MB/s | 5.2 MB     00:01    
IUS Community Packages for Enterprise Linux 7 - 3.9 MB/s | 941 kB     00:00    
slack                                            29 kB/s |  33 kB     00:01    
CentOS-7 - Extras                               1.2 MB/s | 339 kB     00:00    
repo id      repo name                                                    status
base         CentOS-7 - Base                                              10,019
*epel        Extra Packages for Enterprise Linux 7 - x86_64               13,008
extras       CentOS-7 - Extras                                               382
ius          IUS Community Packages for Enterprise Linux 7 - x86_64          570
slack        slack                                                            47
updates      CentOS-7 - Updates                                            1,457

; dnf repolist -v | grep "^Repo-filename" | awk '{print $2}' | sort ; ls /etc/yum.repos.d
/etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/CentOS-Base.repo
/etc/yum.repos.d/epel.repo
/etc/yum.repos.d/ius.repo
/etc/yum.repos.d/slack.repo
total 60K
4.0K CentOS-Base.repo       8.0K CentOS-Vault.repo      4.0K ius-archive.repo
4.0K CentOS-CR.repo         4.0K CentOS-fasttrack.repo  4.0K ius-dev.repo
4.0K CentOS-Debuginfo.repo  4.0K epel.repo              4.0K ius-testing.repo
4.0K CentOS-Media.repo      4.0K epel-testing.repo      4.0K slack.repo
4.0K CentOS-Sources.repo    4.0K ius.repo

答案1

据 Sardathrion 和我所知,我们共同在我们各自的 EL7 发行版中当前发布的版本中遇到了 dnf 损坏。 Sardathrion 得到一个 Python 回溯,而我得到一个basic_string::_S_construct null not valid, ignoring this repo(我无法将其放入 dnf 代码中)。在这两种情况下,我们都看到 dnf 将自己与cannot install both <kernel> and <same-kernel>消息混淆并做出了意想不到的事情。

就我而言,当我通过以下命令降级 dnf 时,我的症状消失了

dnf downgrade --allowerasing dnf

这将 Scientific Linux 7.6 上的 dnf 从 4.0.9 降低到 2.7.5。我在 CentOS 库中看到相同的 SRPM,这表明 CentOS 用户应该能够执行相同的操作。

由于我在发布 dnf 4.1.0 的 Fedora 29 中没有观察到任何此类问题,因此在对 libdnf 维护者执行 ping 操作之前,我们的第一条后续行动应该是与我们的发行版维护者联系。

编辑:TUV 已意识到 dnf 提供重新安装过时内核的问题。它没有解决我禁用的sl存储库问题,我也不知道它是否修复了 Sardathrion 的大回溯。

相关内容