How to fix "apt-get install -f apt-transport-https" error: 404 Not Found?
I appear to have fixed the issue by symlinking the https
dir in /usr/lib/apt/methods
to the http
dir.
root@validator-dev-group-c2v4:~# cd /usr/lib/apt/methods
root@validator-dev-group-c2v4:/usr/lib/apt/methods# ln -s http https
Since I don't actually have any https://
sources configured it seems harmless and then when apt-get install apt-transport-https
runs it actually overwrites the symlink with the correct files.
The general solution is to update apt
's indexes so it knows which versions are available:
apt-get update
Then installing apt-transport-https
will find the appropriate versions on the repositories.
You should do this every time you want to install a new package, unless you've done it recently (within the last day typically).
If you can't run apt-get update
because it needs apt-transport-https
, you can fix things by (temporarily) switching your https://
URLs to http://
in /etc/apt/sources.list
(and perhaps files in /etc/apt/sources.list.d
). Using HTTP to download packages doesn't reduce your security, it only reduces your confidentiality (systems between your computer and the repositories can see what packages you're retrieving).
If that doesn't work, you can try picking a specific mirror, which should avoid any redirections to HTTPS URLs; look at the list, pick a mirror close to you and use that instead of httpredir.debian.org
in your sources.
In your specific case it may well be simpler to manually download the required packages (and ship them alongside your setup scripts so that they continue working): apt-transport-https
, libapt-pkg4.12
and whatever else is necessary. (You may end up needing to upgrade apt
at the same time.)