37

I tried to update my OS Debian jessie using the terminal and i get an error :

“E: The method driver /usr/lib/apt/methods/https could not be found.” error?

My 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 

How to fix apt-get update and aptitude update?

  • 1
    Keep in mind that there's no integrity benefit to using HTTPS since packages have signatures that are verified anyway - which is probably even better since you're not trusting many independent CAs. THere ay be some privacy benefit. See also: unix.stackexchange.com/questions/90227/… – Bob Feb 18 '16 at 0:07
78

Sounds like you may have added some https sources. Since there are no https sources in your sources.list, it would be something in /etc/apt/sources.list.d/.

You may also be dealing with a proxy that always redirects to https.

You can add support for https apt sources by installing a couple of packages:

apt-get install apt-transport-https ca-certificates

If your apt-get is too broken to do this, you can download the package directly and install it with dpkg -i. Any additional dependencies of that package can be tracked down and fetched similarly (dpkg will let you know if anything is missing).

If it still doesn't work, you might try editing the source entry to use http instead of https, or just remove it and start over following the source maintainer's instructions.

  • For me, installing "apt-transport-https" and "ca-certificates" didn't fix the issue, but updating the files in "/etc/apt/sources.list.d/" (for me it was nodesource.list) to use http instead of https fixed it – Harendra Singh Nov 28 '18 at 9:44
  • sudo dpkg -i <deb for apt-transport-https> worked for me, but that install had dependencies that I had to fix with apt-get update, which the package install for apt-transport-https allowed me to perform. – HeatfanJohn Feb 20 at 20:55
  • "Unable to locate package apt-transport-https" – Anentropic Mar 21 at 14:01
  • This totally fixed it for me! Thank you thank you thank you! – Mike Wills Apr 3 at 1:53
  • For me it actually turned out that an http source was the cause of the above issue. Removing the corresponding file in /etc/apt/sources.list.d/ fixed it. – balu Apr 30 at 9:01
7

For me this issue happened because one of the mirrors happened to always redirect to https. So none of my sources were https, but due to the redirect, apt would end up trying to fetch something off an https site. To resolve this, I had to manually download and install:

  • libcurl3-gnutls and
  • apt-transport-https

(apt-transport-https had a dependency on libcurl3-gnutls).

Once those were installed, I was able to successfully install any other package, even if the mirror was on https.

2

There are a few possible issues that can cause this issue. The most likely solution would be to run:

sudo apt-get install apt-transport-https

You can find more details and possible causes for this issue here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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