Re: apt/preferences origin pins for file:// sources
On Sun, 11 Jul 2004 10:33:51 +0530, Raj Kiran Grandhi
<rajkirangrandhi@gmail.com> wrote:
> Hi,
>
> A couple of weeks ago, I switched over to Debian from RedHat. So far
> things are fine, but I am facing a problem with apt-get. I have
> downloaded the first few iso images of sarge and have them lying on my
> hard-disk.
>
> I have the following lines in my '/etc/apt/sources.list'
> ===
> deb file:/mnt/sarge/1 sarge main
> deb file:/mnt/sarge/2 sarge main
> deb file:/mnt/sarge/3 sarge main
> deb file:/mnt/sarge/4 sarge main
> deb file:/mnt/sarge/5 sarge main
> deb http://ftp.us.debian.org/debian stable main contrib non-free
> deb http://ftp.us.debian.org/debian testing main contrib non-free
> deb-src http://ftp.us.debian.org/debian stable main contrib non-free
> deb-src http://ftp.us.debian.org/debian testing main contrib non-free
> ===
>
> I have put the following lines in the '/etc/apt/preferences' file to
> give higher priority to the local packages. (As per the manpage)
>
> Package: *
> Pin: origin ""
> Pin-Priority: 999
>
> However this does not seem to work. The command 'apt-cache policy' shows
> no difference with the addition/deletion of the above lines to
> /etc/apt/preferences, and apt-get insists on downloading the files from
> the net even for minor changes in the versions.
>
> Is there any way to force apt-get to use the local packages instead of
> downloading them again?
>
> Thanks,
> Rajkiran
>
Well, I finally seem to have worked around this problem.
I set up apache and added symlinks to the package directories.
I added the corresponding urls (http://myhostname/sarge/1-5) to
sources.list and gave a priority of 999 to 'origin myhostname'.
But a new problem is that it downloads those packages from my local
server and puts them in /var/cache! I then added the original file:
urls back into sources.list and did an 'apt-get update'.
Now it does what I want it to do. The only problem remaining is that
scanning the package lists takes a long time for it has to now scan
from three sources instead of just two.
Am I missing out a better solution?
Thanks,
Raj Kiran
Reply to: