1

I just inherited a laptop with a broken cuda install and am trying to deal with it without wiping and reinstalling ubuntu20.

jeremy@jeremy-Blade:~/Dropbox/projects/PycharmProjects/robot_arm/ssd.pytorch$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  cuda-command-line-tools-10-2 cuda-compiler-10-2 cuda-cudart-10-2 cuda-cudart-dev-10-2 cuda-cufft-10-2 cuda-cufft-dev-10-2 cuda-cuobjdump-10-2
  cuda-cupti-10-2 cuda-cupti-dev-10-2 cuda-curand-10-2 cuda-curand-dev-10-2 cuda-cusolver-10-2 cuda-cusolver-dev-10-2 cuda-cusparse-10-2
  cuda-cusparse-dev-10-2 cuda-demo-suite-10-2 cuda-documentation-10-2 cuda-driver-dev-10-2 cuda-drivers cuda-gdb-10-2 cuda-libraries-10-2
  cuda-libraries-dev-10-2 cuda-license-10-2 cuda-memcheck-10-2 cuda-misc-headers-10-2 cuda-npp-10-2 cuda-npp-dev-10-2 cuda-nsight-10-2
  cuda-nsight-compute-10-2 cuda-nsight-systems-10-2 cuda-nvcc-10-2 cuda-nvdisasm-10-2 cuda-nvgraph-10-2 cuda-nvgraph-dev-10-2 cuda-nvjpeg-10-2
  cuda-nvjpeg-dev-10-2 cuda-nvml-dev-10-2 cuda-nvprof-10-2 cuda-nvprune-10-2 cuda-nvrtc-10-2 cuda-nvrtc-dev-10-2 cuda-nvtx-10-2 cuda-nvvp-10-2
  cuda-runtime-10-2 cuda-samples-10-2 cuda-sanitizer-api-10-2 cuda-tools-10-2 cuda-visual-tools-10-2 freeglut3 freeglut3-dev gir1.2-geocodeglib-1.0
  libcublas-dev libcublas10 libfwup1 libglu1-mesa-dev libxmu-dev libxmu-headers libxt-dev nsight-compute-2019.5.0 nsight-systems-2019.5.2
  nvidia-modprobe ubuntu-web-launchers
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libcublas-dev
The following NEW packages will be installed:
  libcublas-dev
0 upgraded, 1 newly installed, 0 to remove and 170 not upgraded.
74 not fully installed or removed.
Need to get 42.3 MB of archives.
After this operation, 114 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  libcublas-dev 10.2.2.89-1 [42.3 MB]
Fetched 42.3 MB in 18s (2,392 kB/s)                                                                                                                      
(Reading database ... 298525 files and directories currently installed.)
Preparing to unpack .../libcublas-dev_10.2.2.89-1_amd64.deb ...
Unpacking libcublas-dev (10.2.2.89-1) ...
dpkg: error processing archive /var/cache/apt/archives/libcublas-dev_10.2.2.89-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/nvblas.h', which is also in package nvidia-cuda-dev 9.1.85-3ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libcublas-dev_10.2.2.89-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Some things I've tried:

jeremy@jeremy-Blade:~/Dropbox/projects/PycharmProjects/robot_arm/ssd.pytorch$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cuda-libraries-dev-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not installed
 cuda-samples-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not installed
 cuda-visual-tools-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

and then

 1844  sudo rm /var/cache/apt/archives/libcublas*
 1845  sudo rm /usr/include/nvblas.h
 1846  sudo apt --fix-broken install
 1847  sudo apt-get purge libcublas*
 1848  sudo apt-get purge libcublas10
 1849  sudo apt-get purge libcublas9.1
 1850  sudo apt-get remove libcublas9.1
 1851  sudo apt-get remove libcublas10
 1852  sudo rm /usr/include/nvblas.h
 1853  sudo rm /var/cache/apt/archives/libcublas*
 1854  sudo rm /var/cache/apt/archives/libnvidia-*
 1855  sudo apt-get purge libcublas10
 1856  sudo apt --fix-broken install
 1857  sudo apt -remove-broken install
 1858  sudo apt-get -f install
 1859  sudo apt --fix-broken install
 1860  sudo rm /var/cache/apt/archives/libcublas*
 1861  sudo rm /usr/include/nvblas.h
 1866  sudo dpkg --remove --force-remove-reinstreq nvidia-cuda
 1867  ls /var/lib/dpkg/info/|grep nvidia*
 1868  sudo dpkg --remove --force-remove-reinstreq nvidia*
 1869  sudo dpkg --remove --force-remove-reinstreq nvidia-common
 1877  sudo dpkg --remove --force-remove-reinstreq nvidia-visual-profiler.list
 1878  ls /var/lib/dpkg/info/|grep cuda*
 1882  sudo dpkg --remove --force-remove-reinstreq cuda
 1883  sudo dpkg --remove --force-remove-reinstreq cuda-10-2
 1884  sudo dpkg --remove --force-remove-reinstreq cuda-toolkit-10-2

all to no avail. The software updates gui says nvidia-driver-440 is in use, any help appreciated. I'd be fine with a working dpkg and no nvidia at all for starters.

edit with requested output -

jeremy@jeremy-Blade:~$ dpkg -l|grep cuda
iU  cuda-command-line-tools-10-2               10.2.89-1                                        amd64        CUDA command-line tools
iU  cuda-compiler-10-2                         10.2.89-1                                        amd64        CUDA compiler
iU  cuda-cudart-10-2                           10.2.89-1                                        amd64        CUDA Runtime native Libraries
iU  cuda-cudart-dev-10-2                       10.2.89-1                                        amd64        CUDA Runtime native dev links, headers
iU  cuda-cufft-10-2                            10.2.89-1                                        amd64        CUFFT native runtime libraries
iU  cuda-cufft-dev-10-2                        10.2.89-1                                        amd64        CUFFT native dev links, headers
iU  cuda-cuobjdump-10-2                        10.2.89-1                                        amd64        CUDA cuobjdump
iU  cuda-cupti-10-2                            10.2.89-1                                        amd64        CUDA profiling tools runtime libs.
iU  cuda-cupti-dev-10-2                        10.2.89-1                                        amd64        CUDA profiling tools interface.
iU  cuda-curand-10-2                           10.2.89-1                                        amd64        CURAND native runtime libraries
iU  cuda-curand-dev-10-2                       10.2.89-1                                        amd64        CURAND native dev links, headers
iU  cuda-cusolver-10-2                         10.2.89-1                                        amd64        CUDA solver native runtime libraries
iU  cuda-cusolver-dev-10-2                     10.2.89-1                                        amd64        CUDA solver native dev links, headers
iU  cuda-cusparse-10-2                         10.2.89-1                                        amd64        CUSPARSE native runtime libraries
iU  cuda-cusparse-dev-10-2                     10.2.89-1                                        amd64        CUSPARSE native dev links, headers
iU  cuda-demo-suite-10-2                       10.2.89-1                                        amd64        Demo suite for CUDA
iU  cuda-documentation-10-2                    10.2.89-1                                        amd64        CUDA documentation
iU  cuda-driver-dev-10-2                       10.2.89-1                                        amd64        CUDA Driver native dev stub library
iU  cuda-drivers                               440.64.00-1                                      amd64        CUDA Driver meta-package
iU  cuda-gdb-10-2                              10.2.89-1                                        amd64        CUDA-GDB
iU  cuda-libraries-10-2                        10.2.89-1                                        amd64        CUDA Libraries 10.2 meta-package
iU  cuda-libraries-dev-10-2                    10.2.89-1                                        amd64        CUDA Libraries 10.2 development meta-package
iU  cuda-license-10-2                          10.2.89-1                                        amd64        CUDA licenses
iU  cuda-memcheck-10-2                         10.2.89-1                                        amd64        CUDA-MEMCHECK
iU  cuda-misc-headers-10-2                     10.2.89-1                                        amd64        CUDA miscellaneous headers
iU  cuda-npp-10-2                              10.2.89-1                                        amd64        NPP native runtime libraries
iU  cuda-npp-dev-10-2                          10.2.89-1                                        amd64        NPP native dev links, headers
iU  cuda-nsight-10-2                           10.2.89-1                                        amd64        CUDA nsight
iU  cuda-nsight-compute-10-2                   10.2.89-1                                        amd64        NVIDIA Nsight Compute
iU  cuda-nsight-systems-10-2                   10.2.89-1                                        amd64        NVIDIA Nsight Systems
iU  cuda-nvcc-10-2                             10.2.89-1                                        amd64        CUDA nvcc
iU  cuda-nvdisasm-10-2                         10.2.89-1                                        amd64        CUDA disassembler
iU  cuda-nvgraph-10-2                          10.2.89-1                                        amd64        NVGRAPH native runtime libraries
iU  cuda-nvgraph-dev-10-2                      10.2.89-1                                        amd64        NVGRAPH native dev links, headers
iU  cuda-nvjpeg-10-2                           10.2.89-1                                        amd64        NVJPEG native runtime libraries
iU  cuda-nvjpeg-dev-10-2                       10.2.89-1                                        amd64        NVJPEG native dev links, headers
iU  cuda-nvml-dev-10-2                         10.2.89-1                                        amd64        NVML native dev links, headers
iU  cuda-nvprof-10-2                           10.2.89-1                                        amd64        CUDA Profiler tools
iU  cuda-nvprune-10-2                          10.2.89-1                                        amd64        CUDA nvprune
iU  cuda-nvrtc-10-2                            10.2.89-1                                        amd64        NVRTC native runtime libraries
iU  cuda-nvrtc-dev-10-2                        10.2.89-1                                        amd64        NVRTC native dev links, headers
iU  cuda-nvtx-10-2                             10.2.89-1                                        amd64        NVIDIA Tools Extension
iU  cuda-nvvp-10-2                             10.2.89-1                                        amd64        CUDA nvvp
iU  cuda-runtime-10-2                          10.2.89-1                                        amd64        CUDA Runtime 10.2 meta-package
iU  cuda-samples-10-2                          10.2.89-1                                        amd64        CUDA example applications
iU  cuda-sanitizer-api-10-2                    10.2.89-1                                        amd64        CUDA Sanitizer API
rc  cuda-toolkit-10-2                          10.2.89-1                                        amd64        CUDA Toolkit 10.2 meta-package
rU  cuda-tools-10-2                            10.2.89-1                                        amd64        CUDA Tools meta-package
iU  cuda-visual-tools-10-2                     10.2.89-1                                        amd64        CUDA visual tools
ii  libcudart9.1:amd64                         9.1.85-3ubuntu1                                  amd64        NVIDIA CUDA Runtime Library
ii  nvidia-cuda-dev                            9.1.85-3ubuntu1                                  amd64        NVIDIA CUDA development files
ii  nvidia-cuda-doc                            9.1.85-3ubuntu1                                  all          NVIDIA CUDA and OpenCL documentation
ii  nvidia-cuda-gdb                            9.1.85-3ubuntu1                                  amd64        NVIDIA CUDA Debugger (GDB)
ii  nvidia-cuda-toolkit                        9.1.85-3ubuntu1                                  amd64        NVIDIA CUDA development toolkit

