jump to navigation

Installing Packages on Computers with Slow Connections Redux July 8, 2006

Posted by Carthik in administration, commands, guides, maintenance, ubuntu.
trackback

Earlier, I had written about using apt-zip to upgrade computers on slow internet connections by using a faster machine to do the downloads. However, since that involves understanding how apt-zip works, and a small learning curve, here is a hack that should work pretty well, in spite of it’s hackish nature.

The tip here will let you install new packages (and their dependencies) or upgrade a system by using a faster internet connection to do the downloading. First we get the URIs for the pacakges to be downloaded, then we download the packages and transport them to the computer with the slower connection. Thanks to Ewan for this tip posted to the ubuntu-users list a long time ago.
The steps:
1) On the computer you wish to install something new on (or upgrade), do a $sudo apt-get update

2) Then use apt-get to generate a list of the packages it needs to download, in order to install the package that you need, but not download them:
$sudo apt-get -qq --print-uris install name-of-package | cut -d\' -f 2 > urilist
this gives you a file ‘urilist’ in the same directory as the one in which you ran the previous command, with a list of files to download.

3) Take your list to a machine with a fast internet connection and download the packages using wget:
$wget -i < urilist

4) Take your newly downloaded debs home and copy them into the
/var/cache/apt/archives/ directory

5) Rerun the same apt-get command, but without any special parameters:
$ sudo apt-get install name-of-package

apt-get should tell you the quantity of packages that it will install,
and how much it will download. The download amount should be zero since
the packages are already downloaded.

Comments»

1. Potter System - July 8, 2006

For step 3, do you mean < ?

Try using &lt*remove*;

2. ubuntonista - July 8, 2006

Thanks dude, that fixed it! I forgot the “lt”, i tried a “laquo” – dumb me!

3. kmmbvnr - July 9, 2006

For same purpose i wrote the small bash script, but not for full upgrade . Script downloads exactly requested packages with dependencies.

see http://kmmbvnr.livejournal.com/9241.html

4. Casanova - July 9, 2006
5. ak - July 9, 2006

Why step 4 and 5, just use dpkg -i package-file.deb

6. pollycoke :) » Usare APT per crearsi CD di pacchetti debian/ubuntu - July 10, 2006

[…] In questo post c’è un breve interessante Howto per creare CD pieni di pacchetti per ubuntu, pronti per essere usati su macchine che non hanno una buona connessione internet… (tipo ADSL) […]

7. tabreziqbal - July 12, 2006

Copying the downloaded files directly in the ‘archive’ folder doesn’t always work.
$ dpkg-scanpackages debs /dev/null | gzip > sharedebs/Packages.gz
Above command might need to be run to generate the Packages.gz for the downloaded packages. A more detailed procedure is here:
Update or Install Applications on Debian/Ubuntu Without an Internet Connection

8. nocti - July 28, 2006

how do i update the pkg repositories list of a non-connected ubuntu box?

so that when i run apt-cache search or apt-get -qq –print-uris install it will not tell me that there’s not suck file in the repository?

thanks.

9. Dustin Mays - August 7, 2006

@nocti

I’m in the same predicament you are. Check out apt-walkabout.
http://quozl.netrek.org/apt-walkabout/. The way I understood it is this tool manages a small filesystem seperate from / with package list and archive on a removable medium (like a thumbdrive or CD-R). On your Linux machine, you tell apt-walkabout to generate a list of files to download to update your apt cache and system, and then you take the medium to a place with better connectivity so you can download the files. Then you bring the medium back home and ‘adopt’ the changes into the root filesystem. My understanding might not be complete and/or even correct, but it seems like the tool will do what we need. I’m going to try it out tonight and see how well it works.

10. Benny Ling - September 29, 2006

say you had downloaded HEAPS of packages. downloading them again (to install on your new computer) would just be a massive waste of time. so, i came up with a workaround.

1. copy packages to a folder directly in your /home diretory, eg. /home/frank/packages

2. open up synaptic, file–> add downloaded packages, navigate to the folder containing your packages.

with any luck, synaptic should then dialog box you, prompting to install packages. Note: it should say 0B needs to be downlaoded, since you already have the packages.

if not, then click apply. that should work.

11. jim - January 11, 2007

Or use apt-medium to handle your offline update/install medium.

http://wiki.debian.org/AptMedium

12. duckblaster - January 22, 2008

how do you download on windows for linux, i have only got internet access on a windows machine that is on a network that has very tight security and will not let exe or other programs be downloaded

13. quarratly - November 2, 2008

how to add your blog to rss reader, I have some troubles…

14. porno sikiş - September 27, 2010

so that when i run apt-cache search or apt-get -qq –print-uris install it will not tell me that there’s not suck file in the repository?

15. sex sikiş - September 28, 2010

how do i update the pkg repositories list of a non-connected ubuntu box?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: