質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

apt-get

apt-getコマンドはUNIX系OSのパッケージのインストールなど、パッケージ管理を行うためのコマンドです。

Q&A

解決済

2回答

30562閲覧

WSL2環境のUbuntuでsudo apt-get update実行時にエラーが表示される。

fdorike

総合スコア21

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

apt-get

apt-getコマンドはUNIX系OSのパッケージのインストールなど、パッケージ管理を行うためのコマンドです。

0グッド

1クリップ

投稿2021/10/22 02:48

編集2021/10/22 03:02

前提・実現したいこと

WSL2にUbuntu 20.04 LTSをインストールしました。
その後、sudo apt-get updateを実行しましたが、エラーがでてしまいました。
いろんなサイトの解決方法を試しましたが、上手くいきませんでした。
試したこと以外の方法で解決策があれば、ご教授をお願い致します。

会社のPCを使用しています。

発生している問題・エラーメッセージ

sudo apt-get update Err:1 http://archive.ubuntu.com/ubuntu focal InRelease Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.142). - connect (111: Connection refused) Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease Could not connect to security.ubuntu.com:80 (2001:67c:1562::15). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (2001:67c:1562::18). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.38). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.39). - connect (111: Connection refused) Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease Unable to connect to archive.ubuntu.com:http: Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease Unable to connect to archive.ubuntu.com:http: Reading package lists... Done W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::23). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (2001:67c:1360:8001::24). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.152). - connect (111: Connection refused) Could not connect to archive.ubuntu.com:80 (91.189.88.142). - connect (111: Connection refused) W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Unable to connect to archive.ubuntu.com:http: W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Unable to connect to archive.ubuntu.com:http: W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Could not connect to security.ubuntu.com:80 (2001:67c:1562::15). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (2001:67c:1562::18). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.38). - connect (111: Connection refused) Could not connect to security.ubuntu.com:80 (91.189.91.39). - connect (111: Connection refused) W: Some index files failed to download. They have been ignored, or old ones used instead.

試したこと

terminalで/etc/wsl.confを下記の内容に編集
[network]
generateResolvConf = false

WSL2を起動して、/etc/resolv.confを下記の内容に編集
nameserver 8.8.8.8

Symantec Endpoint Protectionの無効化
ファイアウォールの無効化

補足情報

Ubuntuの時刻がずれている場合の解決方法がありましたが、
Ubuntuの時刻はずれていませんでした。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

archiver

2021/10/22 10:37

エラーに"Connection refused"と出ているので、接続が拒否されていますね。 会社のPCで行っているとのことですが、会社にプロキシサーバーは設置されていますか?
guest

回答2

0

自己解決

archiver

2021/10/22 19:37

エラーに"Connection refused"と出ているので、接続が拒否されていますね。
会社のPCで行っているとのことですが、会社にプロキシサーバーは設置されていますか?

fdorike
fdorike

2021/10/25 12:07

proxyサーバーを忘れていました!
proxy設定について調べた結果sudo apt-get updateコマンドを実行することができました。
ありがとうございます。
参考URL:https://qiita.com/riraosan/items/3b036367d6d9f4e6b52a

投稿2021/10/25 07:56

fdorike

総合スコア21

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

こちらの記事の方法を試してみてください。
https://qiita.com/riraosan/items/3b036367d6d9f4e6b52a

投稿2021/10/25 02:18

heroyct

総合スコア434

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問