109

I tried updating my packages from the terminal and this is what I got:

$ 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.

What does this mean? I'm using the United States mirror an I've tried using the main server for the mirror and I keep getting the same result is this because there are no updates?

  • Can you show your /etc/apt/sources.list? – César Jul 19 '12 at 20:28
  • 1
    See the answer for this one, it solved the issue for me on Debian Stretch. – reim May 9 at 9:16
186

SirCharlo said in the duplicate of this question:

sudo apt-get install apt-transport-https

I tried it and it worked for me.

  • 1
    This worked for me in Debian Squeeze. – Matt Alexander Dec 12 '12 at 22:27
  • 1
    How is this possible? He can't able to connect to the internet. – Avinash Raj Apr 12 '14 at 12:16
  • 1
    Sadly, this won't work if your apt cache is too far out of date. Now I'm stuck in a "hole in the bucket" problem :( – Owen Oct 3 '16 at 15:34
  • Worked for me, thanks. Debian 7.x – Vitor Luiz da Silva Oct 31 '16 at 9:57
  • 1
    @Owen that would allow someone else to provide a replacement or trojan wrapper around any unsigned package. – mikemaccana Sep 11 '17 at 18:53
7

in my case, find all the source in .list file, eg:

/etc/apt/sources.list 
/etc/apt/sources.list.d/nginx.list 
/etc/apt/sources.list.d/passenger.list

some source in the list are forced using https:// even if you changed it into http:// it will redirected to https://

the solutions is :

  1. backup and remove the https source first
  2. then run apt-get update
  3. run sudo apt-get install apt-transport-https
  4. restore the https source
  • so you're saying you should update over an insecure connection? – David 天宇 Wong Jun 29 '18 at 9:27
  • this was the only solution that worked for me on kali linux – shenk Apr 5 at 12:15
4

Had the same problem on fresh OrangePi image. Swapping https to http didn't help. Finally I created a symlink to http with name https and was able to perform apt-get update. The first thing to install was apt-transport-https than I re-run the update.

  • 1
    The OrangePI seems actually to still have this problem, could you precisely explain what do you mean by a "symlink" in this case please ? – dlewin Feb 28 '18 at 14:12
  • 2
    @dlewin cd /usr/lib/apt/methods then ln -s http https does the trick. – Alex Apr 14 '18 at 11:32
2

My problem was the Opera browser in /etc/apt/sources.list.d/opera-stable.list was, it was wrote:

https//:

but the correct is:

https://

So I fix the line this way:

deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)

and all solved!

0

I have faced this problem before, in my case the problem was in /etc/apt/sources.list. Make sure there are no quotation marks '' or "":

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

Remove quotes and change those lines to:

deb http://archive.canonical.com/ubuntu/ maverick partner (Source Code)

Also, as @arhimed suggests, make sure the protocol is well-formed: http://

  • Everything is in good form any other ideas? – Abe Jul 20 '12 at 14:12
0

My error read method driver /usr/lib/apt/methods/htttp and after reading here and trying all offerings, I was about to give up when I noticed that the http had one extra t.

I went to did this:

sudo -H gedit /etc/apt/source.list

Ctrl + F to find all instances of htttp.

removed the extra t

Saved (twice to make sure the bugger took it)

And viola, problem solved.

Guess that means I need to REALLY Read the error messages as I had been skimming over them. Lesson learned. that won't happen again

0

look for https links in /etc/apt/sources.list check if http link of the same link works. if it does then replace http with https and enjoy. otherwise install sudo apt-get install apt-transport-https as said in the above answer by Damiön la Bagh

0

My comments here aren't directly related to the OP's question, but since this page comes up in google's first result when searching E: The method driver /usr/lib/apt/methods/https could not be found. which is the error I was originally trying to solve, I am adding some information which helped me solve my problem.

I happen to be on an ethernet network which contains a "firewall" type device that redirects an unknown computer's web traffic to a webpage that requires you the "agree" to the terms of service for the network before you can continue. This page happens to be served as a HTTPS page. Therefore, any time apt-get tried to connect, it was ending up at an HTTPS site. This is also why trying to install apt-transport-https wasn't working for me.

0

I realize this is a very old thread, but in my case the sources.list file was missing "http." in the address. (ie, http://kali.org vs http://http.kali.org) I discovered this when comparing two VM's in my environment. Not sure where the error came from, but replacing that solved the issue.

protected by Community Sep 11 '17 at 22:55

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.