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.
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.
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-certificatesThe 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.
E: Cannot set to hold: package 'package-name' is not installed
How to fix "Cannot set to hold" error when package is not installed in APT
debconf: unable to initialize frontend: Dialog
How to fix "debconf: unable to initialize frontend: Dialog" in APT
E: Could not connect to proxy server
Could not connect to proxy server
dpkg: serious warning: files list file for package 'package-name' contains empty filename
How to fix "files list file contains empty filename" in APT
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt