Ubuntu 20.04: apt upgrade installs DKMS, autoremove removes it

  • Thread starter Wrichik Basu
  • Start date
  • Tags
    Ubuntu
In summary, after changing the drivers for NVIDIA GeForce MX130, DKMS is installed every time the packages are upgraded via sudo apt upgrade. However, it is also automatically uninstalled when sudo apt autoremove is executed. This is because DKMS is used for installing and removing kernel modules, which is necessary when updating or removing kernel versions. It is a normal part of the package management process and is not a problem.
  • #1
Wrichik Basu
Science Advisor
Insights Author
Gold Member
2,116
2,691
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:
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
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) ...
Why is Ubuntu installing DKMS if it can be removed with autoremove?
 
Computer science news on Phys.org
  • #2
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 Keith_McClary
  • #3
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.
 

1. What is DKMS and why does it get installed during the apt upgrade for Ubuntu 20.04?

DKMS stands for Dynamic Kernel Module Support and it is a tool used in Linux to help manage and rebuild kernel modules when the kernel is updated. It gets installed during the apt upgrade to ensure that all kernel modules are updated and compatible with the new kernel version.

2. Why does autoremove remove DKMS after it was just installed?

Autoremove is a command used to remove packages that are no longer needed or have become obsolete. Since DKMS is only needed during the upgrade process to update kernel modules, it is considered no longer necessary after the upgrade is complete and therefore gets removed by autoremove.

3. Will removing DKMS affect my system's performance?

No, removing DKMS will not affect your system's performance. DKMS is only used during the upgrade process and is not needed for regular system operation.

4. Can I reinstall DKMS after it has been removed by autoremove?

Yes, you can reinstall DKMS if needed. However, it will only be necessary again if you perform another kernel upgrade. If you do not plan on upgrading your kernel, DKMS does not need to be reinstalled.

5. Is it safe to skip the apt upgrade for Ubuntu 20.04 if I do not want DKMS to be automatically installed?

No, it is not recommended to skip the apt upgrade for Ubuntu 20.04. Upgrading your system is important for security and stability reasons. DKMS is a necessary tool for updating kernel modules and skipping the upgrade process could leave your system vulnerable to security threats.

Similar threads

  • Computing and Technology
Replies
5
Views
223
Replies
2
Views
5K
Back
Top