How to install apt-transport-https in Ubuntu

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to to be able to download packages safely via SSL when downloading packages with apt.

apt is the default package manager for Ubuntu, and other Debian based distros.

If you are running an old version of apt, older than apt 1.5, downloading packages via HTTPS protocol is not done automatically, so in order to download packages securely via HTTPS protocol for older apt versions, then you need to have apt-transport-https package installed in your system.

In this tutorial, we'll be installing apt-transport-https in Ubuntu by using apt package manager.

Installing apt-transport-https in Ubuntu

Step 1 - Update your Ubuntu system

No matter the Ubuntu version that you are running, checking for updates is done using the same command.

To update your Ubuntu system, simply run the following.

sudo apt update && apt upgrade -y

💡
Note: In the command above, we are running two commands, apt update to check for updates, and apt-upgrade -y which will automatically upgrade packages that are outdated.

Step 2 - Install apt-transport-https

The apt-transport-https package can be found on the default Ubuntu repositories for the following versions : Ubuntu 20.04 LTS (Focal), Ubuntu 22.04 LTS (Jammy), Ubuntu 23.04 (lunar), Ubuntu 23.10 (mantic) and Ubuntu 24.04 (noble) which will be released in April 2024.

So, if you are running any of the Ubuntu versions mentioned above, you can install apt-transport-https easily from your terminal, via apt.

To do so, simply run the command below.

sudo apt install apt-transport-https

Step 3 - Use apt-transport-https

Now that apt-transport-https package is installed in your Ubuntu system, you should be able to download packages over HTTPS protocol.

apt-transport-https is automatically used by apt, so you don't need to setup or do anything else manually.

All you have to do now is use apt to download or update your system.

sudo apt command

Conclusion

In this tutorial, you learned how to install apt-transport-https in Ubuntu, and why this package is needed when you are using an older version of apt package manager, which doesn't support downloading packages from HTTPS sources automatically without apt-transport-https like in apt 1.5 and newer versions.