Ubuntu 20.04: apt upgrade installs DKMS, autoremove removes it

  • Thread starter Thread starter Wrichik Basu
  • Start date Start date
  • Tags Tags
    Ubuntu
Click For Summary
SUMMARY

The forum discussion addresses the behavior of DKMS (Dynamic Kernel Module Support) in Ubuntu 20.04 during package upgrades and removals. Users noted that after upgrading packages with sudo apt upgrade, DKMS appears to be installed, while executing sudo apt autoremove subsequently removes it. This behavior is linked to the installation of the proprietary NVIDIA 460 driver, which requires DKMS for managing kernel modules. The confusion arises from the logs indicating DKMS's involvement in the installation and removal of kernel modules rather than its own installation status.

PREREQUISITES
  • Understanding of Ubuntu package management, specifically apt commands.
  • Familiarity with DKMS (Dynamic Kernel Module Support) and its role in managing kernel modules.
  • Knowledge of NVIDIA proprietary drivers and their installation process on Linux.
  • Basic command line skills in Linux environments.
NEXT STEPS
  • Research the function and configuration of DKMS in Ubuntu systems.
  • Learn how to manage NVIDIA drivers on Ubuntu, including installation and removal procedures.
  • Explore the implications of using sudo apt autoremove and its effects on installed packages.
  • Investigate the log files generated during package management operations for deeper insights.
USEFUL FOR

This discussion is beneficial for Linux system administrators, Ubuntu users managing NVIDIA drivers, and developers troubleshooting kernel module issues related to DKMS.

Wrichik Basu
Science Advisor
Insights Author
Gold Member
Messages
2,180
Reaction score
2,690
I wouldn't call this a problem, but every time I upgrade packages via sudo apt upgrade, DKMS is installed. After that, as soon as I execute sudo apt autoremove, DKMS is uninstalled. This has started after I changed the drivers for NVIDIA GeForce MX130 from the open-source X.Org driver to proprietary NVIDIA 460 driver.

Some lines from the terminal:
[CODE lang="bash" title="sudo apt upgrade"]~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-5.8.0-43-generic linux-hwe-5.8-headers-5.8.0-43
linux-image-5.8.0-43-generic linux-modules-5.8.0-43-generic
linux-modules-extra-5.8.0-43-generic
The following packages will be upgraded:
firefox firefox-locale-en gdm3 gir1.2-gdm-1.0 gnome-control-center
gnome-control-center-data gnome-control-center-faces libgdm1
libgnome-autoar-0-0 libldap-2.4-2 libldap-2.4-2:i386 libldap-common
linux-generic-hwe-20.04 linux-headers-generic-hwe-20.04
linux-image-generic-hwe-20.04 snapd
16 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 166 MB of archives.
After this operation, 373 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
# <...Some lines removed...>
Setting up gnome-control-center-faces (1:3.36.5-0ubuntu1) ...
Setting up linux-headers-5.8.0-43-generic (5.8.0-43.49~20.04.1) ...
/etc/kernel/header_postinst.d/dkms:
* dkms: running auto installation service for kernel 5.8.0-43-generic

Kernel preparation unnecessary for this kernel. Skipping...
applying patch disable_fstack-clash-protection_fcf-protection.patch...patching f
ile Kbuild
Hunk #1 succeeded at 85 (offset 14 lines).Building module:
cleaning build area...
unset ARCH; [ ! -h /usr/bin/cc ] && export CC=/usr/bin/gcc; env NV_VERBOSE=1 'ma
ke' -j8 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.8.0-43-generic IGNORE_XEN_PRE
SENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/5.8.0-43-generic/build LD=/usr/
bin/ld.bfd modules......
Signing module:
- /var/lib/dkms/nvidia/460.32.03/5.8.0-43-generic/x86_64/module/nvidia-drm.ko
- /var/lib/dkms/nvidia/460.32.03/5.8.0-43-generic/x86_64/module/nvidia.ko
- /var/lib/dkms/nvidia/460.32.03/5.8.0-43-generic/x86_64/module/nvidia-uvm.ko
- /var/lib/dkms/nvidia/460.32.03/5.8.0-43-generic/x86_64/module/nvidia-modeset.
ko
Secure Boot not enabled on this system.
cleaning build area...

DKMS: build completed.

nvidia.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.8.0-43-generic/updates/dkms/

nvidia-modeset.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.8.0-43-generic/updates/dkms/

nvidia-drm.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.8.0-43-generic/updates/dkms/

