Linux 報錯Certificate verification failed: The certificate is NOT trusted.

Sonui發表於2024-07-17

在 Linux 系統中使用 apt-get 更新軟體時,出現錯誤 Certificate verification failed: The certificate is NOT trusted. 的解決方法

原因為未安裝ca-certificates

可以先編輯 /etc/apt/sources.list 檔案臨時使用http源

nano /etc/apt/sources.list

或者

vim /etc/apt/sources.list

貼上或者更改源(https://http://)

deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

然後安裝ca-certificates包(注意:看到有的文章將源改為http便無下文,建議繼續執行以下步驟改回https,使用http將大幅度提高網路風險

apt update
apt install ca-certificates

安裝完成後編輯源 /etc/apt/sources.list

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

執行apt update更新,完成

相關文章