5
1

More than 3 years have passed since last update.

【Ubuntu】apt upgradeで ...debの取得に失敗しました 接続失敗 [IP: 91.189.88.142 80]となった件

Last updated at Posted at 2021-02-11

概要

  • HyperV上にUbuntu18.04をインストール。
  • インストール後にまずやることとして、update, upgradeを行おうとしました。
  • 結果、apt upgradeで 以下のエラーメッセージが表示され、正常に処理を行えませんでした。それを解決した際のメモとして本記事を投稿。
    • ...debの取得に失敗しました 接続失敗 [IP: 91.189.88.142 80]

環境

  • Ubuntu18.04 (HyperV on Windows 10 Pro 1909)

状況

1. apt update を実行

$ sudo apt update
ヒット:1 http://archive.ubuntu.com/ubuntu bionic InRelease                    
取得:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]   
取得:3 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [48.9 kB]
取得:4 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [59.8 kB]
取得:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]     
取得:6 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,460 B]
取得:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
取得:8 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [295 kB]
取得:9 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [289 kB]
取得:10 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]
取得:11 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [9,292 B]
958 kB を 5秒 で取得しました (213 kB/s)                                       
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています       
状態情報を読み取っています... 完了
アップグレードできるパッケージが 450 個あります。表示するには 'apt list --upgradable' を実行してください。

2. apt upgradeを実行

以下のエラーメッセージが表示されました。

$ sudo apt upgrade -y --fix-missing

(中略)

initramfs-tools (0.130ubuntu3.11) のトリガを処理しています ...
update-initramfs: Generating /boot/initrd.img-5.0.0-25-generic
systemd (237-3ubuntu10.44) のトリガを処理しています ...
E: http://security.ubuntu.com/ubuntu/pool/main/l/llvm-toolchain-10/libllvm10_10.0.0-4ubuntu1~18.04.2_amd64.deb の取得に失敗しました  接続失敗 [IP: 91.189.88.142 80]
E: http://security.ubuntu.com/ubuntu/pool/main/w/webkit2gtk/libwebkit2gtk-4.0-37_2.30.3-0ubuntu0.18.04.1_amd64.deb の取得に失敗しました  接続失敗 [IP: 91.189.88.142 80]
E: http://security.ubuntu.com/ubuntu/pool/main/l/llvm-toolchain-8/libllvm8_8-3~ubuntu18.04.2_amd64.deb の取得に失敗しました  接続失敗 [IP: 91.189.88.142 80]
E: http://security.ubuntu.com/ubuntu/pool/main/l/linux-hwe-5.4/linux-modules-5.4.0-65-generic_5.4.0-65.73~18.04.1_amd64.deb の取得に失敗しました  接続失敗 [IP: 91.189.88.142 80]
E: http://security.ubuntu.com/ubuntu/pool/main/l/linux-hwe-5.4/linux-hwe-5.4-headers-5.4.0-65_5.4.0-65.73~18.04.1_all.deb の取得に失敗しました  接続失敗 [IP: 91.189.88.142 80]

原因の推測

  • apt update で正しくupdateがなされていない為に、upgradeで失敗しているのではないかと思いました。
  • インストール直後のパッケージリストはどうも怪しい模様です。
  • パッケージリスト(/var/lib/apt/lists/*)を元にupgradeするわけですが、この記事を読む限り、updateエラーが発生した場合(本件ではupgradeですが)、再作成する事により、解決できそうです。

解決方法

  • パッケージリストの削除
  • 今回はばっさり削除していますが、気になる場合は、バックアップを取っておいてください。
$ sudo rm -rf /var/lib/apt/lists/*
  • 再度 apt update を実行
$ sudo apt update

再実行 - 解決したことの確認

  • 成功しました。
$ sudo apt upgrade -y --fix-missing

(中略)

/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-65-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-65-generic
Found initrd image: /boot/initrd.img-5.4.0-65-generic
Found linux image: /boot/vmlinuz-5.0.0-25-generic
Found initrd image: /boot/initrd.img-5.0.0-25-generic
Adding boot menu entry for EFI firmware configuration
done

参考サイト

Fixing Ubuntu Update Error: Troubleshoot Guide by It's FOSS
[Solved] "Unable to parse package file /var/lib/apt/lists" Error in Ubuntu

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