Developers working on Linux stacks may encounter a series of errors when working with Development tools such as apt packages that can be resolved with a workaround script. The root cause of the issue is not always clear but the script has managed to resolve issues such as:
Cannot initiate the connection to archive.ubuntu.com:80
(2001:67c:1562::15). - connect (101: Network is unreachable) Cannot initiate the
connection to archive.ubuntu.com:80 (2001:67c:1562::18).
- connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::16).
- connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::19).
- connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (185.125.190.36),
connection timed out Could not connect to archive.ubuntu.com:80 (91.189.91.39),
connection timed out Could not connect to archive.ubuntu.com:80 (91.189.91.38),
connection timed out Could not connect to archive.ubuntu.com:80 (185.125.190.39),
connection timed out [IP: 185.125.190.39 80]
In the samples we collected, the error above was being observed from running:
apt update
apt-get install xxx
Additionally, an error seen like the one below could also be seen on Linux stacks
E: Failed to fetch https://packagecloud.io/github/git-lfs/ubuntu/dists/focal/InRelease 402 Payment Required [IP: 13.56.57.255 443]
E: The repository 'https://packagecloud.io/github/git-lfs/ubuntu focal InRelease' is not signed.
As you can see, these errors vary from indicating connection issue all the way to a payment issue on the third party's end.
The following script managed to resolve both of these issues when added before the failing script:
sudo rm -fv /etc/apt/sources.list.d/github_git-lfs.list
sudo rm -fv /etc/apt/sources.list.d/github_git-lfs.list.save
This command removes the files offering a "clean slate" for the build and its steps to be able to fetch the apt packages on the next time the build is run with this script.
Happy Building!