降级“kernel-devel-3.10.0-xxx.el7.x86_64.rpm”

降级“kernel-devel-3.10.0-xxx.el7.x86_64.rpm”

我使用 wget 下载kernel-devel,然后我想安装它,但似乎已通过以下方式安装yum

$ rpm -i kernel-devel-3.10.0-327.el7.x86_64.rpm
warning: kernel-devel-3.10.0-327.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
[echou@localhost kernel]$ sudo rpm -i kernel-devel-3.10.0-327.el7.x86_64.rpm
[sudo] password for echou: 
warning: kernel-devel-3.10.0-327.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
    package kernel-devel-3.10.0-693.11.6.el7.x86_64 (which is newer than kernel-devel-3.10.0-327.el7.x86_64) is already installed

那么,如何降级呢?


编辑

我尝试使用kernel-devel-uname-r == $(uname -r)特殊版本:

$ sudo yum install "kernel-devel-uname-r == $(uname -r)"
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.cuhk.edu.hk
 * epel: ftp.cuhk.edu.hk
 * extras: ftp.cuhk.edu.hk
 * updates: ftp.cuhk.edu.hk
No package kernel-devel-uname-r == 3.10.0-327.el7.x86_64 available.
Error: Nothing to do

但也失败了。

答案1

sudo yum downgrade ./kernel-devel-3.10.0-327.el7.x86_64.rpm

在 CentOS 7.4 上测试

答案2

只需使用 yum 删除较新的kernel-devel

yum remove kernel-devel-3.10.0-327.el7.x86_64.rpm 

然后你可以使用它rpm来安装它:

rpm -i kernel-devel-3.10.0-327.el7.x86_64.rpm

相关内容