My Linux web hosts are having trouble downloading PHP updates. Is retrying the package manager the only practical option, or are there better ways around a struggling repository?
What can I do when PHP updates keep failing because the repo is overloaded?
Answers
Retrying can work, but first check the actual package manager error. A timeout or server error calls for a different fix than a signature failure, missing package, or dependency conflict.
If it really is a temporary download problem, space out retries rather than hammering the server. For a security update, weigh the delay against the exposure of the affected service rather than automatically putting it off for days.
Reply to this answer
Check whether a suitable alternative repository is available for your distribution, release, architecture, and PHP version. One option mentioned for Debian-based systems is the Sury package repository, but it is not necessarily a drop-in replacement for every PPA.
Before switching, review the repository's setup instructions and signing key, then check which package versions and dependencies the package manager would install. Test the change on one host or image before rolling it out.
Reply to this answer
For a fleet, a local repository mirror or package cache can take a lot of repeated downloads out of the picture. A mirror is more work to maintain, while a cache may be enough if the main problem is many hosts fetching the same packages.
Either way, it still needs access to a working upstream to get new patches. Syncing ahead of routine patch windows helps, but an urgent update may need an extra sync.
Reply to this answer
The answer may depend on where your packages come from. Reports differed across distributions and repositories, so check the availability and patched version for your specific PHP package rather than assuming every Linux host is affected in the same way.
Reply to this answer
Add your answer
Answers are reviewed before publication.
KELMIX-8v:
Also check architecture availability. A repository having the package for one architecture doesn't guarantee the same version is available for another.