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

[Ubuntu 20.04] apt-get upgrade時にConnection failedエラーが発生した件

Posted at

概要

apt-get upgrade時にConnection failedエラーが発生した。そのエラー解消時の手順を記載

環境

Ubuntu20.04 (on WSL20.04 Win10Pro 21H1)

エラー発生時の状況

以下コマンドを実施

$ sudo apt-get upgrade --fix-missing

発生したエラーメッセージ

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  libgl1-mesa-dri libglapi-mesa libglx-mesa0 libllvm12
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 29.3 MB/29.5 MB of archives.
After this operation, 45.1 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libgl1-mesa-dri amd64 21.0.3-0ubuntu0.3~20.04.5
  Connection failed [IP: 91.189.88.152 80]
Err:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libllvm12 amd64 1:12.0.0-3ubuntu1~20.04.4
  Connection failed [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/m/mesa/libgl1-mesa-dri_21.0.3-0ubuntu0.3~20.04.5_amd64.deb  Connection failed [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/llvm-toolchain-12/libllvm12_12.0.0-3ubuntu1~20.04.4_amd64.deb  Connection failed [IP: 91.189.88.152 80]

解決した際の手順

  • リポジトリを日本のミラーサーバーへ変更
  • 以下、富山大学のミラーサーバーを採用しているが、任意に近くのミラーサーバーを変更する

-- 富山大学の例

sudo sed -i.org -e 's|archive.ubuntu.com|ubuntutym.u-toyama.ac.jp|g' /etc/apt/sources.list
  • キャッシュを削除
sudo apt-get clean

再実施

sudo apt update && sudo apt upgrade -y

正常に apt-get upgrade を行えました。

参考にさせて頂いたサイト

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