Bug 31799 - urpme --auto-orphans would remove the current kernel if a newer is installed
Summary: urpme --auto-orphans would remove the current kernel if a newer is installed
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords:
: 31848 33181 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-04-14 21:24 CEST by GG HH
Modified: 2024-05-21 17:31 CEST (History)
4 users (show)

See Also:
Source RPM: urpmi-8.131-1.mga9.src.rpm
CVE:
Status comment:


Attachments
Testcase with 8 installed kernels (55.63 KB, text/plain)
2023-04-16 00:17 CEST, sturmvogel
Details

Description GG HH 2023-04-14 21:24:06 CEST
# rpm -q -a |grep kernel-desktop|sort
kernel-desktop-6.2.10-1.mga9
kernel-desktop-6.2.10-2.mga9
kernel-desktop-devel-6.2.10-1.mga9
kernel-desktop-devel-6.2.10-2.mga9
kernel-desktop-latest-6.2.10-2.mga9

# uname -a
Linux uranus 6.2.10-desktop-1.mga9 #1 SMP PREEMPT_DYNAMIC Thu Apr  6 18:57:48 UTC 2023 x86_64 GNU/Linux

# LANG=C urpme --auto-orphans 
writing /var/lib/rpm/installed-through-deps.list
To satisfy dependencies, the following package will be removed (87MB):
  
(orphan package)
  kernel-desktop-6.2.10-1.mga9.x86_64
Remove 1 package? (y/N) n

# rpm -q --changelog urpmi
* jeu. avril 13 2023 tv <tv> 8.131-1.mga9
+ Revision: 1952885
- urpmi:
  o Fix --auto-orphans vs new kernel naming
    (having multuple "kernel" pkgs with different versions)
GG HH 2023-04-14 21:24:18 CEST

CC: (none) => boulshet

Comment 1 marc fanjoux 2023-04-15 19:56:14 CEST
[marco@localhost ~]$ uname -r
6.2.10-desktop-2.mga9

[root@localhost ~]# rpm -q -a |grep kernel-desktop|sort
kernel-desktop-6.2.10-1.mga9
kernel-desktop-6.2.10-2.mga9
kernel-desktop-6.2.8-1.mga9
kernel-desktop-latest-6.2.10-2.mga9

(paquetages orphelins)
  kernel-desktop-6.2.10-1.mga9.x86_64
  kernel-desktop-6.2.10-2.mga9.x86_64
  kernel-desktop-6.2.8-1.mga9.x86_64
Supprimer 3 paquetages ? (o/N)

CC: (none) => marcounet

Comment 2 Lewis Smith 2023-04-15 20:04:27 CEST
Thank you for the reports.
@GG HH
Can we take it that this problem is new since the recent urpmi update you note?
Assuming this to be the case, assigning to tv who did that.

I have never before seen a kernel in a "urpme --auto-orphans" list; this must be special to more than 1 version of the same kernel.
As an aside, old kernel removal is now best done with our new 'remove-old-kernels' package.

Assignee: bugsquad => thierry.vignaud

Comment 3 GG HH 2023-04-15 22:17:22 CEST
Hi Lewis,

before this update, the running kernel was not removed by urpme --auto-orphans. 
It looks sensible as the last kernel could be failing to boot and this situation may be a bit tricky to cope with for an average user.

The use case is:
- upgrade the packages, a kernel upgrade is part of the update
- remove deprecated versions. with this update, the running kernel is remmoved.
- reboot
the only available kernel is the new one. It may not boot. if so no fallback is available.

More over, i assume that modules which would not be already loaded would not be available until reboot.

Reading marc answer : it looks like actually all installed kernel would be removed - urpme line is probably missing.
Strange. I do not have rebooted my self.

Regards
Comment 4 sturmvogel 2023-04-16 00:17:44 CEST
Created attachment 13767 [details]
Testcase with 8 installed kernels

