安全清除 cuda 10.2,不会损害其他 cuda 版本和依赖项

安全清除 cuda 10.2,不会损害其他 cuda 版本和依赖项

我想从我的系统中完全删除 cuda 10.2,其中还有一些其他 cuda 版本。文档说

sudo apt-get --purge remove <package_name>    

我应该用 替换 package_name 吗cuda*10-2*

在其他帖子中使用 apt-get 删除软件包和依赖项,我发现我也应该这样做

sudo apt-get purge $(apt-cache depends <PACKAGENAME> | awk '{ print $2 }' | tr '\n' ' ')
sudo apt-get autoremove
sudo apt-get update
sudo apt-get check
sudo apt-get -f install
sudo apt-get autoclean

但也许更好的解决方案是sudo aptitude remove cuda*10-2*

在我安装cuda10.2之前,信息

The following additional packages will be installed:
  cuda-10-2 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-toolkit-10-2 cuda-tools-10-2 cuda-visual-tools-10-2 freeglut3 freeglut3-dev libcublas-dev libcublas10 libdrm-dev
  libgl1-mesa-dev libgles1 libglu1-mesa-dev libglvnd-core-dev libglvnd-dev libnvidia-cfg1-440 libnvidia-common-440 libnvidia-compute-440 libnvidia-decode-440 libnvidia-encode-440 libnvidia-fbc1-440
  libnvidia-gl-440 libnvidia-ifr1-440 libopengl0 libx11-xcb-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev
  libxcb-xfixes0-dev libxdamage-dev libxfixes-dev libxi-dev libxmu-dev libxmu-headers libxshmfence-dev libxxf86vm-dev mesa-common-dev nsight-compute-2019.5.0 nsight-systems-2019.5.2 nvidia-compute-utils-440
  nvidia-dkms-440 nvidia-driver-440 nvidia-kernel-common-440 nvidia-kernel-source-440 nvidia-modprobe nvidia-settings nvidia-utils-440 x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev
  x11proto-xf86vidmode-dev xserver-xorg-video-nvidia-440
Recommended packages:
  libnvidia-compute-440:i386 libnvidia-decode-440:i386 libnvidia-encode-440:i386 libnvidia-ifr1-440:i386 libnvidia-fbc1-440:i386 libnvidia-gl-440:i386
The following packages will be REMOVED:
  libnvidia-cfg1-435 libnvidia-compute-435 libnvidia-compute-435:i386 libnvidia-decode-435 libnvidia-decode-435:i386 libnvidia-encode-435 libnvidia-encode-435:i386 libnvidia-fbc1-435 libnvidia-fbc1-435:i386
  libnvidia-gl-435 libnvidia-gl-435:i386 libnvidia-ifr1-435 libnvidia-ifr1-435:i386 nvidia-compute-utils-435 nvidia-dkms-435 nvidia-driver-435 nvidia-kernel-common-435 nvidia-kernel-source-435 nvidia-utils-435
  xserver-xorg-video-nvidia-435
The following NEW packages will be installed:
  cuda cuda-10-2 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-toolkit-10-2 cuda-tools-10-2 cuda-visual-tools-10-2 freeglut3 freeglut3-dev libcublas-dev
  libcublas10 libdrm-dev libgl1-mesa-dev libgles1 libglu1-mesa-dev libglvnd-core-dev libglvnd-dev libnvidia-cfg1-440 libnvidia-common-440 libnvidia-compute-440 libnvidia-decode-440 libnvidia-encode-440
  libnvidia-fbc1-440 libnvidia-gl-440 libnvidia-ifr1-440 libopengl0 libx11-xcb-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev
  libxcb-sync-dev libxcb-xfixes0-dev libxdamage-dev libxfixes-dev libxi-dev libxmu-dev libxmu-headers libxshmfence-dev libxxf86vm-dev mesa-common-dev nsight-compute-2019.5.0 nsight-systems-2019.5.2
  nvidia-compute-utils-440 nvidia-dkms-440 nvidia-driver-440 nvidia-kernel-common-440 nvidia-kernel-source-440 nvidia-modprobe nvidia-utils-440 x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev
  x11proto-xf86vidmode-dev xserver-xorg-video-nvidia-440
The following packages will be upgraded:
  nvidia-settings
1 upgraded, 102 newly installed, 20 to remove and 19 not upgraded.
Need to get 1.706 kB/1.860 MB of archives.
After this operation, 3.797 MB of additional disk space will be used.

如果我运行 apt list |grep cuda

我有

boinc-client-nvidia-cuda/bionic-updates 7.9.3+dfsg-5ubuntu2 amd64
caffe-cuda/bionic 1.0.0-6build1 amd64
caffe-tools-cuda/bionic,now 1.0.0-6build1 amd64 [installed]
cuda/unknown,now 10.2.89-1 amd64 [installed]
cuda-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-command-line-tools-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-command-line-tools-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-compat-10-2/unknown,now 440.33.01-1 amd64 [installed]
cuda-compiler-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-core-10-2/unknown 10.2.89-1 amd64
cuda-core-9-0/now 9.0.176.3-1 amd64 [residual-config]
cuda-cudart-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cudart-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-cudart-9-2/now 9.2.148.1-1 amd64 [residual-config]
cuda-cudart-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cudart-dev-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-cufft-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cufft-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-cufft-9-2/now 9.2.148-1 amd64 [residual-config]
cuda-cufft-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cuobjdump-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cupti-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cupti-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-curand-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-curand-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-curand-9-2/now 9.2.148-1 amd64 [residual-config]
cuda-curand-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cusolver-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cusolver-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-cusolver-9-2/now 9.2.148-1 amd64 [residual-config]
cuda-cusolver-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cusparse-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-cusparse-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-cusparse-9-2/now 9.2.148-1 amd64 [residual-config]
cuda-cusparse-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-demo-suite-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-documentation-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-driver-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-drivers/unknown,now 440.33.01-1 amd64 [installed]
cuda-gdb-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-gdb-src-10-2/unknown 10.2.89-1 amd64
cuda-libraries-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-libraries-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-license-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-memcheck-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-minimal-build-10-2/unknown 10.2.89-1 amd64
cuda-misc-headers-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-npp-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-npp-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-npp-9-2/now 9.2.148-1 amd64 [residual-config]
cuda-npp-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nsight-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nsight-compute-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nsight-systems-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvcc-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvdisasm-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvgraph-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvgraph-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-nvgraph-9-2/now 9.2.148-1 amd64 [residual-config]
cuda-nvgraph-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvjpeg-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvjpeg-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvml-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvprof-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvprune-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvrtc-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvrtc-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-nvrtc-9-2/now 9.2.148-1 amd64 [residual-config]
cuda-nvrtc-dev-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvtx-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-nvtx-9-2/now 9.2.148-1 amd64 [residual-config]
cuda-nvvp-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-repo-ubuntu1604/now 9.2.148-1 amd64 [installed,local]
cuda-repo-ubuntu1804-10-2-local-10.2.89-440.33.01/now 1.0-1 amd64 [installed,local]
cuda-runtime-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-samples-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-sanitizer-api-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-toolkit-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-toolkit-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-toolkit-9-2/now 9.2.148-1 amd64 [residual-config]
cuda-tools-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-visual-tools-10-2/unknown,now 10.2.89-1 amd64 [installed,automatic]
cuda-visual-tools-9-0/now 9.0.176-1 amd64 [residual-config]
cuda-visual-tools-9-2/now 9.2.148-1 amd64 [residual-config]
libcaffe-cuda-dev/bionic 1.0.0-6build1 amd64
libcaffe-cuda1/bionic,now 1.0.0-6build1 amd64 [installed,automatic]
libcuda1-331/bionic-updates 340.107-0ubuntu0.18.04.4 amd64
libcuda1-331-updates/bionic-updates 340.107-0ubuntu0.18.04.4 amd64
libcuda1-340/bionic-updates 340.107-0ubuntu0.18.04.4 amd64
libcuda1-340-updates/bionic-updates 340.107-0ubuntu0.18.04.4 amd64
libcuda1-346/bionic 352.63-0ubuntu3 amd64
libcuda1-346-updates/bionic 352.63-0ubuntu3 amd64
libcuda1-352/bionic 361.45.11-0ubuntu4 amd64
libcuda1-352-updates/bionic 361.45.11-0ubuntu4 amd64
libcuda1-361/bionic 367.57-0ubuntu5 amd64
libcuda1-361-updates/bionic 361.45.11-0ubuntu4 amd64
libcuda1-367/bionic 375.82-0ubuntu3 amd64
libcuda1-375/bionic 384.111-0ubuntu1 amd64
libcuda1-384/bionic-updates 390.116-0ubuntu0.18.04.3 amd64
libcudart9.1/bionic,now 9.1.85-3ubuntu1 amd64 [installed,automatic]
libcudnn7/unknown,now 7.6.5.32-1+cuda10.2 amd64 [installed]
libcudnn7-dev/unknown 7.6.5.32-1+cuda10.2 amd64
libnccl-dev/unknown 2.5.6-1+cuda10.2 amd64
libnccl2/unknown 2.5.6-1+cuda10.2 amd64
libnvinfer-dev/unknown 7.0.0-1+cuda10.2 amd64
libnvinfer-plugin-dev/unknown 7.0.0-1+cuda10.2 amd64
libnvinfer-plugin6/unknown 6.0.1-1+cuda10.2 amd64
libnvinfer-plugin7/unknown 7.0.0-1+cuda10.2 amd64
libnvinfer5/unknown 5.1.5-1+cuda10.1 amd64
libnvinfer6/unknown 6.0.1-1+cuda10.2 amd64
libnvinfer7/unknown 7.0.0-1+cuda10.2 amd64
libnvonnxparsers-dev/unknown 7.0.0-1+cuda10.2 amd64
libnvonnxparsers6/unknown 6.0.1-1+cuda10.2 amd64
libnvonnxparsers7/unknown 7.0.0-1+cuda10.2 amd64
libnvparsers-dev/unknown 7.0.0-1+cuda10.2 amd64
libnvparsers6/unknown 6.0.1-1+cuda10.2 amd64
libnvparsers7/unknown 7.0.0-1+cuda10.2 amd64
nvidia-cuda-dev/bionic 9.1.85-3ubuntu1 amd64
nvidia-cuda-doc/bionic,bionic 9.1.85-3ubuntu1 all
nvidia-cuda-gdb/bionic 9.1.85-3ubuntu1 amd64
nvidia-cuda-toolkit/bionic 9.1.85-3ubuntu1 amd64
nvinfer-runtime-trt-repo-ubuntu1804-5.0.0-rc-cuda10.0/unknown 1-1 amd64
nvinfer-runtime-trt-repo-ubuntu1804-5.0.2-ga-cuda10.0/unknown 1-1 amd64
python-libnvinfer/unknown 7.0.0-1+cuda10.2 amd64
python-libnvinfer-dev/unknown 7.0.0-1+cuda10.2 amd64
python-pycuda/bionic 2017.1.1-2 amd64
python-pycuda-dbg/bionic 2017.1.1-2 amd64
python-pycuda-doc/bionic,bionic 2017.1.1-2 all
python3-caffe-cuda/bionic 1.0.0-6build1 amd64
python3-libnvinfer/unknown 7.0.0-1+cuda10.2 amd64
python3-libnvinfer-dev/unknown 7.0.0-1+cuda10.2 amd64
python3-pycuda/bionic 2017.1.1-2 amd64
python3-pycuda-dbg/bionic 2017.1.1-2 amd64

