Comment 3 for bug 1967058

Revision history for this message
Steve Carter (iamsierracharlie) wrote : Re: package nvidia-kernel-common-510 510.54-0ubuntu0.20.04.1 failed to install/upgrade: trying to overwrite '/usr/bin/nvidia-powerd', which is also in package nvidia-compute-utils-510 510.47.03-0ubuntu1

New here but thought I would add my experience.
I hit the same issue - possibly caused by adding an nvidia repo when you already have cuda / nvidia packages installed.

Condition - you try to upgrade to a later version of nvidia driver or cuda related package set
you end up being asked to run "sudo apt --fix-broken install" to try and address it but are stuck on "ErrorMessage: trying to overwrite '/usr/bin/nvidia-powerd', which is also in package nvidia-compute-utils-510 510.47.03-0ubuntu1"

I saw the exact same issue and my workaround was:

1. remove the last Nvidia / Cuda repo you installed. (i went to /etc/apt/sources.list.d/ and simply removed the nvidia package there - in my case, I ran sudo rm cuda-ubuntu2004-11-8-local.list)
2. Then run sudo apt update
2. Then purge any Cuda packages -> sudo apt purge cuda*
3. Then purge any Nvidia packages -> sudo apt purge nvidia*
4. add the intended nvidia or cuda repo -> sudo dpkg -i <your package>
5. Do anything else required - in my case, add the keyring.gpg
6. update -> sudo apt update
7. install the desired package

I hope this helps someone.