Failure To Update

Please accept my apologies if this question has been asked before. I’ve tried to search for it but, I can’t find any answer to my situation. Probably because I don’t even know what key words to use.

I have 24.04.4 LTS installed on my Dell laptop but, I have absolutely no idea what “desktop environment” I’m using.

In order to keep my system as up-to-date as possible, I have updates set for daily. Don’t get update notifications that often but, that’s my setting. Unfortunately, I am now having a problem with those updates. Every time I get a notification and tell it to install I am now getting a message that “failed to update package”. It doesn’t tell me what package though. So, I go to Terminal and do “sudo apt update” to find the package that wasn’t updated. Problem - I can’t figure out how to update the package that’s listed.

BTW, I really don’t understand how to do command line updates which is why I have been relying on the Software Updater (which worked very well until about a month ago).

I’m using a Dell G3 3579, 16G RAM, Intel® Core™ i7-8750H × 12, NVIDIA GeForce GTX 1050 Ti.

Does anyone have any suggestions on how to fix this?

Thanks in advance.

UPDATE:

This is the result of the command “sudo apt update”:

Hit:1 http://us.archive.ubuntu.com/ubuntu noble InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu noble-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:5 Index of /apps/ubuntu/ noble-apps-security InRelease
Hit:6 https://ppa.launchpadcontent.net/pkgcrosswire/ppa/ubuntu noble InRelease
Hit:7 Index of /apps/ubuntu/ noble-apps-updates InRelease
Hit:8 https://esm.ubuntu.com/infra/ubuntu noble-infra-security InRelease
Hit:9 Index of /infra/ubuntu/ noble-infra-updates InRelease
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
1 package can be upgraded. Run ‘apt list --upgradable’ to see it.
rick@Ric-01:~$ apt list --upgradable
Listing… Done
power-profiles-daemon/noble-updates 0.21-1ubuntu2 amd64 [upgradable from: 0.21-1ubuntu1]
N: There are 2 additional versions. Please use the ‘-a’ switch to see them.

Results of ‘sudo apt upgrade”:

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Calculating upgrade… Done
The following packages were automatically installed and are no longer required:
linux-objects-nvidia-535-6.17.0-40-generic linux-signatures-nvidia-6.17.0-40-generic
Use ‘sudo apt autoremove’ to remove them.
The following packages will be upgraded:
power-profiles-daemon
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 50.2 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu noble-updates/main amd64 power-profiles-daemon amd64 0.21-1ubuntu2 [50.2 kB]
Fetched 50.2 kB in 0s (134 kB/s)
(Reading database … 255269 files and directories currently installed.)
Preparing to unpack …/power-profiles-daemon_0.21-1ubuntu2_amd64.deb …
Unpacking power-profiles-daemon (0.21-1ubuntu2) over (0.21-1ubuntu1) …
Setting up power-profiles-daemon (0.21-1ubuntu2) …
Setting up nvidia-dkms-580 (580.173.02-0ubuntu0.24.04.1) …
update-initramfs: deferring update (trigger activated)
update-initramfs: Generating /boot/initrd.img-7.0.0-28-generic
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
Loading new nvidia-580.173.02 DKMS files…
Error! No write access to DKMS tree at /var/lib/dkms
dpkg: error processing package nvidia-dkms-580 (–configure):
installed nvidia-dkms-580 package post-installation script subprocess returned error exit status 1
Processing triggers for dbus (1.14.10-4ubuntu4.1) …
Processing triggers for man-db (2.12.0-4build2) …
Processing triggers for initramfs-tools (0.142ubuntu25.8) …
update-initramfs: Generating /boot/initrd.img-7.0.0-29-generic
Errors were encountered while processing:
nvidia-dkms-580
E: Sub-process /usr/bin/dpkg returned an error code (1)

Please post the full results, including error messages, of sudo apt update. You may want to follow up with sudo apt upgrade.

2 Likes

This command refreshes the list of available packages. To actually (attempt to) update the packages you need sudo apt upgrade. Do it and post the full output.

1 Like

Not directly related to your question but I would take note of the Nvidia driver version you’re running before you do the upgrade. This can be determined from the first few lines of the output from this command:

nvidia-smi

Ubuntu 24.04.4 recently removed the 535 version of this driver (after Nvidia deprecated it). Now the only version easily available is 580. I believe this is the last version that supports your GTX 1050, and it has shown some issues for other users (myself included). Just something to keep an eye on in case you run into video-related issues after you upgrade.

EDIT: that all assumes you’re running the Nvidia proprietary driver in the first place. If you’re running nouveau, my comments don’t apply. Check it with the commands

lsmod | grep nouveau
lsmod | grep nvidia

Whichever one produces any output will tell you which driver you’re using.

2 Likes

Edited original post. Don’t know if I did it right or not but, there it is.

Driver Version: 580.173.02. If this is an issue, can it be rolled back to a previous version that works?

Not that I’m aware of. But the good news is if that 580 driver is working well for you - no video stuttering or resume from sleep issues that have been reported - you should be good to continue debugging your upgrade issue without concern that Nvidia is going to mess you up. Good luck!

