6

In Debian Wheezy, my /etc/apt/sources.list file looks like this:

deb https://mirrors.kernel.org/debian/ wheezy main contrib non-free
deb-src https://mirrors.kernel.org/debian/ wheezy main contrib non-free

deb http://security.debian.org/debian/ wheezy main contrib non-free
deb-src http://security.debian.org/debian/ wheezy main contrib non-free

deb https://mirrors.kernel.org/debian/ wheezy-updates main contrib non-free
deb-src https://mirrors.kernel.org/debian/ wheezy-updates main contrib non-free

When I do a sudo apt-get update the following error message appears:

E: The method driver /usr/lib/apt/methods/https could not be found

What is the fix for it?

  • 1
    For future reference, doing apt-file search /usr/lib/apt/methods/https would have pointed you to the missing package. – Faheem Mitha Nov 9 '14 at 8:23
3

My issue was somewhat similar. My /etc/apt/sources.list file did not contain any repo reading https. Yet, I could not install the package. The error I got when I ran the command sudo apt-get install apt-transport-https was this:

Err http://ftp.us.debian.org/debian/ testing/main apt-transport-https amd64 1.0.9.5  404  Not Found [IP: 64.50.236.52 80]
E: Failed to fetch http://ftp.us.debian.org/debian/pool/main/a/apt/apt-transport-https_1.0.9.5_amd64.deb  404  Not Found [IP: 64.50.236.52 80]

On close observation of the error, I thought maybe apt was pointing me to an obsolete package. So I manually tracked the package by browsing http://ftp.us.debian.org/debian/pool/main/a/apt/. There I found that the version apt-transport-https_1.0.9.5_amd64.deb did not exist and hence apt failed to fetch the package.

In order to fix the issue, I downloaded apt-transport-https_1.0.9.6_amd64.deb from the link and installed the deb package using dpkg -i apt-transport-https*. After that, when I ran sudo apt-get update, it worked fine.

If in case the source file is fine but apt fails to fetch a package, manually tracking the package might provide a solution.

7

You should install the package apt-transport-https. You might need to temporarily edit that sources.list to read http instead of https: if you have to download that package.

  • This works for the domain name deb.debian.org but not for security.debian.org. Any idea if we can use HTTPS for both domains? It looks like the certificate of security.debian.org is not valid. By the way, HTTPS should be the default, I don't understand why they provide it as an option to enable manually... – baptx May 25 at 9:16

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.