Bug 2274356 - `dnf erase kernel-core` fails while running the preuninstall scriptlet
Summary: `dnf erase kernel-core` fails while running the preuninstall scriptlet
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 40
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: dracut-maint-list
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2277707 2278981 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-10 14:37 UTC by Cristian Ciupitu
Modified: 2024-05-21 10:49 UTC (History)
30 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Cristian Ciupitu 2024-04-10 14:37:59 UTC
1. Please describe the problem:
Uninstalling kernel-core fails the first time, but it works the second time.


2. What is the Version-Release number of the kernel:

kernel-core-6.8.2-300.fc40.x86_64
dracut-060-1.fc40.x86_64
dracut-live-060-1.fc40.x86_64
dracut-network-060-1.fc40.x86_64
dracut-squash-060-1.fc40.x86_64
dracut-tools-060-1.fc40.x86_64



3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  Old kernels are available for download at
   https://koji.fedoraproject.org/koji/packageinfo?packageID=8 :

I think so.



4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:

# dnf --enablerepo='*-testing' -y erase kernel-core-6.8.2-300.fc40.x86_64
Dependencies resolved.
==============================================================================================
 Package                         Architecture    Version           Repository             Size
==============================================================================================
Removing:
 kernel-core                     x86_64          6.8.2-300.fc40    @updates-testing       66 M
Removing dependent packages:
 kernel                          x86_64          6.8.2-300.fc40    @updates-testing        0
 kernel-modules                  x86_64          6.8.2-300.fc40    @updates-testing       58 M
 kernel-modules-core             x86_64          6.8.2-300.fc40    @updates-testing       32 M
 kernel-modules-extra            x86_64          6.8.2-300.fc40    @updates-testing      2.4 M

Transaction Summary
==============================================================================================
Remove  5 Packages

Freed space: 159 M
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                    1/1
  Erasing          : kernel-modules-extra-6.8.2-300.fc40.x86_64         1/5
  Running scriptlet: kernel-modules-extra-6.8.2-300.fc40.x86_64         1/5
  Erasing          : kernel-6.8.2-300.fc40.x86_64                       2/5
  Running scriptlet: kernel-6.8.2-300.fc40.x86_64                       2/5
  Erasing          : kernel-modules-6.8.2-300.fc40.x86_64               3/5
  Running scriptlet: kernel-modules-6.8.2-300.fc40.x86_64               3/5
  Erasing          : kernel-modules-core-6.8.2-300.fc40.x86_64          4/5
  Running scriptlet: kernel-core-6.8.2-300.fc40.x86_64                  5/5
rm: cannot remove '/boot/efi/cde44f2e256c4d7f816b58632df8afa1/6.8.2-300.fc40.x86_64/': Is a directory
/usr/lib/kernel/install.d/50-dracut.install failed with exit status 1.
error: %preun(kernel-core-6.8.2-300.fc40.x86_64) scriptlet failed, exit status 1

Error in PREUN scriptlet in rpm package kernel-core
error: kernel-core-6.8.2-300.fc40.x86_64: erase failed


Removed:
  kernel-6.8.2-300.fc40.x86_64        kernel-modules-6.8.2-300.fc40.x86_64        kernel-modules-core-6.8.2-300.fc40.x86_64        kernel-modules-extra-6.8.2-300.fc40.x86_64
Failed:
  kernel-core-6.8.2-300.fc40.x86_64

Error: Transaction failed


# dnf --enablerepo='*-testing' -y erase kernel-devel-6.8.1-300.fc40.x86_64 kernel-devel-6.8.2-300.fc40.x86_64
...


# dnf --enablerepo='*-testing' -y erase kernel-core-6.8.2-300.fc40.x86_64
Dependencies resolved.
==============================================================================================
 Package                         Architecture    Version           Repository             Size
==============================================================================================
Removing:
 kernel-core                     x86_64          6.8.2-300.fc40    @@System               66 M

Transaction Summary
==============================================================================================
Remove  1 Package

Freed space: 66 M
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                    1/1
  Running scriptlet: kernel-core-6.8.2-300.fc40.x86_64                  1/1
  Erasing          : kernel-core-6.8.2-300.fc40.x86_64                  1/1
  Running scriptlet: kernel-core-6.8.2-300.fc40.x86_64                  1/1

Removed:
  kernel-core-6.8.2-300.fc40.x86_64

Complete!



5. Does this problem occur with the latest Rawhide kernel? To install the
   Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by
   ``sudo dnf update --enablerepo=rawhide kernel``:

I have no idea.



6. Are you running any modules that not shipped with directly Fedora's kernel?:

NO



7. Please attach the kernel logs. You can get the complete kernel log
   for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the
   issue occurred on a previous boot, use the journalctl ``-b`` flag.