nvidia-uvm.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.8.0-43-generic/updates/dkms/

depmod...

DKMS: install completed.
...done.
Setting up linux-modules-extra-5.8.0-43-generic (5.8.0-43.49~20.04.1) ...
Setting up libldap-2.4-2:amd64 (2.4.49+dfsg-2ubuntu1.6) ...
Setting up libldap-2.4-2:i386 (2.4.49+dfsg-2ubuntu1.6) ...
Setting up linux-headers-generic-hwe-20.04 (5.8.0.43.49~20.04.29) ...
Setting up linux-image-generic-hwe-20.04 (5.8.0.43.49~20.04.29) ...
Setting up linux-generic-hwe-20.04 (5.8.0.43.49~20.04.29) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for libglib2.0-0:i386 (2.64.6-1~ubuntu20.04.1) ...
Processing triggers for libglib2.0-0:amd64 (2.64.6-1~ubuntu20.04.1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for systemd (245.4-4ubuntu3.4) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for dbus (1.12.16-2ubuntu2.1) ...
Setting up gir1.2-gdm-1.0:amd64 (3.36.3-0ubuntu0.20.04.3) ...
Setting up gnome-control-center (1:3.36.5-0ubuntu1) ...
Setting up gdm3 (3.36.3-0ubuntu0.20.04.3) ...
Processing triggers for linux-image-5.8.0-43-generic (5.8.0-43.49~20.04.1) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 5.8.0-43-generic
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.8.0-43-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.8.0-43-generic
Found initrd image: /boot/initrd.img-5.8.0-43-generic
Found linux image: /boot/vmlinuz-5.8.0-41-generic
Found initrd image: /boot/initrd.img-5.8.0-41-generic
Found linux image: /boot/vmlinuz-5.8.0-40-generic
Found initrd image: /boot/initrd.img-5.8.0-40-generic
Adding boot menu entry for UEFI Firmware Settings
done
[/CODE][CODE lang="bash" title="sudo apt autoremove"]~$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-headers-5.8.0-40-generic linux-hwe-5.8-headers-5.8.0-40
linux-image-5.8.0-40-generic linux-modules-5.8.0-40-generic
linux-modules-extra-5.8.0-40-generic
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
After this operation, 372 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 287934 files and directories currently installed.)
Removing linux-headers-5.8.0-40-generic (5.8.0-40.45~20.04.1) ...
Removing linux-hwe-5.8-headers-5.8.0-40 (5.8.0-40.45~20.04.1) ...
Removing linux-modules-extra-5.8.0-40-generic (5.8.0-40.45~20.04.1) ...
Removing linux-image-5.8.0-40-generic (5.8.0-40.45~20.04.1) ...
/etc/kernel/prerm.d/dkms:
dkms: removing: nvidia 460.32.03 (5.8.0-40-generic) (x86_64)

-------- Uninstall Beginning --------
Module: nvidia
Version: 460.32.03
Kernel: 5.8.0-40-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

nvidia.ko:
- Uninstallation
- Deleting from: /lib/modules/5.8.0-40-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.nvidia-modeset.ko:
- Uninstallation
- Deleting from: /lib/modules/5.8.0-40-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.nvidia-drm.ko:
- Uninstallation
- Deleting from: /lib/modules/5.8.0-40-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.nvidia-uvm.ko:
- Uninstallation
- Deleting from: /lib/modules/5.8.0-40-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.8.0-40-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.8.0-43-generic
Found initrd image: /boot/initrd.img-5.8.0-43-generic
Found linux image: /boot/vmlinuz-5.8.0-41-generic
Found initrd image: /boot/initrd.img-5.8.0-41-generic
Adding boot menu entry for UEFI Firmware Settings
done
Removing linux-modules-5.8.0-40-generic (5.8.0-40.45~20.04.1) ...
[/CODE]
Why is Ubuntu installing DKMS if it can be removed with autoremove?
 
Computer science news on Phys.org
DKMS is the package that installs and removes kernals. Read the messages logs again: DKMS is not being installed or removed, it is reporting the installation and removal of linux kernal modules.
 
  • Informative
Likes   Reactions: Keith_McClary
pbuk said:
DKMS is the package that installs and removes kernals. Read the messages logs again: DKMS is not being installed or removed, it is reporting the installation and removal of linux kernal modules.
Oh, okay. Actually the following line lead me to believe that DKMS was being installed and uninstalled:
Code:
DKMS: uninstall completed.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
Replies
2
Views
6K