Problem Description
A package update or metadata cache command fails with a 401 Unauthorized error for the imunify360-alt-php repository:
Problem Resolution
Check if Hardened PHP is used:
imunify360-agent features status hardened-php
If it is not, then deactivate the repo:
dnf config-manager --set-disabled imunify360-alt-php
If it is used, you'll need to generate a new key for the server in the CloudLinux panel and activate it on the server. See their article below for full details/steps.
Source: https://cloudlinux.zendesk.com/hc/en-us/articles/23344843719196-Status-code-401-for-repo-alt-cloudlinux-com-in-the-imunify360-alt-php-repository