I'm trying to install a package that has been removed from my Ubuntu release (17.10). Specifically, I'm trying to install libpng12-dev, which is a dependency of another program I'm trying to install, very similar to what this question asks about.
As discussed in that question, I can manually install the package pretty easily, but using a package manager is the preferred way to install packages, which I agree with.
I tried to adapt ffmurray's answer and combine it with the instructions at help.ubuntu.com, coming up with this:
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/ xenial main"
However, apt-get update
gives me this error:
The repository 'http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng xenial Release' does not have a Release file.
I'm not sure what's wrong, or if something like this can even work.
The question
Using apt (or other package managers), is there a proper way to install packages from previous Ubuntu releases like this? I realize that compatibility and stability become suspect when doing this, but I'd still like a semi-clean way of doing it.
Note that I'm looking for a general answer for previous release packages, not just libpng.
Partial solution while writing this question
On the libpng12-dev package page, within the "links for libpng12-dev" section, "download source package" subsection, there is a link for the package description. On a hunch, I removed the file name from the link address, which allowed me to browse the archive and figure out a few conventions.
It turns out I was over-specifying the site URL, and I only needed the http://site.domain/ubuntu/
portion of the URL. The remainder is resolved by supplying the Ubuntu release name (xenial), category (main), and package in apt-get
(libpng12-dev).
So instead, I should have done:
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ xenial main"
sudo apt-get update
sudo apt-get install libpng12-dev
Ran flawlessly!
I'm not sure how hacky this is as a solution. I feel like building/installing from source is a more robust way of dealing with older packages, but I'm not sure if that's true, nor how to do it.
Now that I somewhat know what I'm looking at, this answer regarding PPAs seems to support that this is, in fact, a good way of adding previous release packages.
If there's a better way, I'd sure like to know.
libpng12-dev
is handled in 17.10 bylibpng-dev
. Seeapt show libpng-dev