Installing Debian Without a Network
I first encountered Debian Linux back in about 2002 or so. I was on the phone with a tech support guy, trying to get my dialup account (remember those?) working with my Windows '98-based system. The tech support guy was mumbling about how difficult it was to find certain settings in Windows, so I asked him what he used. "Me? Oh, I use Debian Linux. It's much easier."
I now know that when he said "easier" he meant "easier to change network settings on", not necessarily "easier to use". I had heard of Linux before, and being sort of a die-hard Sun Solaris guy — grudgingly converted to Windows at home because you couldn't buy a personal SparcStation — I was intrigued by this "Debian Linux". I found the website, downloaded the CD, and I've been a convert ever since. I went through some growing pains trying to get everything set up, but I'm glad the tech support guy didn't recommend Mandrake or Redhat or Suse or whatever other Linux distros were around back then. To me, Debian is really what a Linux solution ought to be — automated enough that you can get to it and get on with your work, but open enough that you can change anything you might need or want to.
One thing that you know about Debian (and Linux in general) if you've ever used it, though — the "correct" way to install it is to download a bootstrap CD, install a minimal system, and then use Debian's package manager(s) to install everything else you need over the internet. Assuming, that is, that you have internet. Last month I bought myself a new desktop computer with 8GB ram, 2TB hard drive and brand-new everything. It came with Windows 7 (and all the standard crapware that comes with a new computer) preinstalled, so I decided to put Debian on it, of course. I downloaded the minimal CD, repartitioned the drive, and started the install.
Unfortunately, my network card, an Atheros 8161, wasn't recognized by the installer. Ok, maybe all of this newness and cutting-edge-ness isn't such a good thing after all... If you've ever run across this situation while doing a Debian install, you know what a problem this is. One of the first things the Debian installer does is try to connect to ftp.us.debian.org to download enough packages to make a usable system. Oh, boy. The installer chokes completely if it can't get to the internet. I was able to coax it into installing a minimal system — and when I say minimal, I mean minimal. I had the OS kernel, getty and bash. Nothing else.
Fortunately, as a command-line fanatic, I spend quite a bit of my time in the command line, so I wasn't completely out of my element. However, I wanted to be able do more with this system than list directory contents, so I had to get the network card up and running. I did some googling and figured out that the driver I needed was the "alx" driver, whose source code I found and downloaded (from my other computer, of course). Unfortunately, it needed to be "make"d, and I had neither GCC nor Make on my minimal system. I don't even have bzip2!! And, without network, no way to download them... I couldn't even cross-compile from my working system (because it happens to still be stuck on kernel version 2.4... whole other story...)Ok, what do I have? I have dpkg. I can install .deb files. How many could I need to manually download? Well, at a minimum, I figured I'd need gcc and make to begin with — without those, I couldn't even download source packages and build them from scratch. So, to start off with, I'd need the .deb files. I went to packages.debian.org and downloaded the latest GCC. The documentation on packages.debian.org states:
Well, yeah, if you have any network at all, that is...If you are running Debian, it is strongly suggested to use a package manager like aptitude or synaptic to download and install packages, instead of doing so manually via this website. You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this: deb http://ftp.de.debian.org/debian squeeze main
So, the latest version of GCC was 4.4, so I downloaded gcc_4.4.5-1_amd64.deb. It lists as a dependency cpp_4.4.5-1_amd64.deb and gcc-4.4-base_4.4.5-8_amd64.deb and a few libraries I'm not familiar with... but SURELY I must already have those, right? I had to download the .deb packages onto a USB drive and "sneakernet" them over to my new computer. Oh, the humiliation.
dpkg --install cpp.deb cpp depend on cpp-4.4 (>= 4.4.5-1)But that's what I'm trying to install! Nope, apparently there's another one - cpp-4.4_4.4.5-8_amd64.deb. CPP is apparently split up into multiple smaller packages, and the installer has to be aware of the dependencies between them. Sheesh. I guess that's where the disclaimer on the download site came from. CPP core depends on libgmp3c2_4.3.2+dfsg-1_amd64.deb and libmpfr4_3.0.0-2_amd64.deb which I didn't have (and quite a few other dependencies which I fortunately did). GCC itself depended on binutils_2.20.1-16_amd64.deb and libgomp1_4.4.5-8_amd64.deb... five packages later and I have a working GCC and Gmake.
Now that I can compile source code, I ought to be able to compile my
alx network driver.
make: *** /lib/modules/2.6.32-5-amd64/build: No such file or directory. Stop.Crap, I should have seen that coming. I don't have the kernel headers installed (after all, why would I?), and a device driver would obviously need them. Can I install the kernel headers package as a .deb? Sounds dangerous, but I guess the worst that could happen is I'd need to restart from scratch.
Back over to packages.debian.org... Ok, well now this is annoying. linux-header-2.6.32-5-amd64 depends on gcc-4.3, but I installed the latest, gcc-4.4! This, of course, depends on cpp-4.3 and gcc-4.3-base... So, I had to go through the same process to get both GCC 4.4 and GCC 4.3 installed.
Woohoo! Success! Now I can add ftp.us.debian.org to my apt/source.list file and install a real graphical environment - WindowMaker, just like God intended! After doing:
apt-get install x-window-system apt-get install wmakerI have a graphical, networked system. I think you're supposed to do this in a different order, though, because the default windowmaker menu points to a lot of software (firefox, openoffice, gimp) that I don't (yet) have installed. Ah, well - it works, I have internet, I can browse, and my system doesn't seem to be able to tell that it was frankenpatched together after the installation process. I'll probably run into some strange problems along the way, but that's the whole fun of using Linux, isn't it?