1 Like

Does it exist?

ls -ld /var/lib/dkms

Apparently not.

ls: cannot access ‘/var/lib/dkms’: No such file or directory

Can I create this or do I have to twirl a roasted chicken over my head while dancing in the rain?

And if I can create it, where and how? That question just shows how little I know.

apt install dkms

run this command to install the package.

Don’t say “That question just shows how little I know.” , we all are learners and learn everyday.

2 Likes

The error message is printed by the dkms command. Besides, the dkms package is required by the nvidia-dkms-580 package. Of course, double checking that dkms is installed won’t hurt.

@RickK What is the output of the command

dpkg-query -W dkms

The directory is supposed to be created during dkms package installation.

This should not cause any harm.

On the command line

sudo mkdir /var/lib/dkms

Funnily enough, even though I have the dkms package installed I did not have /var/lib/dkms either. Some other package or script is probably removing it as a cleanup function.

Well, I tried to install dkms and /var/lib/dkms was present immediately after installation. But if multiple users hit the same problem, there must be bug lurking somewhere.

I think I’ve found the culprit at least on my system. I have Virtualbox installed from the Virtualbox.org apt repository. There’s a script called vboxdrv.sh in /usr/lib/virtualbox. I believe it’s usually called when first installing Virtualbox, or updating. In the script there’s this part:

# Enroll signing key if needed.
        if test -n "$HAVE_UPDATE_SECUREBOOT_POLICY_TOOL"; then
            # update-secureboot-policy "expects" DKMS modules.
            # Work around this and talk to the authors as soon
            # as possible to fix it.
            mkdir -p /var/lib/dkms/vbox-temp
            update-secureboot-policy --enroll-key 2>/dev/null ||
                begin_msg "Failed to enroll secure boot key." console
            rmdir -p /var/lib/dkms/vbox-temp 2>/dev/null

            # Indicate that key has been enrolled and reboot is needed.
            HAVE_DEB_KEY=true
        fi
        succ_msg "Signing completed"
    fi

If you have dkms installed, but no modules are set to be built, then /var/lib/dkms is empty. When vboxdrv.sh executes to enroll a signing key, it creates /var/lib/dkms/vbox-temp, does the thing with update-secureboot-policy, and then deletes /var/lib/dkms/vbox-temp. Trouble is, rmdir -p removes the parent directories to vbox-temp and since /var/lib/dkms was previously empty is gets removed as well. I’m going to file a bug report with Virtualbox.org about this. So perhaps OP has Virtualbox from Virtualbox.org installed also? If not, then something else is going on.

1 Like

Hi. Sorry for taking so long to respond, been out of town and away from Internet.

I tried doing “apt install dkms” but it wouldn’t take. Accidentally discovered that dkms was available through the App Center so tried that. Then went back to command line and ran the command you suggested. Response was “already installed”.

This will eliminate the “failed to install package” error?

I absolutely do have VirtualBox installed for viewing vehicle manuals. I installed dkms from App Center since I couldn’t get it to work in Terminal. Then went back to terminal and entered the command sagarkundri29 suggested. The response was that dkms was already installed. So, hopefully, this is the cure.

After installing dkms from App Center and running dpkg-query -W dkms I get the following:

dkms 3.0.11-1ubuntu13

This is good news, yes??

apologies for delay.

@RickK the output is expected based on dkms version installed. dkms is needed for signing modules not default available/shipped with OS.

Now that dkms is installed, would be good idea to flush off apt cache and do the update

apt clean && apt update && apt upgrade

let me know what is the output of above please.

This is what I got after running that string of commands:

root@Ric-01:/home/rick# apt clean && apt update && apt upgrade
Get:1 Index of /ubuntu noble-security InRelease [126 kB]
Hit:2 Index of /ubuntu noble InRelease
Get:3 Index of /ubuntu noble-updates InRelease [126 kB]
Hit:4 Index of /ubuntu noble-backports InRelease
Get:5 Index of /ubuntu noble-security/main amd64 Packages [952 kB]
Get:6 Index of /apps/ubuntu/ noble-apps-security InRelease [8,371 B]
Get:7 Index of /ubuntu noble-security/universe amd64 Packages [1,201 kB]
Get:8 Index of /apps/ubuntu/ noble-apps-updates InRelease [8,220 B]
Get:9 Index of /ubuntu noble-updates/universe amd64 Packages [1,683 kB]
Hit:10 Index of /pkgcrosswire/ppa/ubuntu noble InRelease
Get:11 Index of /infra/ubuntu/ noble-infra-security InRelease [8,235 B]
Get:12 Index of /infra/ubuntu/ noble-infra-updates InRelease [8,213 B]
Fetched 4,121 kB in 1s (3,855 kB/s)
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
All packages are up to date.
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@Ric-01:/home/rick#

Thank you to everyone who has provided me with help on this issue. Using all of the suggestions has resulted in a better understanding of Ubuntu and, what’s even better, my computer doesn’t spew it’s innards when getting software updates!

Thanks again for your patience, your help, and your understaning.

1 Like