A good sense of “stupid”

slaniel | Uncategorized | Sunday, May 30th, 2004

I’d also like to point out that Linux is just stupid, in the very best possible sense of “stupid.” Everything in Linux is a file, so you can go into the /proc directory, look up the process ID for a running program (using the ps command), change into /proc/[pid], and look at all the information that the operating system knows about that program — the environment variables that it ran with, the amount of memory it takes up, and on and on. The /proc directory isn’t real; there are no actual files on disk containing the stuff in /proc. They’re just “virtual” files spat out by the kernel as an interface into running programs. It’s a brilliant idea, and allows you to write scripts that will dump out all kinds of information about your programs. As much as possible, files are raw text — because raw text is the easiest to play with, search through, modify, pipe, slice and dice.

Then there’s the way configuration files work: they’re all raw text files. There is nothing like the Windows Registry under Linux (though I guess the XML config files under each user’s home directories for the various GUIs are somewhere in the same neighborhood), and it will be a sad day when there is. Whose boneheaded idea was it to put all of the system’s configuration in two files? That’s just not the Linux way. The Linux way is to put a configuration file for programName under /etc/programName, and to put any user-specific configurations under /home/userName/.programFilerc. In that regard, Linux is actually a lot like Windows used to be, back when Windows 3.1 used various .ini files like win.ini. It’s still smarter than that, because win.ini featured blocks for each program — again, centralized configuration rather than a bunch of little config files.

Moving programs from one Linux machine to another is really, really easy, and I got a great example of that last night. Driving from Boston to Vermont for Rachele and Adam’s wedding, Adam and Ken decided to pass the time by setting up an ad hoc network on their Linux laptops between the two cars in our caravan so that Ken could play some MP3s in our car. Having set up the network, Ken needed to install a program to play Ogg Vorbis files. He only had access to Adam’s machine, not to the Debian archive, so he asked Adam to repack his (Adam’s) copy of the Ogg player, then send the repacked file to him (that is, to Ken). That’s one command (dpkg-repack packageName), along with some extra work to repack all the packages that the one you want depends on; Adam has written a script that does precisely this.

I ask you two questions:

  1. I realize it’s a rare situation, but try to conceive of how difficult it would be to install a Windows software package when you don’t have access to the installation CDs, and

  2. Have you ever tried to move a Windows program from one system to another? This used to be fairly easy under DOS, because DOS programs tended to put all their files in one directory. In large part the difficulty in moving programs from one machine to another nowadays comes from the Registry: not only do you have to move the program, plus all of its files from places like c:\winnt, but you also have to move the (potentially thousands of) Registry keys. Last I knew, you had to download or buy a separate program to move the Windows application to a new machine; it’s a severe headache.

    By contrast, a quick series of shell commands will repackage every single program on my machine, which a quick remote-copy operation (we use scp below) will move to the new machine:

    mkdir ~/deb-packages cd ~/deb-packages dpkg-repack $(dpkg --get-selections | grep -v 'deinstall$\|purge$' | cut -f1); scp -r ~/deb-packages remoteHost: 

I’ll grant you that this looks arcane and hard to figure out. But again, think about what it buys you: if you buy a new machine and want it to look just like your old machine, that’s how you do it. That may not be the end of the story — you may have just moved hardware-specific configuration options over to that second machine, even though the second machine may have different hardware than the first — but that’s most of it. (And actually, I don’t think dpkg-repack will have moved over any hardware-specific options.)

Much of this simplicity, I think, comes from the fact that you have absolute control over your software: the Linux community doesn’t want you to be limited to just one copy of the OS. They want you to copy Linux to as many machines as possible, for free! Why make it difficult to do this, when they’re not making any money off each additional copy? Certainly proprietary software companies have a financial incentive to make this sort of copying hard.

In time, I think people will see all the benefits that flow from unencumbered access to data. I hope that this general philosophical fluorishing will lead people to reject “solutions” such as Digital Rights Management that give the consumer nothing but give everything to the publisher. Openness is the wave of the present.

2 Comments

  1. You should also check out apt-move, which would let you take those repacked files and re-create a Debian apt repository, thus allowing people to add your machine to their apt sources if the real archive is unavailable:

    apt-move is used to move a collection of Debian package files into a proper archive hierarchy as is used in the official Debian archive. It is intended as a tool to help manage the apt-get(8) file cache, but could be configured to work with any collection of Debian packages.

    Running apt-move periodically will assist in managing the resulting partial mirror by optionally removing obsolete packages, and creating valid local Packages.gz files. It can also build a partial or complete local mirror of a Debian binary distribution (including an “installed-packages only” mirror).

    I’ve often used this to do installations on new machines when I don’t have access to the Internet or only have a dial-up.

    Comment by Adam Rosi-Kessel — January 1, 1970 @ 8:00 am

  2. My day with OS X and Linux

    Comment by Anonymous — January 1, 1970 @ 8:00 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.