Description
In the Software Sources mirror selector, all Base (Noble) Ubuntu mirrors
show "Unreachable" even though they are fully accessible via apt and curl.
The issue affects Linux Mint 22.1 Xia.
Root Cause
The get_url_last_modified() function in mintSources.py uses pycurl
with its default user-agent to fetch ls-lR.gz from the base_default
mirror (archive.ubuntu.com) to establish a reference timestamp.
However, archive.ubuntu.com is behind Cloudflare, which blocks pycurl's
default user-agent with a 403 Forbidden response. This causes
pycurl.INFO_FILETIME to return -1, making default_mirror_date = None.
Since every candidate mirror's freshness is compared against
default_mirror_date, all mirrors fail the check and are marked
"Unreachable" regardless of their actual availability.
Steps To Reproduce
- Open Software Sources
- Click on Base (Noble) mirror selector
- All mirrors show "Unreachable"
- Meanwhile,
sudo apt update works perfectly fine
Proof of the 403 Block
Running the exact same logic mintSources uses internally without a user-agent:
import pycurl, datetime
c = pycurl.Curl()
c.setopt(pycurl.URL, "https://archive.ubuntu.com/ubuntu/ls-lR.gz")
c.setopt(pycurl.CONNECTTIMEOUT, 5)
c.setopt(pycurl.TIMEOUT, 30)
c.setopt(pycurl.FOLLOWLOCATION, 1)
c.setopt(pycurl.NOBODY, 1)
c.setopt(pycurl.OPT_FILETIME, 1)
c.perform()
print(c.getinfo(pycurl.HTTP_CODE)) # Returns 403
print(c.getinfo(pycurl.INFO_FILETIME)) # Returns -1
The Fix
Adding a browser-like user-agent to the pycurl request in
get_url_last_modified() in mintSources.py:
c.setopt(pycurl.USERAGENT, "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36")
This returns HTTP 200 with a valid Last-Modified timestamp, allowing
all mirrors to be evaluated correctly.
Expected Behavior
Base (Noble) mirrors should display their actual download speeds.
Actual Behavior
All Base (Noble) mirrors show "Unreachable".
Screenshots
Before fix — all mirrors showing "Unreachable":

Terminal proof of Cloudflare 403 block (without user-agent):

Terminal proof after fix (HTTP 200 with user-agent):

After fix — mirrors showing actual speeds:

System Information
|
|
| OS |
Linux Mint 22.1 Xia |
| Base |
Ubuntu 24.04 Noble |
| mintsources |
2.3.2 |
| mint-mirrors |
1.2.9 |
Additional Notes
sudo apt update works perfectly fine — this is purely a GUI issue
- The bug is caused by Cloudflare's bot protection blocking pycurl's
default user-agent specifically on archive.ubuntu.com
- This likely affects all users whose systems resolve
archive.ubuntu.com
through Cloudflare, which may be region-dependent
- A simple one-line fix in
get_url_last_modified() resolves the issue completely
Description
In the Software Sources mirror selector, all Base (Noble) Ubuntu mirrors
show "Unreachable" even though they are fully accessible via apt and curl.
The issue affects Linux Mint 22.1 Xia.
Root Cause
The
get_url_last_modified()function inmintSources.pyuses pycurlwith its default user-agent to fetch
ls-lR.gzfrom thebase_defaultmirror (
archive.ubuntu.com) to establish a reference timestamp.However,
archive.ubuntu.comis behind Cloudflare, which blocks pycurl'sdefault user-agent with a 403 Forbidden response. This causes
pycurl.INFO_FILETIMEto return-1, makingdefault_mirror_date = None.Since every candidate mirror's freshness is compared against
default_mirror_date, all mirrors fail the check and are marked"Unreachable" regardless of their actual availability.
Steps To Reproduce
sudo apt updateworks perfectly fineProof of the 403 Block
Running the exact same logic mintSources uses internally without a user-agent:
The Fix
Adding a browser-like user-agent to the pycurl request in
get_url_last_modified()inmintSources.py:This returns HTTP 200 with a valid
Last-Modifiedtimestamp, allowingall mirrors to be evaluated correctly.
Expected Behavior
Base (Noble) mirrors should display their actual download speeds.
Actual Behavior
All Base (Noble) mirrors show "Unreachable".
Screenshots
Before fix — all mirrors showing "Unreachable":

Terminal proof of Cloudflare 403 block (without user-agent):

Terminal proof after fix (HTTP 200 with user-agent):

After fix — mirrors showing actual speeds:

System Information
Additional Notes
sudo apt updateworks perfectly fine — this is purely a GUI issuedefault user-agent specifically on
archive.ubuntu.comarchive.ubuntu.comthrough Cloudflare, which may be region-dependent
get_url_last_modified()resolves the issue completely