Dpkg: warning: while removing nvhpc-22-7, directory '/opt/nvidia/hpc_sdk/Linux_x86_64/22.7/compilers/bin' not empty so not removed

Hello,

I got the following warning when updating nvhpc from 22.7 to 22.9 using apt update && apt upgrade && apt autoremove:

The following packages will be REMOVED:
nvhpc-22-7
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 10.3 GB disk space will be freed.
(Reading database … 141360 files and directories currently installed.)
Removing nvhpc-22-7 (22.7) …
dpkg: warning: while removing nvhpc-22-7, directory ‘/opt/nvidia/hpc_sdk/Linux_x86_64/22.7/compilers/bin’ not empty so not removed

  1. Should I just run rm -rf /opt/nvidia/hpc_sdk/Linux_x86_64/22.7 to remove the old version?
  2. If so, can the autoremove script be updated to delete the directory even though it’s not empty?

I am using Ubuntu 20.04.5 LTS (Focal Fossa) through WSL2 on Windows 10.

Hi sweemer,

The warning is expected. The compiler’s configuration file, “localrc”, gets created on installation. However given it’s not part of the original package, the package manager doesn’t delete it.

  1. Should I just run rm -rf /opt/nvidia/hpc_sdk/Linux_x86_64/22.7 to remove the old version?

Yes, that’s fine.

  1. If so, can the autoremove script be updated to delete the directory even though it’s not empty?

I’m not sure, so will need to ask our manufacturing team.

-Mat

Thanks Mat. I think that if the installation adds new files that are not part of the original package, then those files should be removed as part of the upgrade. Otherwise each update might increase the disk usage by another 10 Gb!