apt-get は更新のためにリポジトリに接続しません

apt-get は更新のためにリポジトリに接続しません

を使用するとsudo apt-get update、次のエラーが発生します。

Err:1 http:/archive.ubuntu.com/ubuntu xenial InRelease
  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
Err:2 http:/archive.ubuntu.com/ubuntu xenial-security InRelease
  Unable to connect to localhost:4001:
Err:3 http:/archive.ubuntu.com/ubuntu xenial-updates InRelease
  Unable to connect to localhost:4001:
Reading package lists... 4%
(process:2389): GLib-GIO-WARNING **: Invalid proxy URI 'http:/localhost:4001 ': Invalid URI 'http:/localhost:4001 '
Reading package lists... Done
W: Failed to fetch http:/archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Could not connect to localhost:4001 (127.0.0.1). - connect (111: Connection refused)
W: Failed to fetch http:/archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Unable to connect to localhost:4001:
W: Failed to fetch http:/archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Unable to connect to localhost:4001:
W: Some index files failed to download. They have been ignored, or old ones used instead.

これを修正するにはどうすればいいでしょうか?

答え1

インターネット接続が切断されたか、プロキシ経由で作業していると思われます。あるいは、更新しようとしている PPA が廃止されている可能性があります。

プロキシを使用している場合は、次の解決策が機能します。 コマンドラインでプロキシ経由で「sudo apt-get update」を実行するにはどうすればいいですか?

関連情報