Installation error: E: Unable to locate package caddy

I’m getting this very stubborn “E: Unable to locate package caddy” error when attempting to install Caddy on Ubuntu 16.04. I followed the steps outlined here to no avail.

Any idea on how to resolve this? I’m a Linux newbie and am feeling a bit frustrated.

root@freeblog:~# echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" \
>     | sudo tee -a /etc/apt/sources.list.d/caddy-fury.list
deb [trusted=yes] https://apt.fury.io/caddy/ /
root@freeblog:~# sudo apt update
Hit:1 http://hu.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://hu.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]     
Fetched 218 kB in 0s (358 kB/s)    
Reading package lists... Done
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:2
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:2
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:2
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:3
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:3
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:3
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:4
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:4
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:4
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:5
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:5
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:5
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:6
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:6
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:6
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
E: Failed to fetch https://apt.fury.io/caddy/InRelease  
E: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:2
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:2
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:2
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:3
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:3
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:3
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:4
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:4
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:4
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:5
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:5
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:5
W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:6
W: Target Translations (en_US) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:6
W: Target Translations (en) is configured multiple times in /etc/apt/sources.list.d/caddy-fury.list:1 and /etc/apt/sources.list.d/caddy-fury.list:6
root@freeblog:~# sudo apt install caddy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package caddy
root@freeblog:~# 

IIRC Ubuntu 16 is almost 5 years old and no longer supported. You have to manually install support for HTTPS, unfortunately. Some googling led me to:

and

Installing apt-transport worked, thanks! And I didn’t realize Ubuntu 16 is that old and no longer supported. The top results on Google for “how to install Caddy” use Ubuntu 16, so I thought it would be reliable if old.

I would assume a large number of potential Caddy users aren’t very proficient in Linux. Some more documentation on how to install it (or at least nudging hosts like DO and Linode to upgrade their guides) could dramatically increase adoption. I imagine many people give up after reading a few guides that don’t work.

I also saw there is a DO marketplace droplet and this is a good step as well. Thank you for making such an amazing piece of software.

Yikes, any reason you didn’t just use our official docs? Install — Caddy Documentation

Um, yeah, we have lots of that. See link above.

DigitalOcean doesn’t write any guides. Anyone can write a random blog post or article though; why not use our docs?

So… don’t do that. Read the official docs.

Thanks! You’re welcome.

I did! And I didn’t see anything about Ubuntu 16 being outdated. In any case, most people will probably search Google rather than navigate a tree of links with no guarantee of finding a solution. But I understand everyone views usability differently.

DO actually has quite a few community tutorials on Caddy such as this one:

In any case, thank you for your help!. I hope I can give back to the community and perhaps I will write my own blog post about the right way to install Caddy.

Ah, well, to be fair, it’s not our job to document when every version of every OS goes out of date. :stuck_out_tongue: Anyway, glad we could help. If you notice anything relevant that is missing in our docs (so, not lists of OSes that are outdated), feel free to open an issue or submit a PR to improve them!

Yeah… we never endorse those because they are not something we are in control of.

Caveat emptor!

1 Like

Ubuntu versions are named by the year and month they’re released. So 16.04 is released in April 2016. They release every 6 months. So the latest is actually 20.10.

2 Likes

Will do! And it’s of course not your job to document any of this (or anyone’s-- people are generously volunteering their time). I was just pointing out where new users unfamiliar with Linux might fall astray. A list of recommended distro versons on the download page would definitely help.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.