0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

sudo apt install cuda cuda-drivers でE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? がでちゃう問題を解決よ!

Posted at
sudo apt install cuda cuda-drivers

機械学習やりたくてね、cudaをインストールしようとしたらこんなエラーが出てきたの。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  cuda-11-6 cuda-cccl-11-6 cuda-command-line-tools-11-6 cuda-compiler-11-6 cuda-cudart-11-6 cuda-cudart-dev-11-6
  cuda-cuobjdump-11-6 cuda-cupti-11-6 cuda-cupti-dev-11-6 cuda-cuxxfilt-11-6 cuda-demo-suite-11-6
.
.
.
.
.
.
10.47.03-0ubuntu1_i386.deb  File has unexpected size (50300 != 50298). Mirror sync in progress? [IP: 152.199.39.144 80]
   Hashes of expected file:
    - SHA512:28e0cbbbc6806301d1588144774277c327d8827b5a1051fd19a3e0dca62ec5600c128c1efa7373a8a1a0dcff232cb5ae539ea8d90385392196a610525d56bb24
    - SHA256:ba0eaf107d6186328425bf3899ae092e08af161bc3269755b8a946d2211a7ab3
    - SHA1:1f780b9c3fba70f2c6fe055366d1145c9aa1aed3 [weak]
    - MD5Sum:c9f2ddfbe94902d7f45e86b559036608 [weak]
    - Filesize:50298 [weak]
E: Failed to fetch http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/./libnvidia-gl-510_510.47.03-0ubuntu1_i386.deb  File has unexpected size (22995788 != 22995786). Mirror sync in progress? [IP: 152.199.39.144 80]
   Hashes of expected file:
    - SHA512:ca83093e2ac4c18df67132952662b8fdc61459c8f18ce4a4d84dad702780666de673c64b6b97185e3301bd1abf971527c087fabe239cc975fcbfab8aa5d2d4bc
    - SHA256:f2a9b1eb8e1e13703c55d1943325e3c76faf27bd1212b0b1e166cc40c1cbf900
    - SHA1:3832159ec3730958d7e518cd138ced3bfa59ff6f [weak]
    - MD5Sum:18e2e26f35897e06f64de0df4a49f9ab [weak]
    - Filesize:22995786 [weak]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

もうね、むきーっって感じよ。やんなっちゃうわよね。
でも安心して、解決策見つけたわ♡
なんかね、公開鍵が更新されてるのが原因らしいわぁ♡
だから下のコマンドで更新すればいいのよ!

sudo apt-key del 7fa2af80

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb

ここで、Ubuntu20.04とかの人は1804を2004とかに修正してね♡

sudo dpkg -i cuda-keyring_1.0-1_all.deb

sudo apt update

これでOKよ♡

ただ、私の場合はここで問題が発生しちゃってね…。こんなエラーが出ちゃったの。

E: Conflicting values set for option Signed-By regarding source http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /: /usr/share/keyrings/cuda-archive-keyring.gpg != 
E: The list of sources could not be read.

だからこうしてやったわぁ!

sudo vi /etc/apt/sources.list

このコマンドで下のをコメントアウトすればいいわ!

deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /

↓

#deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /

viの使い方はお勉強してちょうだいね♡
あとはもう一度、

sudo dpkg -i cuda-keyring_1.0-1_all.deb

sudo rm /etc/apt/sources.list.d/cuda.list

sudo apt update

これを仕上げればいっちょあがり!もうね、ボコボコのボッコってかんじよ!
そんでもってこうよっ!

sudo apt install cuda cuda-drivers

終わりよ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?