N/A

Reproducible: Always

Comment 1 Cristian Ciupitu 2024-04-11 11:47:26 UTC
It's still happening with 6.8.4-300.fc40

# dnf --enablerepo='*-testing' -y erase kernel-core-6.8.4-300.fc40.x86_64
Dependencies resolved.
==============================================================================
 Package                     Architecture   Version          Repository   Size
==============================================================================
Removing:
 kernel-core                 x86_64         6.8.4-300.fc40   @fedora      66 M
Removing dependent packages:
 kernel                      x86_64         6.8.4-300.fc40   @fedora       0
 kernel-modules              x86_64         6.8.4-300.fc40   @fedora      58 M
 kernel-modules-core         x86_64         6.8.4-300.fc40   @fedora      32 M
 kernel-modules-extra        x86_64         6.8.4-300.fc40   @fedora     2.4 M

Transaction Summary
==============================================================================
Remove  5 Packages

Freed space: 159 M
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                     1/1
  Erasing          : kernel-modules-extra-6.8.4-300.fc40.x86_64          1/5
  Running scriptlet: kernel-modules-extra-6.8.4-300.fc40.x86_64          1/5
  Erasing          : kernel-6.8.4-300.fc40.x86_64                        2/5
  Running scriptlet: kernel-6.8.4-300.fc40.x86_64                        2/5
  Erasing          : kernel-modules-6.8.4-300.fc40.x86_64                3/5
  Running scriptlet: kernel-modules-6.8.4-300.fc40.x86_64                3/5
  Erasing          : kernel-modules-core-6.8.4-300.fc40.x86_64           4/5
  Running scriptlet: kernel-core-6.8.4-300.fc40.x86_64                   5/5
rm: cannot remove '/boot/efi/cde44f2e256c4d7f816b58632df8afa1/6.8.4-300.fc40.x86_64/': Is a directory
/usr/lib/kernel/install.d/50-dracut.install failed with exit status 1.
error: %preun(kernel-core-6.8.4-300.fc40.x86_64) scriptlet failed, exit status 1

Error in PREUN scriptlet in rpm package kernel-core
error: kernel-core-6.8.4-300.fc40.x86_64: erase failed


Removed:
  kernel-6.8.4-300.fc40.x86_64                     kernel-modules-6.8.4-300.fc40.x86_64       kernel-modules-core-6.8.4-300.fc40.x86_64
  kernel-modules-extra-6.8.4-300.fc40.x86_64
Failed:
  kernel-core-6.8.4-300.fc40.x86_64

Error: Transaction failed



# dnf --enablerepo='*-testing' -y erase kernel-core-6.8.4-300.fc40.x86_64
Dependencies resolved.
==============================================================================
 Package                     Architecture   Version          Repository   Size
==============================================================================
Removing:
 kernel-core                 x86_64         6.8.4-300.fc40   @@System     66 M

Transaction Summary
==============================================================================
Remove  1 Package

Freed space: 66 M
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                     1/1
  Running scriptlet: kernel-core-6.8.4-300.fc40.x86_64                   1/1
  Erasing          : kernel-core-6.8.4-300.fc40.x86_64                   1/1
  Running scriptlet: kernel-core-6.8.4-300.fc40.x86_64                   1/1

Removed:
  kernel-core-6.8.4-300.fc40.x86_64

Complete!

Comment 2 Justin M. Forbes 2024-04-11 12:50:28 UTC
Oddly enough, the install/uninstall scripts are not a part of the kernel package, they are simply calling /bin/kernel-install which is part of systemd.

Comment 3 Cristian Ciupitu 2024-04-12 08:47:38 UTC
It's still happening with
kernel-core-6.8.5-300.fc40.x86_64
systemd-255.4-1.fc40.x86_64
systemd-udev-255.4-1.fc40.x86_64

Comment 4 Cristian Ciupitu 2024-04-14 12:20:46 UTC
It's still happening with
kernel-core-6.8.5-301.fc40.x86_64
systemd-255.4-1.fc40.x86_64
systemd-udev-255.4-1.fc40.x86_64

Comment 5 David Tardon 2024-04-22 14:41:40 UTC
/usr/lib/kernel/install.d/50-dracut.install is a part of dracut.

Comment 6 David Tardon 2024-05-10 06:20:09 UTC
*** Bug 2278981 has been marked as a duplicate of this bug. ***

Comment 7 David Tardon 2024-05-10 06:20:49 UTC
*** Bug 2277707 has been marked as a duplicate of this bug. ***

Comment 8 Cristian Ciupitu 2024-05-21 10:49:24 UTC
It's still happening with dracut-101-1.fc40.x86_64


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