PDA

View Full Version : help with apt-get "sneakernet"



pau1knopp
01-15-2004, 09:08 PM
I only have a dial up connection at home but have a very fast connection at work. Even doing an apt-get update at home on a new install is very painful over dialup, as it takes about one hour, and this is not even installing software yet.

I want to download (using apt-get) at work on my laptop, then take my laptop home and copy the files I obtained using apt-get to my home PC using the LAN. So far, here is my plan.

After running apt-get update at work, I will copy /etc/apt/sources.list and /var/cache/apt/*.bin from the work machine to the same location on the home machine. At this point, the sources for each should by synchronized, and I am assuming I could do an "apt-get install pine" on the home pc without running "apt-get update" first.

My first question is, does this seem correct so far?

Next I would like to install packages in the same fashion. I want to perform an "apt-get mplayer-i386" at work, and then take the contents of /var/cache/apt/archives to the development pc.

My second question is, what is the best way to install these files after copying them to the home pc? I would imagine that dpkg -i /var/cache/apt/archives/* might work, but it sounds sort of ugly, and I don't know that it would work consistently for my purposes (if at all).

Is there a way to put the files in temp, and let apt-get (or dpkg) know that this is the new location for mplayer-i386?

Thanks in advance,

Paul

Markus
01-15-2004, 09:21 PM
Haven't tried it but couldn't you burn the files and use apt-cdrom to install the packages from there.

Stephen
01-15-2004, 09:53 PM
I only have a dial up connection at home but have a very fast connection at work. Even doing an apt-get update at home on a new install is very painful over dialup, as it takes about one hour, and this is not even installing software yet.

I want to download (using apt-get) at work on my laptop, then take my laptop home and copy the files I obtained using apt-get to my home PC using the LAN. So far, here is my plan.

After running apt-get update at work, I will copy /etc/apt/sources.list and /var/cache/apt/*.bin from the work machine to the same location on the home machine. At this point, the sources for each should by synchronized, and I am assuming I could do an "apt-get install pine" on the home pc without running "apt-get update" first.

My first question is, does this seem correct so far?

Next I would like to install packages in the same fashion. I want to perform an "apt-get mplayer-i386" at work, and then take the contents of /var/cache/apt/archives to the development pc.

My second question is, what is the best way to install these files after copying them to the home pc? I would imagine that dpkg -i /var/cache/apt/archives/* might work, but it sounds sort of ugly, and I don't know that it would work consistently for my purposes (if at all).

Is there a way to put the files in temp, and let apt-get (or dpkg) know that this is the new location for mplayer-i386?

Thanks in advance,

Paul

It looks like you want something like apt-proxy using your laptop as the proxy for the machines on your home LAN. The description of the package:


apt-proxy automatically builds a Debian HTTP mirror based
on requests which pass through the proxy. It's great for
multiple Debian machines on the same network with a slower
internet link.

The archive is automatically kept up to date using http,
ftp or rsync. Cache cleaning of unused and old versions
is configurable. You can also import the contents of
your apt cache into the archive using apt-proxy-import.

For more information, see the apt-proxy homepage at
http://apt-proxy.sourceforge.net

pau1knopp
01-16-2004, 03:22 PM
Okay, here's MY solution...

******
On the server PC run apt-get update, then apt-get streamripper.

mkdir a /Debian/dists/main directory structure

touch /Debian/dists/main/file (only needs to be done once)

cp /var/cache/apt/archives/*.deb /Debian/dists/main/

Then run the following:

dpkg-scanpackages /Debian/dists/main /Debian/dists/main/file | gzip > \
/Debian/dists/main/Packages.gz

(obviously needs to be done for every time you update the package
repository with more packages on the server PC)

Copy the contents of /Debian/* to the client PC (over LAN or via CD), and as root run the following:

echo "deb file:/Debian/dists main/" >> /etc/apt/sources.list (also only
needs to be done once)

You can then run apt-get streamripper and install from your repository to the client PC.
*******

Now does anyone know how to specify the local repository (without trying to go to the offline internet repositories)?

Regards,

Paul

RockMumbles
01-17-2004, 05:00 AM
Now does anyone know how to specify the local repository (without trying to go to the offline internet repositories)?

to have apt-get only look in your local repository edit your /etc/apt/sources.list file and comment out every line except: deb file:/Debian/dists main/

example: /etc/apt/sources.list
#Debian
#deb ftp://ftp.debian.org/debian stable main contrib non-free
#deb-src ftp://ftp.debian.org/debian woody main contrib non-free

#Debian Non-US
#deb http://non-us.debian.org/ stable/non-US main contrib non-free
#deb-src http://non-us.debian.org/ woody/non-US main contrib non-free

#Debian security updates
#deb ftp://security.debian.org/debian-security stable/updates main contrib non-free

# local repository
deb file:/Debian/dists main/

That should do it, note all lines are commented out (#) except your local repository.

HTH

~rock

pau1knopp
02-02-2004, 02:53 PM
Thanks for the input... Here is my current solution, which works quite well, just wanted to finish up the post for future people trawling for the same answer...

KNOPPIX debian repository

Setup your own local deb repository
---------------------------------------------------------------------------
You will need to install dpkg-multicd to get the "dpkg-scanpackages" command.

Lets say you have a bunch of debs downloaded and want to use them instead of
fetching again from the net.You could just put them in
/var/cache/apt/archives/ and apt-get update but what if you want to
have a pool of debs on your live cd to install on demand or your worried about
doing an apt-get clean and loosing them.

Put all your debs in a directory called "debs"
# cd /debs/
# find . -name "*.deb" > overridefile
# dpkg-scanpackages . overridefile > Packages

Now your "debs" directory is ready for use.Just put it in the root of your
chroot jail for example and add the following line to your
/etc/apt/sources.list :
deb file:/debs/ ./

Then apt-get update and there all ready to search,show and install.
---------------------------------------------------------------------------