View Single Post
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#25
@wicket,

Thank you for your idea and script. To improve the downloading time I've adapted the script so that apt-get is only called once, after collecting all package names in one single variable.

I'm now, in one go, downloading 1558 packages

The advantage of this is that apt-get doesn't have to keep reading the index and resolving dependencies and whatever it does.

Here's my version:
Code:
#!/bin/sh

apt-get update
mkdir -p /home/user/MyDocs/debs/archives/partial

PKGS=""

for pkg in $(dpkg -l | grep ^ii | cut -f3 -d' '); do
 apt-cache policy $pkg | grep -q nokia.com || continue
 echo "adding $pkg"
 PKGS="$PKGS $pkg"
done

apt-get --reinstall -y  -d -odir::cache=/home/user/MyDocs/debs \
  install $PKGS
 

The Following 7 Users Say Thank You to reinob For This Useful Post: