如何修复“E:找不到方法驱动程序/usr/lib/apt/methods/http”。错误?

Abe*_*Abe 111 updates apt sudo

我尝试从终端更新我的包,这就是我得到的:

$ sudo apt-get update
E: The method driver /usr/lib/apt/methods/http could not be found.
E: The method driver /usr/lib/apt/methods/http could not be found.
E: The method driver /usr/lib/apt/methods/http could not be found.
E: The method driver /usr/lib/apt/methods/http could not be found.
E: The method driver /usr/lib/apt/methods/http could not be found.
Run Code Online (Sandbox Code Playgroud)

这是什么意思?我正在使用美国镜像,并且我尝试使用主服务器作为镜像,但我一直得到相同的结果,这是因为没有更新吗?

Kat*_*dam 188

SirCharlo 在这个问题的副本中说:

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

我试过了,它对我有用。


小智 7

就我而言,在 .list 文件中找到所有源,例如:

/etc/apt/sources.list 
/etc/apt/sources.list.d/nginx.list 
/etc/apt/sources.list.d/passenger.list
Run Code Online (Sandbox Code Playgroud)

列表中的某些源强制使用 https:// 即使您将其更改为 http:// 它也会重定向到 https://

解决方案是:

  1. 备份和取消HTTPS源第一
  2. 然后运行 apt-get update
  3. 运行sudo apt-get install apt-transport-https
  4. 恢复https源


小智 6

在新鲜的 OrangePi 图像上有同样的问题。将 https 交换为 http 没有帮助。最后,我创建了一个名为 https 的 http 符号链接,并且能够执行 apt-get 更新。安装的第一件事是 apt-transport-https,然后我重新运行更新。

  • @dlewin `cd /usr/lib/apt/methods` 然后`ln -s http https` 就可以了。 (3认同)

Cés*_*sar 0

我以前遇到过这个问题,就我而言,问题出在/etc/apt/sources.list. 确保没有引号''""

deb "http://archive.canonical.com/ubuntu/ maverick partner (Source Code)"
Run Code Online (Sandbox Code Playgroud)

删除引号并将这些行更改为:

deb http://archive.canonical.com/ubuntu/ maverick partner (Source Code)
Run Code Online (Sandbox Code Playgroud)

另外,正如 @arhimed 所建议的,确保协议格式良好:http://