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

Re: Download installed .debs??



* Rene Engelhard <rene@debian.org> [030131 07:38]:
> Lars Jensen wrote:
> > How do I re-download copies installed .deb packages that are already on
> > my system? apt-get won't download a package that is already installed.
> 
> apt-get install --reinstall <packagename>
> (It'll use the cached .deb's in /var/cache/apt/archives when it finds
> it, though)

The above will re-install the package, which I guess is not what you
want. Also, note that it will down load the _latest_ version. If you
are happy with getting the latest version of each package, try
something like the following:

apt-get install --reinstall --download-only `dpkg --get-selections \
| grep '\<install\>' | cut -f1`

(untested, beware of typos)

You may run into problems with the above, since ou may have packages
installed that no longer have available versions. In this case:

dpkg --get-selections | grep '\<install\> | cut -f1 | sort > pkg.txt

then

apt-get install --reinstall --download-only `cat pkg.txt`

then if apt-get complains about some package being "unistallable",
edit pkg.txt and delete the line with the offending package.

Cheers,

Nick.

-- 
 Nick Hastings                _   \_\  Phone: +81 298 64 5200, ext 2429
 Belle Group,  KEK,         /_/	((((_)O:          Fax:  +81 298 64 5340
 1-1 Oho, Tsukuba-shi,   :O(_)))) /_/             hastings@bmail.kek.jp
 Ibaraki-ken 305-0801, Japan\_\  http://epp.ph.unimelb.edu.au/~hastings



Reply to: