Installing apt-transport-https issue


#1

Hi all,

trying to get .net core installed on a blank workspace, but in order to do that I need to install the apt-transport-https package. Unfortunatley I get the “Unable to locate package apt-transport-https” error below:

sliedig:~/workspace $ sudo apt update
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
sliedig:~/workspace $ sudo apt install apt-transport-https
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package apt-transport-https

Has anyone had this problem, and found a resolution?

Cheers,
Steve


#2

I’ve seen this issue before. The repo I added to the sources.list used https hence the E: The method driver /usr/lib/apt/methods/https could not be found. issue. Try installing apt-transport-https before adding any https repos and see if that helps.


#3

Thanks Brady, that worked. I actually started installing a whole bunch of stuff that required it and then try to install it. This will hopefully rectify the issues I was having. Cheers for the quick response mate.


#4

apt-transport-https is included by default in all new workspaces, so you shouldn’t encounter this again.


#5

Sweet. Thanks Justin


#6

I am seeing this issue still. When I try and do an update I get this.

anester:~/workspace $ sudo apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?

when I try and install apt-transport-https I get this

anester:~/workspace $ sudo apt-get install apt-transport-https
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package apt-transport-https

Any ideas?


#7

Yes, go to the /etc/apt/sources.list.d directory and rename (or move) the file you added or any file containing a reference to HTTPS. Then run sudo apt-get update, and sudo apt-get install apt-transport-https, and restore the file in sources.list.d. Then you can install whatever package you needed that required HTTPS.


#8

Thanks @dannytech, I’d been having the same issue, this resolved it for me!


#9

I couldn’t get this to work, even by removing all the files in sources.list.d. However, simply changing the documented command (I was installing google cloud sdk) from https to http worked.


#10

I was also trying to install Google cloud sdk when I encountered this error. Here is what I did:

As @dannytech mentioned, I renamed the google-cloud-sdk.list so that it’ll be ignored.

sudo mv /etc/apt/sources.list.d/google-cloud-sdk.list /etc/apt/sources.list.d/google-cloud-sdk.list1

Then I ran

sudo apt-get update && sudo apt-get install apt-transport-https

Then I replaced the original google-cloud-sdk.list back:

sudo mv /etc/apt/sources.list.d/google-cloud-sdk.list1 /etc/apt/sources.list.d/google-cloud-sdk.list

And then tried to install the Google cloud SDK again

sudo apt-get update && sudo apt-get install google-cloud-sdk

And it worked fine.

Also, @justin8 I created this workspace today but still apt-transport-https was not installed already. Hope you’ll fix this.


#11

That is really weird. I’ll get that fixed asap. I know I fixed and tested that. I’ve re-added it and made sure there are tests so it will be there in the future and fail builds if it’s missing


#12

It appears this is still broken. I’m experiencing the same issue w/ the “Is the package apt-transport-https installed?” being returned when I run $ sudo apt-get update && sudo apt-get install google-cloud-sdk". I had to follow the steps listed by suyashbansal to get a google-cloud-sdk update to install.


#13

I’ve just gotten this issue on a Private, Blank workspace as well. Tried $ sudo apt-get update and encountered the following message:
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?


#14

I’m having your exact issue when trying to upgrade the Heroku CLI. Did you ever find a resolution to this? The comments below you haven’t solved my issue.


How to update Heroku cli?
#15

looks like this is a bug in heroku installer script
it add https url to sources-list.d before running update and installing https transport, which breaks apt

to fix this try

sudo rm -f /etc/apt/sources.list.d/heroku.list
sudo apt-get update
sudo  apt-get install -y apt-transport-https ;

and then run heroku installer again


#16

I’m struggling with this same problem. I’ve tried all of the potential fixes in this thread, and in many similar threads. Running

sudo apt-get update

results in the following error:

E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?

I did start this app with the Hartl Rails Tutorial about a year ago, so that might be why I’m missing some needed files. But now the app has evolved into hundreds of files, so I would appreciate it there were some way to fix this problem without having to move all of my files into a different workspace.

Cheers!


#17

search for https in /etc/apt/sources.list.d/ move files containing https out of that directory, install apt-transport-https, and then restore the files. see also How to update Heroku cli?


#18

I’m facing this problem and here are things I have checked:

The file /etc/apt/sources.list is empty
The file /etc/apt/sources.list.save has various entries none of which require https

In /etc/apt/sources.list.d folder none of the files have an entry with https. I still went ahead and tried sudo rm -f /etc/apt/sources.list.d/heroku.list and sudo apt-get update but I still get the error:

Ign http://downloads-distro.mongodb.org dist InRelease
E: The method driver /usr/lib/apt/methods/https could not be found.            
N: Is the package apt-transport-https installed?

All of this started when I tried to run the debugger and it asked me to use apt-get update in order to install the missing module ikpdb.


#19

Turns out this can happen not only when you have an https source, but also when some of sources linked as http forces https on server side.

So looks like the only reliable way in this case is to remove .list file one by one until apt-get-update works.


#20

try this to install https:

sudo wget http://launchpadlibrarian.net/172457840/apt-transport-https_1.0.1ubuntu2_amd64.deb && sudo dpkg -i apt-transport-https_1.0.1ubuntu2_amd64.deb