LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   CentOS 8 upgrade error kernel-core (https://www.linuxquestions.org/questions/linux-newbie-8/centos-8-upgrade-error-kernel-core-4175678967/)

salmanahmed 07-18-2020 10:57 AM

CentOS 8 upgrade error kernel-core
 
Hi
I have installed CentOS 8. After recent release of updates, I am trying to upgrade my CentOS by (yum upgrade), but it is giving following error:
Code:

Error:
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

So, when I give the command (yum upgrade --skip-broken), it gives following message:
Code:

Error:
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--nobest' to use not only best candidate packages)

and the command (yum upgrade --skip-broken --nobest) gives following error:
Code:

Problem: The operation would result in removing the following protected packages: kernel-core
Upon looking on forums, I can find some old posts, terming it as a bug, but nothing about CentOS 8. Kindly help me to solve this problem.

shruggy 07-19-2020 09:55 AM

See the bug BZ#1741381, especially the comment 3 there. As suggested in that comment, try
Code:

dnf mark install $(rpm -qa kernel\*)

salmanahmed 07-19-2020 10:15 AM

Quote:

Originally Posted by shruggy (Post 6147003)
See the bug BZ#1741381, especially the comment 3 there. As suggested in that comment, try
Code:

dnf mark install $(rpm -qa kernel\*)

I ran following command, as mentioned in comment 3:
Code:

[root@alpha ~]# dnf mark install $(dnf repoquery --installed 'kernel*')
Modular dependency problems:

 Problem 1: conflicting requests
  - nothing provides module(perl:5.26) needed by module perl-DBD-SQLite:1.58:8010020191114033549:073fa5fe-0.x86_64
 Problem 2: conflicting requests
  - nothing provides module(perl:5.26) needed by module perl-DBI:1.641:8010020191113222731:16b3ab4d-0.x86_64
Modular dependency problems:

 Problem 1: conflicting requests
  - nothing provides module(perl:5.26) needed by module perl-DBD-SQLite:1.58:8010020191114033549:073fa5fe-0.x86_64
 Problem 2: conflicting requests
  - nothing provides module(perl:5.26) needed by module perl-DBI:1.641:8010020191113222731:16b3ab4d-0.x86_64
kernel-4.18.0-147.8.1.el8_1.x86_64 marked as user installed.
kernel-core-4.18.0-147.8.1.el8_1.x86_64 marked as user installed.
kernel-devel-4.18.0-147.8.1.el8_1.x86_64 marked as user installed.
kernel-headers-4.18.0-147.8.1.el8_1.x86_64 marked as user installed.
kernel-modules-4.18.0-147.8.1.el8_1.x86_64 marked as user installed.
kernel-tools-4.18.0-147.8.1.el8_1.x86_64 marked as user installed.
kernel-tools-libs-4.18.0-147.8.1.el8_1.x86_64 marked as user installed.

And confirmed by following command:
Code:

[root@alpha ~]# dnf repoquery --userinstalled | grep kernel
Modular dependency problems:

 Problem 1: conflicting requests
  - nothing provides module(perl:5.26) needed by module perl-DBD-SQLite:1.58:8010020191114033549:073fa5fe-0.x86_64
 Problem 2: conflicting requests
  - nothing provides module(perl:5.26) needed by module perl-DBI:1.641:8010020191113222731:16b3ab4d-0.x86_64
kernel-0:4.18.0-147.8.1.el8_1.x86_64
kernel-core-0:4.18.0-147.8.1.el8_1.x86_64
kernel-devel-0:4.18.0-147.8.1.el8_1.x86_64
kernel-headers-0:4.18.0-147.8.1.el8_1.x86_64
kernel-modules-0:4.18.0-147.8.1.el8_1.x86_64
kernel-tools-0:4.18.0-147.8.1.el8_1.x86_64
kernel-tools-libs-0:4.18.0-147.8.1.el8_1.x86_64

However, the problem persists:
Code:

[root@alpha ~]# yum upgrade
Last metadata expiration check: 0:33:46 ago on Sun 19 Jul 2020 07:38:01 PM PKT.
Error:
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@alpha ~]#
[root@alpha ~]# yum upgrade --skip-broken
Last metadata expiration check: 0:34:33 ago on Sun 19 Jul 2020 07:38:01 PM PKT.
Error:
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--nobest' to use not only best candidate packages)
[root@alpha ~]#
[root@alpha ~]# yum upgrade --skip-broken --nobest
Last metadata expiration check: 0:34:39 ago on Sun 19 Jul 2020 07:38:01 PM PKT.
Error:
 Problem: The operation would result in removing the following protected packages: kernel-core

