[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: downloading with apt-get --download-only install package



* Michael Heldebrant (hmike@portalofevil.com) [011120 12:17]:
> On Tue, 2001-11-20 at 11:56, Michael A. Miller wrote:
> > I'd like to download a selection of packages for machine A that
> > is on a slow connection.  So I made a list of what I want and
> > went to machine B, which has a fast connection, and used "apt-get
> > --download-only install package".  This didn't work for packages
> > that are already installed on machine B because apt-get saw them
> > as already up-to-date.  
> > 
> > Can anyone tell me if there is a way to force apt-get (or any
> > other tool) to download a package regardless of it's status on
> > the machine from which it is being downloaded?  I could do this
> > easily with wget if I knew a way to automatically find the url
> > for a package, based on my sources.list.  Any ideas on that?
> 
> Perhaps you could try this:
> 
> export yourpackages="yadda yadda"
> 
> apt-get install $yourpackages --print-uris -y --reinstall |tail +5|awk
> '{print $1}' >aptfile
> 
> wget -i aptfile
> 
> I've built this on the fly with some debugging, let me know if you have
> problems with it.  I'm having a bit of trouble getting sed to strip off
> the single quotes due my inexperience with regexps on the command line
> and what needs to be escaped from bash etc.  I've totally confused
> myself so I went with the file way, wget seems to understand the single
> quotes.
> 
> sed -e "s/'\$//"|sed -e "s/'//" Strips them both off, but the last
> version of the sed command only strips the first ' off and trying to
> combine them isn't working for me with (|) syntax.  Maybe a regexp or
> sed guru could give me a pointer.

IANAG, but I can give a few pointers. At a shell prompt, you can remove
the single quotes from stdin in this situation in a couple of ways:

| sed -e "s/'\(.*\)'/\1/"

That removes the ticks from the first single-quoted expression in a
line. Simpler still (to just remove any ticks):

| tr -d "'"

for your particular case, though, to just avoid having to use a temp
file, and given that it doesn't complain about getting single quotes
anyway, just tell wget to read from stdin by specifying - as its input
file:

apt-get install $yourpackages --print-uris -y --reinstall | tail +5 |
awk '{print $1} | wget -i -

good times,
Vineet

-- 
Satan laughs when      #  "I disapprove of what you say, but I will
we kill each other.    #   defend to the death your right to say it."
Peace is the only way. #  --Beatrice Hall, The Friends of Voltaire, 1906

Attachment: pgpJdLBmYzXMm.pgp
Description: PGP signature


Reply to: