質問: dpkg:アーカイブ処理エラー/var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb(--unpack) sudo apt-get -f installを実行すると、dpkg:エラー処理が表示されます。以下の完全なログを見つけて、これを解決する方法をアドバイスしてください。古いバージョンを削除する必要がありますか? reading package lists... done building dependency tree reading state information... done correcting dependencies... done the following additional packages will be installed: cuda-cublas-9-1 the following packages will be upgraded: cuda-cublas-9-1 1 upgraded, 0 newly installed, 0 to remove and 553 not upgraded. 1 not fully installed or removed. need to get 50.1 mb of archives. after this operation, 56.2 mb of additional disk space will be used. do you want to continue? [y/n] y get:1 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 cuda-cublas-9-1 9.1.85.3-1 [50.1 mb] fetched 50.1 mb in 21s (2,313 kb/s) (reading database ... 415420 files and directories currently installed.) preparing to unpack .../cuda-cublas-9-1_9.1.85.3-1_amd64.deb ... unpacking cuda-cublas-9-1 (9.1.85.3-1) over (9.1.85-1) ... dpkg: error processing archive /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb (--unpack): trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1 errors were encountered while processing: /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb e: sub-process /usr/bin/dpkg returned an error code (1)
回答: 発生しているエラーは次のとおりです。dpkg: error processing archive /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb (--unpack): trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1 「上書きしようとする」エラーは、システムに競合するパッケージがあることを意味します。パッケージの上書きを試みることができます(少し危険です)sudo dpkg -i --force-overwrite /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb you need to remove that package それでも解決しない場合は、パッケージを削除して再インストールできますsudo dpkg -p cuda-cublas