and

jeremy@jeremy-Blade:~$ sudo apt-get purge cuda-drivers
[sudo] password for jeremy: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cuda-libraries-dev-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
 cuda-runtime-10-2 : Depends: cuda-drivers (>= 440.33) but it is not going to be installed
 cuda-samples-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
 cuda-visual-tools-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

...and another addition with results of purging 10.2 packages

jeremy@jeremy-Blade:~$ sudo apt-get purge cuda-npp-10-2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cuda-libraries-10-2 : Depends: cuda-npp-10-2 (>= 10.2.89) but it is not going to be installed
 cuda-libraries-dev-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
 cuda-npp-dev-10-2 : Depends: cuda-npp-10-2 (>= 10.2.89) but it is not going to be installed
 cuda-samples-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
 cuda-visual-tools-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
jeremy@jeremy-Blade:~$ sudo apt-get purge cuda-compiler-10-2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cuda-libraries-dev-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
 cuda-samples-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
 cuda-visual-tools-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

and same for

jeremy@jeremy-Blade:~$ sudo apt-get purge cuda-tools-10-2
jeremy@jeremy-Blade:~$ sudo apt-get purge libcudart9.1
jeremy@jeremy-Blade:~$ sudo apt-get purge nvidia-cuda-dev
jeremy@jeremy-Blade:~$ sudo apt-get purge nvidia-cuda-doc
  • Your purges should have worked to remove those cuda packages. What does dpkg -l | grep cuda show you? The Nvidia 440 (the current driver) re-installation (after the cuda install put some old version in place) removed all the cuda packages which depended on the old driver, leaving this mess. – ubfan1 Jun 06 '20 at 21:22
  • OK, you got the list, run sudo apt-get purge on all those cuda packages. – ubfan1 Jun 06 '20 at 21:55
  • as i showed in the command after the list, the apt-get purge dies on 'unmet dependencies', which means iiuc that to remove the cuda drivers, i need to install ... the cuda drivers https://xkcd.com/349/ – jeremy_rutman Jun 06 '20 at 22:02
  • Pick a cuda package with "10.2.89-1" after the name (all of them but the one you tried). The "440..." seems to indicate it's a part of the Nvidia 440 driver, try that one last. Oh, the 9.1 packages can also be purged. – ubfan1 Jun 06 '20 at 23:00
  • possibly, at least the 'sudo dpkg -P ' runs, i;ll remove all the cuda stuff and see if that allows dpkg to fix itself – jeremy_rutman Jun 07 '20 at 07:01

0 Answers0