Jed’s fridge door notes (a.k.a. “so i won’t forget”)

classic jazz, unix one-liners, anti-theism, crypto

Archive for September 12th, 2006

HOWTO update/install/upgrade a debian box with NO internet…

with 9 comments

I specifically emphasize NO, because as I was googling for a good howto on this topic lots of them said “no internet connection” but they tell you to ‘apt-get update’ first which is dumb because you need an internet connection for that. Same thing with using apt-zip.

So here it is:

*** In a computer with a fast internet connection (sadly this can be a Window$ XP box) ***

1. Find/locate your mirrors

Use http://www.debian.org/mirror/list to find a nearby mirror. Let’s use

http://debian.csie.ntu.edu.tw/debian/

2. Copy the “Packages.gz” files from your mirror

Browse through your mirror and go to the dists/ folder. Under that you’ll see different stages of development of Debian. But for now we are only interested in getting you to install more apps on your Debian box and getting it updated in the process — nothing more. I’ll discuss the other ways you can fsck up your box by using the other branches of development like sid and testing in a future post.

Right now, you are interested in the “stable” branch. Go into the “stable/” directory and…

- copy the “Release” and “Release.gpg” files

It would be prudent to take note of where you got your “Package.gz” file and take note of it:

- go into “contrib/binary-i386/” and get “Packages.gz”

- go into “main/binary-i386/” and get “Packages.gz”

- go into “non-free/binary-i386/” and get “Packages.gz”

3. Don’t forget the security updates!

Even if the chances of your non-connected box being hacked is less than the chance that your cat will greet you when you come home, you should still update the security patches for specific apps.

Go to the security updates site at http://security.debian.org/dists/stable/updates/ and you’ll see the same contrib, main, non-free directories.

- copy the Release and Release.gpg files

- go into contrib, main, non-free directories and copy the Package.gz files in them

*** Back at home with the paperweight unconnected Debian box ***

1. Edit your /etc/apt/sources.list to include the mirror you want

deb http://debian.csie.ntu.edu.tw/debian/ main contrib non-free

# dont forget to add your security repository too. we’ll use a standard one

deb http://security.debian.org/ stable/updates main
2. gunzip and rename your corresponding Packages.gz and Release files

For the Package.gz file you got from the contrib directory, gunzip it and rename it with your mirror’s url like this:

debian.csie.ntu.edu.tw_debian_dists_stable_contrib_binary-i386_Packages

do the same for the other Packages.gz files

debian.csie.ntu.edu.tw_debian_dists_stable_main_binary-i386_Packages

debian.csie.ntu.edu.tw_debian_dists_stable_non-free_binary-i386_Packages

we don’t want to forget the security updates:

security.debian.org_dists_stable_updates_contrib_binary-i386_Packages

security.debian.org_dists_stable_updates_main_binary-i386_Packages

security.debian.org_dists_stable_updates_non-free_binary-i386_Packages

Do the same for the Release and Release.gpg files for both the packages and the security updates:

debian.csie.ntu.edu.tw_debian_dists_stable_Release

debian.csie.ntu.edu.tw_debian_dists_stable_Release.gpg

security.debian.org_dists_stable_updates_Release

security.debian.org_dists_stable_updates_Release.gpg

Now copy all those into your /var/lib/apt/lists/ directory. Of course you should be root to do this.

*** testing your mirrors :) ***

Doing a

$ apt-cache search {app}

should work now, try it for your favorite app that is not in your base install (try fluxbox :)

$ apt-cache search fluxbox

fluxconf – Fluxbox configuration utility

fluxbox – Highly configurable and low resource X11 Window manager

etc….

*** INSTALLING APPS ***

As root do this for all the apps you want (after searching for it using ‘apt-cache search’):

# apt-get -qq –print-uris install fluxbox | cut -f 2 -d \’ > getthisappz.txt

Carry that getthisappz.txt file into a computer with fast internet and download the corresponding deb files in it. If you have alot of files in there, you can use my makeurl.pl utility (available at http://jed.sitesled.com/scripts/) and make an html file out of it, then use Firefox’s DownloadThemAll extension to download them in one go.

When you have your *.deb files, just copy them into /var/cache/apt/archives and do ‘apt-get install {pkg}’ simple as that.

Questions? Comments? Corrections? :)

Written by jedrm

September 12, 2006 at 1:07 pm

Posted in Unix One-Liners

Tagged with ,