"method driver /usr/lib/apt/methods/https could not be found" update error

在配置了/etc/apt/sources.list中使用了https之后,出现如下错误

$sudo apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.

如果是中文系统的话,会输出如下信息:

$sudo apt-get update
E: 无法找到获取软件包的渠道 /usr/lib/apt/methods/https 所需的驱动程序。

解决的方法是安装apt-transport-https:

$ sudo apt-get install apt-transport-https

如果此时执行

$ sudo apt-get update

更新会提示:

server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

则执行如下命令来更新本地的证书:

$ echo -n | openssl s_client -connect www.mobibrw.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee '/usr/local/share/ca-certificates/www_mobibrw_com.crt'

$ sudo update-ca-certificates

然后就一切正常了。

参考链接


发布者

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注