2024年1月7日 星期日

Fix Ubuntu meta-release-lts check fail problem

 After login, the following message is found in MOTD:

"Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings"

It is caused by incorrect system certificate setting, it can be checked by issuing the following command:

python3 -c 'import ssl; print(ssl.get_default_verify_paths().openssl_cafile)'
And the result shows:
/usr/local/ssl/cert.pem
However, thers is no cert.pem found on /usr/local/ssl. 
Fix this by add a cert.pm symbolic link to /etc/ssl/certs/ca-certificates.crt
sudo ln -s /etc/ssl/certs/ca-certificates.crt /usr/local/ssl/cert.pem
Then, remove old motd check by:
sudo rm /var/lib/ubuntu-release-upgrader/release-upgrade-available
Update the motd message by:
sudo /usr/lib/ubuntu-release-upgrader/release-upgrade-motd
Now, it's done! Problem fixed.
I think this is a better solution then modify MetaRelease.py to ignore the certificates.

沒有留言: