Issue
A package update or metadata cache command fails with a 401 Unauthorized error for the imunify360-alt-php repository:
Errors during downloading metadata for repository 'imunify360-alt-php':
- Status code: 401 for https://repo.alt.cloudlinux.com/.../alt-php/.../repodata/repomd.xml
Error: Failed to download metadata for repo 'imunify360-alt-php':
Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried- The issue can appear during commands such as:
yum update
yum makecache
dnf update
dnf makecache

Environment
- Imunify360
- Hardened PHP / ALT-PHP repository
-
imunify360-alt-phprepository - AlmaLinux, CloudLinux, or CentOS
-
yumordnf
Solution
- Check whether Hardened PHP is installed or actively used:
imunify360-agent features status hardened-php- If Hardened PHP is installed and used, refresh the Imunify360 license:
imunify360-agent update-license
yum clean all
yum makecacheFor dnf-based systems, use:
imunify360-agent update-license
dnf clean all
dnf makecache- If the issue persists and Hardened PHP is required, re-register the Imunify360 license:
imunify360-agent unregister
imunify360-agent register YOUR_KEY
yum clean all
yum makecacheFor dnf-based systems, use:
imunify360-agent unregister
imunify360-agent register YOUR_KEY
dnf clean all
dnf makecacheReplace YOUR_KEY with the actual Imunify360 license key.
- If Hardened PHP is not installed or not used, disable the
imunify360-alt-phprepository.
For yum-based systems:
yum-config-manager --disable imunify360-alt-php
yum clean all
yum makecacheFor dnf-based systems:
dnf config-manager --set-disabled imunify360-alt-php
dnf clean all
dnf makecacheAlternatively, set the repository to disabled in the corresponding repository file:
enabled=0- If the repository is disabled only as a temporary workaround, it can be temporarily enabled again when Hardened PHP packages are needed. If Hardened PHP is not used on the server, the repository can remain disabled.
- If license re-registration fails with a connection timeout or the repository still returns
401 Unauthorized, collect the Imunify360 doctor key and check server connectivity to Imunify360 services before further troubleshooting:
imunify360-agent doctorCause
The server cannot authenticate to repo.alt.cloudlinux.com for the Hardened PHP / ALT-PHP repository.
This usually happens when the authorization token for the imunify360-alt-php repository is stale, mismatched, or not properly regenerated from the current Imunify360 license. The same error can also appear when the Hardened PHP repository remains enabled on a server where Hardened PHP is not installed or not used.
Useful links
- https://docs.imunify360.com/dashboard/#hardenedphp
- https://cloudlinux.zendesk.com/hc/en-us/articles/4803569283228-Error-Cannot-retrieve-repository-metadata-repomd-xml-for-repository-imunify360-ea-php-hardened
- https://cloudlinux.zendesk.com/hc/en-us/articles/18423779344028-Status-code-401-for-https-repo-alt-cloudlinux-com-Error-Failed-to-download-metadata-for-repo-imunify360-ea-php-hardened-Cannot-download-repomd-xml-Cannot-download-repodata-repomd-xml-All-mirrors-were-tried
- https://cloudlinux.zendesk.com/hc/en-us/articles/5242706347292-Connectivity-issues-with-files-imunify360-com-or-imunify360-cloudlinux-com
Comments
0 comments
Please sign in to leave a comment.