There is no risk that a kernel get removed. I did a intense testcase with an cauldron Virtualbox installation with 8 installed kernels. But the output of "urpme --auto-orphans" is misleading and may confuse new unexperienced users. 

Short testcase summary:
- update cauldron (latest kernel-desktop-6.2.11-1.mga9.x86_64 gets installed)
- NO restart of computer
- "uname -r" shows still 6.2.10-desktop-2.mga9 as active
- "rpm -q -a |grep kernel-desktop|sort" shows 8 installed kernels
- "urpme --auto-orphans" lists ALL kernels to remove (with many other pcks as it is a grown VB installation)
- let "urpme --auto-orphans" remove ALL packages including ALL kernels
- restart computer
- "uname -r" shows now 6.2.11-desktop-1.mga9 as active
- "rpm -q -a |grep kernel-desktop|sort" shows still all 8 kernels installed 
- "urpme --auto-orphans" does no longer list any kernels to remove

As "urpme --auto-orphans" is no longer capable of removing kernels due to the new naming, it only "deletes" or clears the orphans list but doesn't uninstall any kernel. Kernel removal in MGA 9 is now automatically done by the new remove-old-kernels tool.

As the output is a little bit longer i attached the complete terminal output of the upper testcase as proof that there is no risk of loosing a kernel.
Comment 5 Jean Michel Varvou 2023-04-16 10:46:06 CEST
I have a problematic behavior similar to the one described by Thierry.  I installed mageia 9 via a net installation.

[root@localhost ~]# rpm -qa |grep -E "kernel|dkms" 
kernel-firmware-20230210-1.mga9
kernel-desktop-6.2.10-2.mga9
kernel-firmware-nonfree-20230406-1.mga9.nonfree
remove-old-kernels-0.99.21.6-1.mga9
dkms-minimal-2.0.19-45.mga9
kernel-desktop-devel-6.2.10-2.mga9
dkms-2.0.19-45.mga9
dkms-nvidia-current-525.105.17-1.mga9.nonfree
kernel-desktop-6.2.11-1.mga9
kernel-desktop-devel-6.2.11-1.mga9
kernel-desktop-latest-6.2.11-1.mga9
kernel-userspace-headers-6.2.11-1.mga9


[root@localhost ~]# urpme --auto-orphans
Pour satisfaire les dépendances, les 3 paquetages suivants vont être désinstallés (108Mo):
(paquetages orphelins)
  kernel-desktop-devel-6.2.10-2.mga9.x86_64
  kernel-desktop-devel-6.2.11-1.mga9.x86_64
  lib64pulsecore16.1-16.1-14.mga9.x86_64
Supprimer 3 paquetages ? (o/N) 


The removal of kernel-desktop-devel is problematic as it is used for dkms for the proprietary driver nvidia....Unless headers are enough, but I haven't had this behavior historically since I've been using mageia.

CC: (none) => jeanmichel.varvou

Comment 6 GG HH 2023-04-16 13:38:24 CEST
# LANG=C urpme --auto-orphans 
writing /var/lib/rpm/installed-through-deps.list
To satisfy dependencies, the following package will be removed (87MB):
  
(orphan package)
  kernel-desktop-6.2.10-1.mga9.x86_64
Remove 1 package? (y/N) n

imho _this_ is not just confusing for new unexperienced users.
It is plain wrong if it does not what it says it will.

Regards.
Comment 7 sturmvogel 2023-04-28 10:49:42 CEST
*** Bug 31848 has been marked as a duplicate of this bug. ***

CC: (none) => mageia

Comment 8 GG HH 2023-05-07 20:34:20 CEST
# urpmq -ir --auto-orphans
kernel-desktop-6.3.1-1.mga9

# rpm -q --requires kernel-desktop-latest
kernel-desktop-6.3.1-1.mga9
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1
Comment 9 GG HH 2024-05-16 19:08:43 CEST
@Lewis Smith : do you need additional info about this issue ?
Comment 10 Marc Krämer 2024-05-21 17:31:07 CEST
*** Bug 33181 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.