One of the reasons Flathub is relatively fast regardless of where it’s used is CDN service provided by Fastly. This is not a good thing for users from China though, where Fastly, and thus Flathub, is blocked. Similar services are operating in China, but being an open source project, it’s easy to guess our budget is close to zero.
Felix Yan, a fellow Arch developer, suggested some VPS providers that are considered “China-friendly”. In the end, I configured two new servers in Seoul using Oracle Cloud free tier.
As Flathub enforces the remote URL for historical reasons, switching to a different address requires performing some manual changes from the terminal:
- Check with
flatpak remote-listwhether Flathub remote is configured globally (
system) or for the current user only (
user). It may be both.
/var/lib/flatpak/repo/configfor system installations or
~/.local/share/flatpak/repo/configfor user installation in a text editor.
[remote “flathub”]section. Change
https://sel.flathub.org/repo/. Add new line below with following content:
The entire section should look similar to:
[remote “flathub”] url=https://sel.flathub.org/repo/ url-is-set=true xa.title=Flathub gpg-verify=true gpg-verify-summary=true xa.comment=Central repository of Flatpak applications xa.description=Central repository of Flatpak applications xa.icon=https://dl.flathub.org/repo/logo.svg xa.homepage=https://flathub.org/
All subsequent Flatpak operations will go through one of the mirrors/proxies in Seoul now. I have also submitted a pull request which will make the process less manual.
If you are located in China, please give it a try and leave feedback in related GitHub issue. We’ll keep it running and mention in the setup instructions if it works well.