I have a dual-boot machine with Windows8 and Ubuntu 20.04.3 LTS.
It worked fine up until I pressed Yes (install) to some automatic updates from Ubuntu via the GUI pop-up window.
These updates failed at around 70%.
The problem is with nVidia drivers.
My motherboard is GT216 (GeForce GT 220).
Running ubuntu-drivers devices
I get:
driver: nvidia-340 - distro non-free recommended
driver: xserver-xorg-video-nouveau -distro free builtin.
After I shut down the computer after that failed update, at restart I got a login-infinite loop at the login screen (entered password, no login into Gnome Desktop, asked for password again, entered it again, no login into Gnome Desktop, repeat).
I researched online and I found out that the nvidia-340 drivers are not compatible with my current kernel version.
Using tty
terminals I worked through this tutorial https://www.if-not-true-then-false.com/2020/inttf-nvidia-patcher/ and then I installed nvidia-340 by running the executable I got via the tutorial. I followed the steps from here: https://www.if-not-true-then-false.com/2021/debian-ubuntu-linux-mint-nvidia-guide/#before-installation. I can now login into Gnome.
Problem:
All my graphics programs are destroyed.
In the past when my machine was functioning properly, I had installed Qt5 and linked against a framework I use for work. Now that framework doesn't function anymore, I cannot compile programs against the visualization drivers anymore.
I tried to reinstall the visualization drivers again, as I did 3-4 months ago on the same machine (when I successfully set up that framework I use for work): but I fail at the very first step:
sudo apt install qt5-default
Removing nvidia-340 (340.108-0ubuntu5.20.04.2)...
/var/lib/dpkg/info/nvidia-340.postrm: 59: /usr/sbin/update-initramfs: not found
dpkg: error processing package nvidia-340 (--remove):
installed nvidia-340 package post-removal script subprocess returned error exit status 127
dpkg: too many errors, stopping
Errors were encountered while processing:
nvidia-340
Processing was halted because there were too many errorrs.
E: Sub-process /usr/bin/dpkg reurned an error code (1).
Attemtps I did:
I have tried to do what it's written in here Ubuntu 18.10 problem with Nvidia 340 drivers
I have tried to run sudo apt-get install nvidia-current
: E : Package 'nvidia-current' has no installation candidate
I have tried to switch to Nouveau from the Applications -> Software & Updates -> Additional Drivers, but it doesn't work. When I click to switch to that, Error while applying changes: pk-client-error-quark: Error while installing package: installed nvidia-340 package post-removal script subprocess returned error exit status 127 (313)
I have tried to run nvidia-settings
-> this pops up a new window with various information, which I can provide if needed.
I have tried to run sudo apt-ache policy nvidia-340
-> this returns nvidia -340 : Installed : 340-108-0ubuntu5.20.04.2 candidate : 340-108-0ubuntu5.20.04.2 ... etc
I have tried to run which nvidia-smi
-> this returns nothing
6') I have tried to run nvidia-smi
-> returns 'nvidia-smi' command nout found, can be installed with: and here appears a list of nvidia drivers it recommends installing via sudo apt install nvidia-XYZ or sudo apt install nvidia-utils-XYZ.
I have tried to run sudo ubuntu-drivers autoinstall
-> this returns the same thing as before: The following packages will be removed: nvidia-340
Removing nvidia-340 ...
dpkg: error processing package nvidia-340 (--remove):
installed nvidia-340 package post-removal script subprocess returned error exit status 127
dpkg: too many errors, stopping
Errors were encountered while processing:
nvidia-340
...
I have tried to run sudo apt-get install nvidia-340
-> this returns that nvidida-340 is already the newest version (340.108-0ubuntu5.20.04.2)
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 52,0 MB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue ? Yes Y
Get: 1 ...
Fetched 52,0 MB in 2 s
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
and here I don't get any more returned statements and I just get a new line on the terminal to enter a new command as in $ > ... (so process exits alright and I can just continue doing stuff).
When writing (to configure my framework again) sudo apt install qt5-default
I again get the same errors as above (in the Problem section)
Do you know what is happening or what shall I do?
I really want to be able to compile applications again and run them on my machine.
I can provide any necessary info which might be useful to solve my problem.
Thank you in advance!
Edit (new info):
My current kernel version which appears as output when running uname -r
is:
5.11.0-36-generic