由于这台机器上有多个用户,我不想破坏我们的依赖关系,所以我需要一种安全的方法来做到这一点,并想问一个更安全的解决方案。例如

caffe-tools-cuda/bionic,now 1.0.0-6build1 amd64

来自另一个用户。

我的 cuda10.2 安装已更新以下软件包(另见上文)

libnvidia-cfg1-435 libnvidia-compute-435 libnvidia-compute-435:i386 libnvidia-decode-435 libnvidia-decode-435:i386 libnvidia-encode-435 libnvidia-encode-435:i386 libnvidia-fbc1-435 libnvidia-fbc1-435:i386
  libnvidia-gl-435 libnvidia-gl-435:i386 libnvidia-ifr1-435 libnvidia-ifr1-435:i386 nvidia-compute-utils-435 nvidia-dkms-435 nvidia-driver-435 nvidia-kernel-common-435 nvidia-kernel-source-435 nvidia-utils-435
  xserver-xorg-video-nvidia-435

如果sudo apt-get --purge remove <package_name> 有效,但运行 apt update 和 upgrade 是否会让我返回计算机上每个人都可以使用的旧依赖项?

例如

/usr/local$ ls -la *cuda*

我有

lrwxrwxrwx  1 root root    9 Feb 18 01:09 cuda -> cuda-10.2

