2
1

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 3 years have passed since last update.

Ubuntuのapt-get updateで「File has unexpected size」エラー解消

Last updated at Posted at 2020-01-07

以下のようなエラーが発生する場合の解決方法

E: Failed to fetch https://packages.microsoft.com/repos/azure-cli/dists/bionic/main/binary-amd64/Packages.bz2  File has unexpected size (7745 != 7578). Mirror sync in progress? [IP: 40.76.35.62 443]
   Hashes of expected file:
    - Filesize:7578 [weak]
    - SHA512:30aedbe5e049c2ca01e21eefa4f08305e1ff194e8d1e169cbf9b0f80cf53dff7737be1db73e86a4bae4f1e5b8d09de91a6fafe47ac70970f0064068b8a8966af
    - SHA256:1a3e7c4fef701ae1ed6eeeba7335bd46b00ab1bc8ab7237fab1995fcf6d227ce
    - SHA1:cba9edf2f8322ddef2e6254c41bb3c34bd91b8f7 [weak]
    - MD5Sum:04194afaa70a355bd05b7617f0eb8d97 [weak]
   Release file created at: Wed, 18 Dec 2019 06:16:18 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.
##[error]Process completed with exit code 100.

原因

apt-get updateコマンド実行時に、Ubuntuにデフォルトで入っているパッケージリストの更新に失敗するため
※ 上記の場合は「/etc/apt/sources.list.d/azure-cli.list」の更新でコケている

対応

エラーが出ているパッケージが不要であれば、該当のパッケージリストを削除することで解決する

sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/azure-cli.list
sudo apt-get update

参考

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?