apt-get 失败:找不到方法驱动程序 /usr/lib/apt/methods/https

GAD*_*D3R 78 debian apt https

我尝试使用终端更新我的 OS Debian jessie,但出现错误:

“E: The method driver /usr/lib/apt/methods/https could not be found.” error?
Run Code Online (Sandbox Code Playgroud)

我的 sources.list :

deb http://httpredir.debian.org/debian/ jessie main
deb-src http://httpredir.debian.org/debian/ jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'
deb http://httpredir.debian.org/debian/ jessie-updates main
deb-src http://httpredir.debian.org/debian/ jessie-updates main

deb http://ftp.de.debian.org/debian jessie main 
Run Code Online (Sandbox Code Playgroud)

如何修复apt-get updateaptitude update

Mat*_*ath 144

听起来您可能添加了一些 https 源。因为有你没有HTTPS来源sources.list,这将是东西/etc/apt/sources.list.d/

您可能还需要处理总是重定向到 https 的代理。

您可以通过安装几个软件包来添加对 https apt 源的支持:

apt-get install apt-transport-https ca-certificates
Run Code Online (Sandbox Code Playgroud)

如果您apt-get太坏而无法执行此操作,您可以直接下载该软件包并使用dpkg -i. 该包的任何其他依赖项都可以被跟踪并以类似方式获取(dpkg如果缺少任何内容,将通知您)。

如果它仍然不起作用,您可以尝试编辑源条目以使用 http 而不是 https,或者只是将其删除并按照源维护者的说明重新开始。

  • “无法找到包 apt-transport-https” (2认同)

小智 9

对我来说,发生这个问题是因为其中一个镜像碰巧总是重定向到 https。所以我的来源都不是 https,但是由于重定向,apt 最终会尝试从 https 站点获取某些内容。为了解决这个问题,我不得不手动下载并安装:

  • libcurl3-gnutls
  • apt-transport-https

(apt-transport-https 依赖于 libcurl3-gnutls)。

安装完成后,即使镜像位于 https 上,我也能够成功安装任何其他软件包。