If you face an errors similar to these when trying to do things on your AlmaLinux server:
Curl error (60): SSL peer certificate or SSH remote key was not OK for https://…..xml [SSL certificate problem: certificate is not yet valid]
curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
curl: (60) SSL certificate problem: certificate is not yet valid
More details here: https://curl.se/docs/sslcerts.html
there is a high possibility that your system has an incorrect date and time set (system clock is behind).
Check the system time on Almalinux
To check if the current date and time is showing up correctly on your AlmaLinux server, please use the following command:
timedatectl status
Disable automatic time synchronization
In order to be able to change the system time immediately, you must first disable the automatic time synchronization. Use this command to ensure that the automatic time sync is disabled:
sudo timedatectl set-ntp false
Set a correct system date and time
Use this command to set a correct system time. Replace the YYYY-MM-DD HH:MM:SS with the current date and time according to the given format (e.g. 2027-05-05 21:58:05):
sudo timedatectl set-time "YYYY-MM-DD HH:MM:SS"
Enable back the automatic time synchronization
Use this command to enable back the automatic time synchronization. Leave it disabled only if you face problems with it.
sudo timedatectl set-ntp true