Error installing `gdb` on github actions

When installing gdb with: sudo apt-get install gdb it fails with:

Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  gdbserver libbabeltrace1 libc6-dbg libipt1
Suggested packages:
  gdb-doc
The following NEW packages will be installed:
  gdb gdbserver libbabeltrace1 libc6-dbg libipt1
0 upgraded, 5 newly installed, 0 to remove and 14 not upgraded.
Need to get 8662 kB of archives.
After this operation, 51.4 MB of additional disk space will be used.
Get:1 http://azure.archive.ubuntu.com/ubuntu bionic/main amd64 libbabeltrace1 amd64 1.5.5-1 [154 kB]
Get:2 http://azure.archive.ubuntu.com/ubuntu bionic/universe amd64 libipt1 amd64 1.5-1ubuntu1 [28.6 kB]
Err:3 http://azure.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libc6-dbg amd64 2.27-3ubuntu1.3
  404  Not Found [IP: 52.252.75.106 80]
Get:4 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main amd64 gdb amd64 8.2-0ubuntu1~18.04 [3024 kB]
Get:5 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main amd64 gdbserver amd64 8.2-0ubuntu1~18.04 [292 kB]
Fetched 3499 kB in 1s (2882 kB/s)
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/g/glibc/libc6-dbg_2.27-3ubuntu1.3_amd64.deb  404  Not Found [IP: 52.252.75.106 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

The actual job can be seen at: Show full stack trace on exception with __cause__ or __context__. debugpy:391 · fabioz/PyDev.Debugger@83cb634 · GitHub

This used to work on GitHub actions (and I think it should work out of the box). Is this some bug?

– note: I need gdb on Linux to check the attach to process feature in the pydevd debugger.

Try running apt-get update before installing packages with apt-get install as the error message suggest.

sudo apt-get update
sudo apt-get install gdb

Yesterday I had a similar issue when installing some dependencies.

E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/libi/libinput/libinput-bin_1.10.4-1ubuntu0.18.04.1_amd64.deb  404  Not Found [IP: 52.252.75.106 80]
Fetched 18.8 MB in 1s (29.9 MB/s)
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/main/libi/libinput/libinput10_1.10.4-1ubuntu0.18.04.1_amd64.deb  404  Not Found [IP: 52.252.75.106 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Which was fixed by running apt update before apt install