This error occurs when apt tries to access HTTPS repositories but the necessary https transport method is not installed. Install the apt-transport-https package to resolve it.
When you run apt-get update or apt-get install, apt needs to fetch packages from repositories using various protocol methods (HTTP, HTTPS, FTP, etc.). By default, apt only has the HTTP method available. When your sources.list or sources.list.d files contain HTTPS URLs, apt cannot find the corresponding driver to handle them, causing this error. The error is your system telling you that apt attempted to use the HTTPS protocol handler but it doesn't exist.
The simplest solution is to install the missing package:
sudo apt-get install apt-transport-https
sudo apt-get updateThis installs the HTTPS method driver and should resolve the issue immediately.
If you cannot install apt-transport-https because apt itself is broken, you need to remove the problematic HTTPS sources first:
# Edit your main sources list
sudo nano /etc/apt/sources.listComment out any lines starting with https:// by adding # at the beginning. Then check your sources.list.d directory:
ls /etc/apt/sources.list.d/For any .list files containing HTTPS URLs, either comment them out or temporarily rename them:
sudo mv /etc/apt/sources.list.d/example-https.list /etc/apt/sources.list.d/example-https.list.bakOnce HTTPS sources are removed, update apt and install the required package:
sudo apt-get update
sudo apt-get install apt-transport-httpsNow you can re-enable the HTTPS sources and update again.
After apt-transport-https is installed, restore your HTTPS sources:
# Uncomment lines in /etc/apt/sources.list
sudo nano /etc/apt/sources.list
# Restore .list files in sources.list.d
sudo mv /etc/apt/sources.list.d/example-https.list.bak /etc/apt/sources.list.d/example-https.list
# Update apt with HTTPS sources now available
sudo apt-get updateIf automated installation still fails, manually download and install the package. First, identify your architecture:
dpkg-architecture -qDEB_HOST_ARCHThen download the .deb file for your system. For Raspbian/Debian ARM systems:
wget http://mirrordirector.raspbian.org/raspbian/pool/main/a/apt/apt-transport-https_1.0.9.8.4_armhf.deb
sudo dpkg -i apt-transport-https_1.0.9.8.4_armhf.debFor Ubuntu systems, find the correct URL from archive.ubuntu.com or a mirror site, matching your release and architecture.
Modern apt versions (after 2016) typically include HTTPS support by default in fresh installations, but systems upgraded from older versions or minimal container images may lack it. Some environments like Docker containers or chroot jails may have stripped this package to reduce image size. The HTTPS transport method is essential for secure package management over HTTPS connections. If you encounter this in Docker, ensure your Dockerfile installs apt-transport-https early in the build process before adding HTTPS-based sources.
E: Could not connect to proxy server
Could not connect to proxy server
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt
E: The value 'value' is invalid for APT::Default-Release
How to fix invalid APT::Default-Release value in APT
dpkg: error: unable to create new file 'path': Permission denied
How to fix dpkg permission denied errors in APT
subprocess installed post-removal script returned error exit status 1
How to fix "subprocess installed post-removal script returned error exit status 1" in APT