How to fix E: Package 'apt-transport-https' has no installation candidate in APT
This error occurs when trying to install apt-transport-https on modern Ubuntu/Debian systems where HTTPS support is already built into the apt package. The solution is to either skip installing this package entirely or update your package repositories first.
Quick fix
Fixes E: Package 'apt-transport-https' has no installation candidate
lsb_release -a- Check your Ubuntu/Debian version
- Update package repositories
- Skip apt-transport-https on modern systems
- Install ca-certificates instead if needed
lsb_release -aE: Package 'apt-transport-https' has no installation candidate
What this error means
The apt-transport-https package is a dummy transitional package that was used in older Debian/Ubuntu systems to provide HTTPS support for package repositories. Since apt version 1.5 (Ubuntu 17.10 and later), HTTPS support has been built directly into the apt package itself, making apt-transport-https obsolete. When you try to install it on a modern system, apt cannot find an installation candidate because the package no longer exists in the repository, or exists only as a placeholder that apt skips in favor of the built-in functionality.
Typical symptoms
- apt install apt-transport-https command fails with "has no installation candidate" error
- Docker installation scripts fail when they try to install apt-transport-https as a prerequisite
- Custom PPA setup instructions fail at the apt-transport-https installation step
- Error appears even after running apt update
Common causes
- Using outdated installation instructions that were written for Ubuntu 16.04 or earlier
- Trying to install the package on Ubuntu 18.04 or later where it has been removed from standard repositories
- Package repositories not refreshed with apt update before attempting installation
- Running on a minimal container image (like Docker) that does not have the package metadata
How to fix "E: Package 'apt-transport-https' has no installation candidate"
Run lsb_release -a or cat /etc/os-release to determine your system version. If you are on Ubuntu 17.10 or later, or Debian 10 or later, apt-transport-https is not needed.
lsb_release -aRun apt update to refresh your package lists. This ensures apt is aware of all available packages:
sudo apt updateIf the issue is a missing apt-transport-https dependency in a script, running this command first often resolves the problem.
For Ubuntu 18.04 (Bionic) or later, do not attempt to install apt-transport-https. HTTPS support is already built into apt. If a script or tutorial tells you to install it, simply remove that line from the instructions.
If you are setting up a custom HTTPS repository, ensure you have ca-certificates installed instead. This package provides the SSL/TLS certificates needed for HTTPS connections:
sudo apt install ca-certificatesThis is sufficient for HTTPS support in modern apt versions.
If you encounter this error in a Docker build or automated script, remove the apt-get install apt-transport-https line. Replace any references to apt-transport-https with ca-certificates:
# Before (outdated)
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates
# After (current)
RUN apt-get update && apt-get install -y ca-certificatesAdvanced notes
The apt-transport-https package exists in modern Ubuntu/Debian repositories as a "dummy transitional package" for backward compatibility with old installation scripts. When apt encounters a request to install it, it silently selects the apt package instead, which already provides HTTPS functionality. However, if the package is listed as a strict dependency (not just recommended), some package managers may fail with the "no installation candidate" error. The safest approach is to remove all references to apt-transport-https from new installations and only use it for systems running Ubuntu 16.04 LTS or earlier. For Docker, using slim or minimal base images often causes this issue because they have minimal package metadata; always run apt update before installing any packages in Docker to ensure the package index is current.
Frequently asked questions
- What does "E: Package 'apt-transport-https' has no installation candidate" mean?
- The apt-transport-https package is a dummy transitional package that was used in older Debian/Ubuntu systems to provide HTTPS support for package repositories. 10 and later), HTTPS support has been built directly into the apt package itself, making apt-transport-https obsolete. When you try to install it on a modern system, apt cannot find an installation candidate because the package no longer exists in the repository, or exists only as a placeholder that apt skips in favor of the built-in functionality.
- How do I fix "E: Package 'apt-transport-https' has no installation candidate"?
- This error occurs when trying to install apt-transport-https on modern Ubuntu/Debian systems where HTTPS support is already built into the apt package. The solution is to either skip installing this package entirely or update your package repositories first.
- What causes "E: Package 'apt-transport-https' has no installation candidate"?
- Using outdated installation instructions that were written for Ubuntu 16.04 or earlier Trying to install the package on Ubuntu 18.04 or later where it has been removed from standard repositories Package repositories not refreshed with apt update before attempting installation
- Is the "E: Package 'apt-transport-https' has no installation candidate" error serious?
- It is a low-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐APT Official Documentation
- ๐Ubuntu Launchpad - apt-transport-https package(Official Docs)
- ๐Ubuntu Manpage: apt-transport-https(Official Docs)
- ๐ฌRaspberry Pi Forums discussion(Stack Overflow)