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

SirCharlo said in the duplicate of this question:

sudo apt-get install apt-transport-https

I tried it and it worked for me.


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