Score:0

error processing package nvidia-340: I've fixed the problem but I can't use apt-get

rs flag

I'm a bit newbie with ubuntu and I'm trying to use it in a really old laptop with hybrid video using an old NVIDIA GeForce 310M

after install and reboot I get a black screen so I had to reboot using nomodeset, after some research I found that I need install nvidia-340 and nvidia-prime (I found this in an old article)

sudo apt-get install nvidia-340 nvidia-prime

this doesn´t work because this can't be installed in new kernels

after another research I found that installing another kernel I'll be able to solve the issue

sudo apt-get purge bumblebee nvidia*

sudo apt install --install-recommends linux-generic

after this I ran again

sudo apt-get install nvidia-340 nvidia-prime

reboot my machine and seems to be working pretty fine...but now when I try to install any software appears this

sudo apt install snapd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
snapd is already the newest version (2.51.1+20.04ubuntu2).
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
0 upgraded, 0 newly installed, 0 to remove and 99 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up nvidia-340 (340.108-0ubuntu5.20.04.2) ...
dpkg: error: version '-' has bad syntax: revision number is empty
dpkg: error: version '-' has bad syntax: revision number is empty
dpkg: error: version '-' has bad syntax: revision number is empty
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia-340
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
Removing old nvidia-340-340.108 DKMS files...

------------------------------
Deleting module version: 340.108
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-340-340.108 DKMS files...
Building for 5.11.0-46-generic 5.13.0-28-generic
Building for architecture x86_64
Module build for kernel 5.11.0-46-generic was skipped since the
kernel headers for this kernel does not seem to be installed.
Building initial module for 5.13.0-28-generic
Error! Bad return status for module build on kernel: 5.13.0-28-generic (x86_64)
Consult /var/lib/dkms/nvidia-340/340.108/build/make.log for more information.
dpkg: error processing package nvidia-340 (--configure):
 installed nvidia-340 package post-installation script subprocess returned error exit status 10
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.13.0-28-generic
Errors were encountered while processing:
 nvidia-340 33%] [#############################...........................................................] 
E: Sub-process /usr/bin/dpkg returned an error code (1)

this line is really weird

Building for 5.11.0-46-generic 5.13.0-28-generic

seems that I've both kernels, that is true?

running uname I get this

uname -srm Linux 5.11.0-46-generic x86_64

what is the right way to uninstall the previous kernel? is just enought?

sudo apt-get purge *5.13.0-28-generic?

I really want to keep my system as it's running now because it doesn't feel laggy or buggy as it was with the nomodeset enable

hope you can give me the best recommendation here

thank you guys

guiverc avatar
cn flag
You haven't provided any OS & release details; at a guess I'd say *focal* or 20.04 using HWE. 5.11 is now an *unsupported* and thus *unpatched* kernel for 20.04; as no supported release of Ubuntu uses it any longer, supported kernels for 20.04 are GA = 5.4 & HWE = 5.13; 5.11 being the kernel of 20.04.3 but 20.04.4 is rolling out currently (which includes the HWE 5.13 kernel). The 5.11 is an older & now *unsupported* HWE kernel.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.