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.
For step 3, do you mean < ?
Try using
<*remove*;
Thanks dude, that fixed it! I forgot the “lt”, i tried a “laquo” – dumb me!
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
https://wiki.ubuntu.com/OfflineUpdateSpec
http://code.google.com/soc/ubuntu/appinfo.html?csaid=620C62A612446B12
On going work regarding the same as part of google summer of code ’06
Why step 4 and 5, just use dpkg -i package-file.deb
[…] 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) […]
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
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.
@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.
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.
Or use apt-medium to handle your offline update/install medium.
http://wiki.debian.org/AptMedium
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
how to add your blog to rss reader, I have some troubles…
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?
how do i update the pkg repositories list of a non-connected ubuntu box?