cuda-10.2:
total 80
drwxr-xr-x 17 root root 4096 Feb 18 01:09 .
drwxr-xr-x 13 root root 4096 Feb 18 01:09 ..
drwxr-xr-x  3 root root 4096 Feb 18 01:09 bin
drwxr-xr-x  2 root root 4096 Feb 18 01:04 compat
drwxr-xr-x  5 root root 4096 Feb 18 01:09 doc
drwxr-xr-x  6 root root 4096 Feb 18 01:09 extras
lrwxrwxrwx  1 root root   28 Nov 13 22:30 include -> targets/x86_64-linux/include
lrwxrwxrwx  1 root root   24 Nov 13 22:30 lib64 -> targets/x86_64-linux/lib
drwxr-xr-x  8 root root 4096 Feb 18 01:09 libnsight
drwxr-xr-x  7 root root 4096 Feb 18 01:09 libnvvp
-rw-r--r--  1 root root  366 Nov 13 22:28 LICENSE
drwxr-xr-x  2 root root 4096 Feb 18 01:09 nsightee_plugins
drwxr-xr-x  3 root root 4096 Feb 18 01:09 nvml
drwxr-xr-x  7 root root 4096 Feb 18 01:08 nvvm
drwxr-xr-x  7 root root 4096 Feb 18 01:08 nvvmx
-rw-r--r--  1 root root  366 Nov 13 22:28 README
drwxr-xr-x 11 root root 4096 Feb 18 01:09 samples
drwxr-xr-x  3 root root 4096 Feb 18 01:08 share
drwxr-xr-x  2 root root 4096 Feb 18 01:08 src
drwxr-xr-x  3 root root 4096 Feb 18 01:08 targets
drwxr-xr-x  2 root root 4096 Feb 18 01:09 tools
-rw-r--r--  1 root root   21 Nov 13 22:29 version.txt

cuda-8.0:
total 72
drwxr-xr-x 17 root root 4096 Nov 15  2017 .
drwxr-xr-x 13 root root 4096 Feb 18 01:09 ..
drwxr-xr-x  3 root root 4096 Nov 15  2017 bin
drwxr-xr-x  5 root root 4096 Nov 15  2017 doc
drwxr-xr-x  5 root root 4096 Nov 15  2017 extras
drwxr-xr-x  5 root root 4096 Nov 15  2017 include
drwxr-xr-x  5 root root 4096 Nov 15  2017 jre
drwxr-xr-x  3 root root 4096 Nov 15  2017 lib64
drwxr-xr-x  8 root root 4096 Nov 15  2017 libnsight
drwxr-xr-x  7 root root 4096 Nov 15  2017 libnvvp
drwxr-xr-x  3 root root 4096 Nov 15  2017 nvml
drwxr-xr-x  7 root root 4096 Nov 15  2017 nvvm
drwxr-xr-x  2 root root 4096 Nov 15  2017 pkgconfig
drwxr-xr-x 11 root root 4096 Nov 15  2017 samples
drwxr-xr-x  3 root root 4096 Nov 15  2017 share
drwxr-xr-x  2 root root 4096 Nov 15  2017 src
drwxr-xr-x  2 root root 4096 Nov 15  2017 tools
-rw-r--r--  1 root root   20 Nov 15  2017 version.txt

cuda-9.0:
total 119864
drwxr-xr-x  2 root    root         4096 Apr 25  2019 .
drwxr-xr-x 13 root    root         4096 Feb 18 01:09 ..
-rw-rw-r--  1 caduser caduser 122730426 Aug 23  2018 libcudnn7_7.2.1.38-1+cuda9.0_amd64.deb

但是在 apt 列表中,我根本没有找到任何 cuda 8 或 cuda 9,我怎么知道有人在使用它们,否则我不会破坏依赖关系?

相关内容