0

I've created a local repository as per BigSack's answer in this thread. I'm using the /var/cache/apt/archives of an old installation of Ubuntu on an external HDD (which I've renamed 'oldhd').

My entry in /etc/apt/sources.list looks like this:

## This is a custom-repository for installing packages from my old HDD
## HP EliteBook 8460p Ubuntu installation. To install a package
## specifically from there, use: sudo apt install -t oldhd [package]
deb file:/media/me/9c4141dd-b628-439d-b464-0ff988fc849d/var/cache/apt/oldhd ./

Everything seems to work alright. I have the Packages.gz and Sources.gz files in the repository directory. sudo apt update completes without issue. The problem is when I try to install a package from this repository, I get an error:

me@Alcatraz: sudo apt install -t oldhd [package]
Reading package lists... Done
E: The value 'oldhd' is invalid for APT::Default-Release as such a 
release is not available in the sources

This is the same error I get if I type in nonsense:

me@Alcatraz: sudo apt install -t kldjflakfsj [package]
Reading package lists... Done
E: The value 'kldjflakfsj' is invalid for APT::Default-Release as such 
a release is not available in the sources

This leads me to assume that apt just isn't seeing oldhd as a repository at all. I think my problem might be along the lines of my neglecting to perform some step to name the repository, but I'm not sure.

Any ideas?

1 Answers1

0

Apt sees this as a repository just fine. I believe the problem lies in your repository not containing a Release file (an example: the Release file for trusty-security). Without it, you cannot target that repository using a release specification. You could pin your repository using origin information to give it higher priority (see this answer on U&L).

muru
  • 197,895
  • 55
  • 485
  • 740