0

Problem background: I was reinstalling the nvidia driver. After purging the original driver, I ran sudo apt install nvidia-driver-515 and got an error with the package nvidia-utils-515. The error message asked me to try sudo apt --fix-broken install. I did so, but got another error shown below.

Unpacking nvidia-utils-515 (515.43.04-0ubuntu1) ... dpkg: error processing archive /var/cuda-repo-ubuntu2004-11-7-local/./nvidia-utils-515_515.43.04-0ubuntu1_amd64.deb (--unpack): unable to make backup link of './usr/bin/nvidia-smi' before installing new version: Operation not permitted dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) Errors were encountered while processing: /var/cuda-repo-ubuntu2004-11-7-local/./nvidia-utils-515_515.43.04-0ubuntu1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) 

I searched this problem online, and it seemed that something was wrong with the permission of the file /usr/bin/nvidia-smi. Therefore, I tried to use chattr to change the attributes of this file.

Problem: The original attributes of this file are shown as follows, using lsattr

$ sudo lsattr /usr/bin/nvidia-smi ----ia--------e----- /usr/bin/nvidia-smi 

Then I tried to remove the i attribute by sudo chattr -i /usr/bin/nvidia-smi. However, when using lsattr to examine the attributes again, it shows the same result. That is, the i attribute is not successfully removed.

----ia--------e----- /usr/bin/nvidia-smi 

What I've tried: I have tried entering the root user by sudo su. But it still cannot change the attribute successfully.

Other information: My system is Ubuntu 20.04 LTS. Please let me know if you need any additional information!

By the way, I'm actually not sure if changing the attributes of the file /usr/bin/nvidia-smi is the right way to solve the error in driver installation. If you have any idea of what happened to my nvidia driver, please also let me know. Thank you.

2 Answers 2

0

Try to resolve the conflict manually:

$ sudo dpkg -i --force-overwrite /var/cuda-repo-ubuntu2004-11-7-local/./nvidia-utils-515_515.43.04-0ubuntu1_amd64.deb 

and then run

$ sudo apt --fix-broken install 
1
  • Thank you for this answer. I tried the first command using sudo dpkg -i --force-overwrite, but this command yielded almost the same error as sudo apt --fix-broken install, as follows: dpkg: error processing archive /var/cuda-repo-ubuntu2004-11-7-local/./nvidia-utils-515_515.43.04-0ubuntu1_amd64.deb (--install): unable to make backup link of './usr/bin/nvidia-smi' before installing new version: Operation not permitted Commented Jul 23, 2024 at 14:35
0

The combination of immutable and append-only attributes seems odd: I don't know why you would ever need to set both at the same time.

Apparently there are rootkits that replace nvidia-smi. This might be a variant of such a rootkit, with the attributes added to prevent removal of the rootkit. Neither of thise attributes is normal for nvidia-smi.

You should consider the possibility that your server may have been hacked, and that it might now be under control of an intruder (i.e. compromised). If you think this might have happened, see this question on Server Fault for advice on dealing with a compromised server.

Another possibility is that your filesystem is slightly corrupted, and that has caused those attributes to become set. If this is your root filesystem, you'll probably have to reboot and provide the boot parameters fsck.mode=force and fsck.repair=yes in GRUB. (Reference)

To check non-root filesystems, it is probably also easiest to reboot and select the GRUB option:

Advanced boot options for Ubuntu 

then the line:

Ubuntu, with Linux <your most recent kernel version> (recovery mode) 

When you get the Recovery Menu, select fsck.

See this question with helpful pictures of the procedure.

If the attributes are caused by filesystem corruption, then once the corruption has been fixed, it should be possible to unset those attributes normally.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.