Sample Header Ad - 728x90

Cannot change file permission of "/usr/bin/nvidia-smi" via "chattr"

0 votes
2 answers
195 views
**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.
Asked by jsonr (1 rep)
Jul 23, 2024, 01:58 PM
Last activity: Jul 23, 2024, 08:38 PM