1
2

More than 3 years have passed since last update.

[WSL] aptでJavaを入れようとしたら404になる現象の解決法(個人的メモ)

Last updated at Posted at 2020-10-05

環境

Windows10 Education 2004
WSL Ubuntu18.04 LTS

現象

WSLのUbuntu18.04にJavaをインストールしようと以下のコマンドを実行したところ...

sudo apt install default-jdk

このような404エラーが発生しインストールに失敗する。

Ign:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libnss3 amd64 2:3.35-2ubuntu2.11
Err:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 libnss3 amd64 2:3.35-2ubuntu2.11
  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/nss/libnss3_3.35-2ubuntu2.11_amd64.deb  404  Not Found [IP: 91.189.88.152 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

apt-get updateapt-get update --fix-missingを試せと書いてあるので試すが改善せず...
アンチウイルスソフトが原因で...という記事もあったが、特にその手のものは導入していないので関係なさそう。

解決方法

以下のコマンドを実行しらエラーが出なくなった。

sudo apt-get autoclean  //これが肝っぽい
sudo apt-get update

どうやら使われない古いファイルが残り続けていて、それが悪さしていたとかいないとか...
sudo apt-get autocleanはそういった不要なファイルを削除するコマンドのようです。

参考

https://qiita.com/kabosu3d/items/0f436ba05df8ac358245
https://qiita.com/Y_Aowashi/items/d355d90945305d925a3c

1
2
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
1
2