How do I fix a "E: The method driver /usr/lib/apt/methods/http could not be found." error?

205,761

Solution 1

SirCharlo said in the duplicate of this question:

sudo apt-get install apt-transport-https

I tried it and it worked for me.

Solution 2

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

Solution 3

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.

Solution 4

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!

Solution 5

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

Share:
205,761
Abe
Author by

Abe

Updated on September 18, 2022

Comments

  • Abe
    Abe almost 2 years

    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?

    • Admin
      Admin almost 12 years
      Can you show your /etc/apt/sources.list?
    • Admin
      Admin about 5 years
      See the answer for this one, it solved the issue for me on Debian Stretch.
  • Abe
    Abe almost 12 years
    Everything is in good form any other ideas?
  • Chris J.T. Auld
    Chris J.T. Auld over 11 years
    This worked for me in Debian Squeeze.
  • Avinash Raj
    Avinash Raj about 10 years
    How is this possible? He can't able to connect to the internet.
  • muru
    muru about 8 years
    That's called a captive portal.
  • Owen
    Owen over 7 years
    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 :(
  • Bratchley
    Bratchley over 7 years
    @Owen why not just disable the https repo until you can update your cache?
  • mikemaccana
    mikemaccana almost 7 years
    @Owen that would allow someone else to provide a replacement or trojan wrapper around any unsigned package.
  • dlewin
    dlewin over 6 years
    The OrangePI seems actually to still have this problem, could you precisely explain what do you mean by a "symlink" in this case please ?
  • Alex
    Alex about 6 years
    @dlewin cd /usr/lib/apt/methods then ln -s http https does the trick.
  • David 天宇 Wong
    David 天宇 Wong almost 6 years
    so you're saying you should update over an insecure connection?
  • shenk
    shenk about 5 years
    this was the only solution that worked for me on kali linux