Failed to fetch https://packages.microsoft.com/ubuntu/22.04/ in Azure Devops

Alexis RAFESTHAIN 0 Reputation points
2023-03-09T10:02:45.7633333+00:00

Since this morning I'm getting an error when running basi apt-get update&install


Error:


2023-03-09T10:05:08.1100442Z ##[section]Starting: Install Linux utilities
2023-03-09T10:05:08.1107302Z ==============================================================================
2023-03-09T10:05:08.1107543Z Task         : Command line
2023-03-09T10:05:08.1107676Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2023-03-09T10:05:08.1107913Z Version      : 2.212.0
2023-03-09T10:05:08.1108058Z Author       : Microsoft Corporation
2023-03-09T10:05:08.1108206Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2023-03-09T10:05:08.1108432Z ==============================================================================
2023-03-09T10:05:08.2500965Z Generating script.
2023-03-09T10:05:08.2509060Z ========================== Starting Command Output ===========================
2023-03-09T10:05:08.2532635Z [command]/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/606e511d-49d8-49c4-9b04-0af3c0709187.sh
2023-03-09T10:05:09.2478641Z Hit:1 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
2023-03-09T10:05:09.2480029Z Get:2 http://azure.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
2023-03-09T10:05:09.2482697Z Get:3 http://azure.archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
2023-03-09T10:05:09.2483496Z Get:4 http://azure.archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
2023-03-09T10:05:09.2484168Z Get:5 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease [3065 B]
2023-03-09T10:05:09.3839629Z Hit:6 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu jammy InRelease
2023-03-09T10:05:09.9437282Z Get:7 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [943 kB]
2023-03-09T10:05:09.9598358Z Get:8 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [204 kB]
2023-03-09T10:05:09.9623200Z Get:9 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [13.6 kB]
2023-03-09T10:05:09.9701107Z Get:10 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [881 kB]
2023-03-09T10:05:09.9819676Z Get:11 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [173 kB]
2023-03-09T10:05:09.9836779Z Get:12 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [18.0 kB]
2023-03-09T10:05:10.1562071Z Get:13 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [686 kB]
2023-03-09T10:05:10.1604821Z Get:14 http://azure.archive.ubuntu.com/ubuntu jammy-security/main Translation-en [141 kB]
2023-03-09T10:05:10.1641138Z Get:15 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 c-n-f Metadata [8832 B]
2023-03-09T10:05:10.1669825Z Get:16 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [701 kB]
2023-03-09T10:05:10.2321226Z Get:17 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe Translation-en [112 kB]
2023-03-09T10:05:10.2337793Z Get:18 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 c-n-f Metadata [13.6 kB]
2023-03-09T10:05:10.4411810Z Get:19 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main armhf Packages [6355 B]
2023-03-09T10:05:10.4412867Z Err:19 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main armhf Packages
2023-03-09T10:05:10.4413587Z   File has unexpected size (6425 != 6355). Mirror sync in progress? [IP: 40.114.136.21 443]
2023-03-09T10:05:10.4414188Z   Hashes of expected file:
2023-03-09T10:05:10.4417136Z    - Filesize:6355 [weak]
2023-03-09T10:05:10.4418093Z    - SHA512:875cdcabbb3169029eb0d8a2b1212bd5052d20c1d08167598297670d11cc1374ebd2be539aef0872a38c3be9ee9949f4dce3c073155cb12d8f4fc706b91ac59e
2023-03-09T10:05:10.4419010Z    - SHA256:16e86d156b9687890ca43711440d1c1e4e9fabe1ed57c72863e7c087899cf832
2023-03-09T10:05:10.4419682Z   Release file created at: Wed, 08 Mar 2023 22:52:10 +0000
2023-03-09T10:05:10.4662055Z Get:20 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages [52.9 kB]
2023-03-09T10:05:10.4747090Z Get:21 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main arm64 Packages [11.9 kB]
2023-03-09T10:05:29.3118516Z Fetched 4299 kB in 1s (2947 kB/s)
2023-03-09T10:05:30.0402823Z Reading package lists...
2023-03-09T10:05:30.0514399Z E: Failed to fetch https://packages.microsoft.com/ubuntu/22.04/prod/dists/jammy/main/binary-armhf/Packages.gz  File has unexpected size (6425 != 6355). Mirror sync in progress? [IP: 40.114.136.21 443]
2023-03-09T10:05:30.0515448Z    Hashes of expected file:
2023-03-09T10:05:30.0516055Z     - Filesize:6355 [weak]
2023-03-09T10:05:30.0516927Z     - SHA512:875cdcabbb3169029eb0d8a2b1212bd5052d20c1d08167598297670d11cc1374ebd2be539aef0872a38c3be9ee9949f4dce3c073155cb12d8f4fc706b91ac59e
2023-03-09T10:05:30.0517985Z     - SHA256:16e86d156b9687890ca43711440d1c1e4e9fabe1ed57c72863e7c087899cf832
2023-03-09T10:05:30.0518700Z    Release file created at: Wed, 08 Mar 2023 22:52:10 +0000
2023-03-09T10:05:30.0519336Z E: Some index files failed to download. They have been ignored, or old ones used instead.
2023-03-09T10:05:30.0591135Z ##[error]Bash exited with code '100'.
2023-03-09T10:05:30.0605806Z ##[section]Finishing: Install Linux utilities

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,014 questions
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 26,487 Reputation points Moderator
    2023-03-27T04:30:43.25+00:00

    Hello Alexis RAFESTHAIN

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Based on the error shared, looks like there was an error while fetching the Microsoft packages repository during the apt-get update command. The error message suggests that the package file size is unexpected, indicating that the package may not have been completely downloaded or may have been corrupted during the download.

    Please try below suggestions and see if it helps resolve your issue:

    It could be issue with the apt cache and this can cause errors while updating or installing packages. You can try clearing the apt cache by running the following commands:

    sudo apt-get clean

    sudo rm -rf /var/lib/apt/lists/*

    sudo apt-get update

    Make sure the URL for the Microsoft packages repository is correct. Use below command, this will display the contents of the microsoft.list file, which should contain the repository URL. If the URL has changed, update it accordingly.:

    cat /etc/apt/sources.list.d/microsoft.list

    If you still continue to hit the issue, you can try manually downloading the package and installing it using the following commands:
    wget https://packages.microsoft.com/ubuntu/22.04/prod/pool/main/p/package-name/package-name-version.deb

    sudo dpkg -i package-name-version.deb

    Note: Replace package-name and package-version with the actual name and version of the package you want to install.

    Hope this helps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.