PS: I think that perl module error can be ignored and would not be causing that problem.

shruggy 07-19-2020 10:25 AM

Where did the kernel you're currently running come from? Is it the kernel shown above? Please show the output of uname -r.

Are there any kernels installed besides kernel-0:4.18.0-147.8.1.el8_1.x86_64 shown in the output above? Please show the output of ls /boot.

Also, check the contents of /etc/dnf/protected.d/*.conf. Beside the packages specified there, dnf implicitly protects the currently running kernel, so kernel-core shouldn't be explicitly mentioned there.

salmanahmed 07-19-2020 11:21 AM

Quote:

Originally Posted by shruggy (Post 6147019)
Where does the kernel you're currently running come from? Is it the kernel shown above? Please show the output of uname -r.

Are there any kernels installed besides kernel-0:4.18.0-147.8.1.el8_1.x86_64 shown in the output above? Please show the output of ls /boot.

Also, check the contents of /etc/dnf/protected.d/*.conf. Beside the packages specified there, dnf implicitly protects the currently running kernel, so kernel-core shouldn't be explicitly mentioned there.

1. The kernel came from distro, as a result of previous upgrades:
Code:

[root@alpha ~]# uname -r
4.18.0-147.8.1.el8_1.x86_64

2. There aren't other kernels installed. Please check the contents of /boot:
Code:

[root@alpha ~]# cd /boot
[root@alpha boot]# ls
config-4.18.0-147.8.1.el8_1.x86_64
efi
grub2
initramfs-0-rescue-8a9c79d95b28479a833f3442576c711f.img
initramfs-4.18.0-147.5.1.el8_1.x86_64kdump.img
initramfs-4.18.0-147.8.1.el8_1.x86_64.img
initramfs-4.18.0-147.8.1.el8_1.x86_64kdump.img
initramfs-4.18.0-147.el8.x86_64kdump.img
loader
System.map-4.18.0-147.8.1.el8_1.x86_64
vmlinuz-0-rescue-8a9c79d95b28479a833f3442576c711f
vmlinuz-4.18.0-147.8.1.el8_1.x86_64

3. kernel-core is not mentioned in /etc/dnd/protected.d/*.conf:
Code:

[root@alpha protected.d]# ls
dnf.conf  sudo.conf  systemd.conf  yum.conf
[root@alpha protected.d]# cat dnf.conf
dnf
[root@alpha protected.d]# cat sudo.conf
sudo
[root@alpha protected.d]# cat systemd.conf
systemd
systemd-udev
[root@alpha protected.d]# cat yum.conf
yum


shruggy 07-19-2020 12:01 PM

Hmm, then I would suggest the following. Download the packages in question (dnf --downloadonly upgrade), then reboot into the rescue kernel and install them with rpm -i:
Code:

rpm -i /var/cache/dnf/BaseOS-*/packages/kernel*.rpm

salmanahmed 07-19-2020 02:31 PM

Quote:

Originally Posted by shruggy (Post 6147036)
Hmm, then I would suggest the following. Download the packages in question (dnf --downloadonly upgrade), then reboot into the rescue kernel and install them with rpm -i:
Code:

rpm -i /var/cache/dnf/BaseOS-*/packages/kernel*.rpm

Nope... the result is same:
Code:

[root@alpha ~]# dnf --downloadonly upgrade
Last metadata expiration check: 1:49:21 ago on Sun 19 Jul 2020 10:39:36 PM PKT.
Error:
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@alpha ~]#
[root@alpha ~]# dnf --downloadonly upgrade --skip-broken --nobest
Last metadata expiration check: 1:49:35 ago on Sun 19 Jul 2020 10:39:36 PM PKT.
Error:
 Problem: The operation would result in removing the following protected packages: kernel-core


shruggy 07-19-2020 03:05 PM

Ok. The you'll need to download manually at least kernel, kernel-core and kernel-modules, and install them all at once with rpm -i.

salmanahmed 07-20-2020 06:34 AM

Quote:

Originally Posted by shruggy (Post 6147085)
Ok. The you'll need to download manually at least kernel, kernel-core and kernel-modules, and install them all at once with rpm -i.

The problem is fixed. Following were the step which I followed:
1. Download kernel, kernel-core and kernel-modules, linux-firmware.
2. Boot in rescue mode.
3. Remove existing linux-firmware package and install downloaded package.
4. Then Install kernel packages by (rpm -iv kernel*)
5. Reboot
Thanks shruggy, you are a life savor :-)


All times are GMT -5. The time now is 09:07 AM.