Overview
Background Needed
I have tailored the material here to beginners. No special sophistication in computers is needed. Any Microsoft Windows user who, say, understands the difference between the C: and A: drives should be able to understand the instructions here and install Linux in an hour’s time. (Do not be intimidated by the length of this document; you probably will not have to use most of it.)
What Is Linux?
Linux is a form of the Unix operating system. Though originally Unix was used mainly by engineers and scientists and thus was not very familiar to the general public, a lot of what you take for granted on computer systems today began in Unix. A notable example is the Internet—the first major operating system to implement the TCP/IP protocol at the heart of the Internet was Unix, and that led to the general acceptance of the protocol.
In the early 1990s, computer science student Linus Torvalds decided to write his own version of Unix, which he called Linux. Other "homegrown" versions of Unix had been written, such as MINIX, but what distinguished Linux was the scale of worldwide participation involved. Torvalds innocently put a message on the Internet asking if anyone wanted to help, and he got a torrent of responses.
There are a several reasons why Linux is mainstream today. First, it became known as a very reliable, stable operating system, with one result being that Linux has become a major platform for large corporate Web servers. Another reason is that it, and the software associated with it developed elsewhere, is free. Many companies have found that it is cheaper to run Linux on their PCs, both for this reason and because of reduced maintenance costs.
There are several good reasons for you to use Linux:
• As mentioned, Linux is becoming one of the "hottest" software systems. Virtually all of the major companies—IBM, HP, Sun Microsystems, etc.—are promoting it, and Linux is a leading corporate choice for Web servers. Linux is the main operating system used at .
• Linux is also starting to make inroads in large desktop markets, such as businesses, schools and so on, due to its high reliability, lower rate of infection by viruses and the like, and its low cost.
• The Linux community shares. That means that people online are much more willing to help you (see Section 7.2), and more open source software is available. if you are a university computer science student, there are some very important additional advantages:
• Many CS courses make specific use of Unix, and thus their work cannot be done on Windows platforms. Since it is a full Unix system, Linux allows students to do their homework in the comfort of their own homes. If you are new to Unix, click here for my Unix tutorial Web page at
Unix file and directory commands, and so on.
• In installing and using Linux, students learn many practical things about computers which they do not learn in coursework. This practical experience can also help you in job interviews, both for permanent jobs after graduation and for summer jobs and co-ops during your college years. Even if the job you interview for does not involve Unix, you will definitely impress the interviewer if, for example, you discuss various things you have done to use and customize your Linux system.
Obtaining Linux
The Concept of Linux Distributions
There are many different Linux distributions, meaning packagings, "distros" in Linux geek language. The distribution consists of the operating system kernel itself, an installation program, and various applications. Though Linux itself is free, some distributions are commercial products, such as Red Hat, Mandriva and SUSE.1 However, some of these companies, such as SUSE, make available full or partial versions for free on the Web. Others are completely free, such as Fedora Core (a project of Red Hat), Ubuntu, Debian and Slackware.
A major advantage of Mandrake, SUSE and Ubuntu, among others, is that they automatically do the disk partitioning2 for you.
Free Linux distributions may be downloaded from the Web (see Section 2.3), or may be obtained as DVDs in Linux books which you can purchase at your local bookstore. The latter is a very common method. For example, a number of books can be found in almost any bookstore on Fedora Linux.3 By purchasing such a book, one obtains both the software and a large reference book. By the way, if you want the disk partitioning to be done automatically, there are books available for Mandrake, SUSE and Ubuntu.
I tend to use Fedora, but I have also used Red Hat, Mandrake and (long ago) Slackware and was pleased with them. SUSE, Debian and increasingly Ubuntu have some very enthusiastic followers too.4 All the major ones are good.
Live-CD Linux Distributions
A more recent concept in Linux distributions is that of live CD distribution. Here the entire Linux package is on a bootable CD-ROM. The user boots the computer with the CD in the drive, and then Linux boots up.
The advantage of this approach is that one does not involve the disk partitioning, a sometimes difficult process. One is using Linux without actually installing it, and in particular without changing the disk partitioning.
A disadvantage is that it does not allow one’s application programs to save files to the hard drive, unless one has already split the Windows partition, defeating much of the purpose. One can save files to a USB key (in the directory /mnt/usbstorage or something like that; look in /mnt, /media etc.).
That makes the approach ideal for those who wish to just try Linux for a short period of time, but not so 1SUSE, pronounced "Soos-ee" by Linux geeks, formerly was written as SuSE.
Discussed in Section
As of this writing in July 2006, the newest is Fedora Core 5.
I am tempted to use the word "cult-like" in describing Debian’s adherents. :-)
useful for long-term use, The first well-known live-CD distribution was Knoppix, but there are many others today, such as the Slax variant of Slackware. Again, these are downloadable from the Web.
If you use the live-CD approach, you may of course skip Section 3 of this tutorial.
Downloading from the Web
The free distributions, and even some of the commercial ones, are freely downloadable from the Web.
Since URLs change frequently, I’ve chosen not to put many hard links here. One I will give is http://www.linuxiso.org/, a central repository of most standard distributions. Or simply use Google, e.g. plugging in search terms such as "Fedora Linux download," "Mandrake Linux download," "Slackware Live CD" and so on.
Note that this is a lengthy process. I strongly recommend obtaining a DVD from some other source.
Important notes: If you download Linux from theWeb and burn it to CDs or DVDs, make sure that you burn the ISO images, as opposed to copying the ISO file as you would in, say, a backup operation. Your burner software should have a choice in its menu for this. Also, later when you install, if your Linux distribution asks you if you want to do a validity check of your CDs or DVDs before installing, say yes!
Installing Linux
Assumptions
Generality/Specificity of Coverage
This part of the tutorial will not go into the details for installing one particular distribution. That would be impractical, since the details for any one distribution often change substantially from one release to the next. So instead, this section on installation will discuss the major points you should watch for during the procedure. It will sometimes use Fedora/Red Hat and Mandrake as examples for concreteness, but the principles should be similar for most other distributions.
Your Machine
It is assumed that you have an Intel-compatible desktop or notebook, with a bootable CD-ROM or DVD drive. You should have at least 128M of RAM. I recommend that you have at least 10G of disk space available for Linux, though 5G would probably be enough.
The latter condition should hold for almost any machine bought in the last five or six years. One other point, though, is that the boot priority should be set so that the machine tries to boot from CD-ROM or DVD before trying to boot from the hard drive.
Your machine probably already does this, but if not, you can reset the BIOS to do so. Consult your manual on this, or ask at any computer store.
Determine Your Hardware Details
The Linux installation program will be able to sense most of your hardware information. So, you can probably skip this section. But if you want to take about five minutes extra time here, it could be helpful later if you write down some of your hardware types before beginning installation. To check your hardware from Windows, go to My Computer, then System. Click General to get the amount of RAM and CPU type. Then go to Device Manager, and click on the ‘+’ next to each component, e.g. "Disk drives," "Display adapters" and so on. Write down the information, including your hard drive type, such as IDE; your video card make and model; your monitor make and model; the type of connection used for your mouse, such as PS/2; the make and model of your printer; etc.
Do you still have the manual which came with your monitor? If so, check the specs in the back, and write down the horizontal sync and vertical refresh rate, and the make and model.
Partioning Your Hard Drive
As mentioned earlier, some Linux distros, such as Mandrake, SUSE and Ubuntu, automatically do the disk partitioning for you. This is a major advantage, as partitioning is a vital but delicate operation. Later in this section, I’ll give you some options to use if you have a distro that does not do automatic partitioning. But I do suggest that even if you will have automatic partitioning done, it would still be worthwhile for you to read Section.
What Is Partitioning?
Any hard drive will consist of one or more partitions. Each operating system you run on your computer occupies one or more partitions on that hard drive. So, you will need at least one partition for Windows and one (actually two) for Linux.
In Linux terminology, your entire first hard drive is called /dev/hda,6 and partitions within it are called /dev/hda1, /dev/hda2 and so on. Your original Windows single partition was /dev/hda. The notation for your second hard drive, if you have one, will be /dev/hdb, with partitions within it named /dev/hdb1, /dev/hdb2 etc. Your first SCSI disk, if any, is /dev/sda, etc.
Before You Do the Partitioning
You really ought to run Windows’ chkdsk command first, in case you have any bad sectors on your hard drive.
Options for Partitioning
The problem is that almost all PCs sold today have been set up with only one partition, so that Windows occupies the entire hard drive. Of course, the vast majority of that space is initially empty, so there is plenty Actually, /dev is the name of a directory, and hda etc. are considered "files" in that directory. In Unix systems, all I/O devices are treated as files.
This is typical, but not universal. of room for Linux, as long as you shrink the original single partition, which is what you will have to do.
This is one of the two big issues with Linux installation. What options do you have?
• As mentioned earlier, one option would be to choose a distribution which does the shrinking for you automatically, such as Mandrake, SUSE or Ubuntu. Note that that does not force you to actually use that distribution; you can install it just to get the partitioning, and then replace it with, say, Fedora, if you wish, now that the shrinking is done.
• Another option would be to use the free ntfsresize program, getting access to it by temporarily running some live CD. For example, you can do this with Knoppix.
This is a fairly simple process, taking only two or three steps, but be absolutely sure to follow the instructions to the letter, to avoid causing data loss problems in your Windows partition.8 A summary of the steps is as follows
After booting the live CD, open a terminal shell window in which you are logged in as root and type something like ntfsresize -s 16G /dev/hda1 which says to shrink your Windows partition10 to 16 gigabytes in size.11 Make sure you write down the new size.
Then you must run Linux’s fdisk (or cfdisk) to complete the actual partition change. Type
fdisk /dev/hda
Then delete theWindows partition /dev/hda1 using the d command, and use the n command to create a new partition (i) of the same size or greater, (ii) of type NTFS and (iii) bootable. (Make SURE you address all three of these aspects carefully.) Since you deleted /dev/hda1, thus leaving you with no partitions at all, the new one will again be /dev/hda1, thus leaving Windows undisturbed. Use the w command to save the new partition structure and exit.
Then reboot into Windows, to make sure everything is OK. A disk check will be done automatically.
• A better alternative than direct use of ntfsresize as described above is to run QtParted, available with Knoppix and some other live CDs. It will run ntfsresize and fdisk (or a substitute) by itself, alleviating you of the need to get into the details.
• Get a commercial program to do the splitting, such as PartitionMagic, PartitionIt or BootIt. The latter offers a free trial period, which may be all you need.
Before you start, give some thought as to how much of the original partition you want to keep for Windows and how much you want to leave for Linux. If you plan to become a serious Linux user, you’ll want to allocate at least half of the space for Linux.
Note that the next option below, using QtParted, automates the process for you. You may prefer it over direct use of ntfsresize This is adapted from http://www.copyleft.co.nz/install-prnt.html, though I have not included creation of an extra Windows FAT32 partition, which is not related to the issue of shrinking.
More accurately, shrink the file system.
If ntfsresize says it can’t shrink your Windows partition, you may need to go back to Windows and run its defragment facility. And as mentioned in Section 7.1, if you want to learn Linux, the only way to do it is to become a serious user.
The Installation Process
By the way, if you are upgrading or replacing another version or distribution of Linux, before beginning. Put your Linux CD-ROM or DVD in the drive, and reboot. The installation program should begin.
During the installation process, you will at various points be asked to make choices. Often you will probably take the default, but here are some things you might consider:
• Some distributions will give you a choice of several installation types, which vary in terms of what kinds of application software will be installed. For instance, Fedora/Red Hat offers you a choice of Personal Desktop, Workstation, Server and Custom installations. If you are a CS student, you need at least Workstation.
But since most people now have plenty of disk space, it is easier to simply ask for everything. In Fedora/Red Hat, for instance, ask for Custom and then check everything there. Again, if you are a CS student, at least make sure you are enabling software development (compilers, editors, etc.).
Note that you can always add more applications later on, though the process might not be so easy. Also, if you are asked what additional language support you want besides English, and you do want some other languages, NOWis the time to say so. You need this support for special fonts (e.g. Chinese characters), so get it now. Again, it may not be so easy to do later.
• Using the space liberated by shrinking your original Windows partition, the installation process will create two new partitions, one root and one swap, for your system files and virtual memory disk space, respectively. Again, if you are given the choice of having this done for you automatically, I suggest taking this option, unless you are familiar with the concepts.
• Assuming you’ll want a dual-boot system, i.e. you’ll be having bothWindows and Linux available for booting, you need some sort of boot loader. This is a program which upon powerup of your computer will ask you which OS you wish to boot at that time. Your distribution may use the GRUB boot loader, or maybe LILO or others. It doesn’t matter that much for a beginner, but definitely indicate that you want to be able to boot both OSs. Take the defaults for everything else, e.g. the choice of bootloader program (LILO, GRUB, etc.).
• If you’re asked whether you want 3-button mouse emulation, say yes. It helps in cut-and-paste operations.
• GUI ("graphical user intrface") desktop manager: The two most widely-used GUI desktop managers for Linux are KDE and Gnome. Each has its band of devoted followers. It really doesn’t matter which one you choose for new users, and you can always switch later if desired. Choose one (or both).
• You may be asked whether you wish to X11 windows GUI to come up automatically at bootup. You’ll probably want to answer yes. If not, you must change the BIOS settings to make the CD-ROMbootable (and the first device checked during the boot process); see your computer’s manual on how to do this. By the way, don’t be worried if the installation assigns noncontiguous names for the partitions. If your Windows partition is /dev/hda1, your Linux partitions could be, say, /dev/hda5 and /dev/hda7 If you do not choose this, most distributions set things up so that you can start the GUI from the text command line via the startx command.
• I mentioned earlier that disk partitioning has over the years been one of the two major issues in Linux installation. The other has been configuring for the video card and monitor.
With today’s modern Linux installation programs, this is typically not a problem. They are pretty good at identifying your video card, and guessing good settings to use. Typically they will give you a chance to test those settings out before continuing with the installation process, with a test image. My experience has generally been that that is sufficient.
If that image does not turn out well, the installation program will typically give you a chance to state the make and model of your video card, and horizontal sync, vertical refresh rate, and make and model of your monitor. That is why I asked earlier if you still have the manual for your monitor. (On a laptop, though, you often don’t have this information, since its monitor is built in.)
By the way, once a configuration has been decided on, it will be saved to a file. This is typically /etc/X11/XF86Config You can look at this if you are curious as to what configuration the installer has chosen for you.
• If you have an Ethernet card, configuration will probably be automatic. You may be asked if your machine has a static Internet address. In most cases, the answer will be no; you probably get a dynamic Internet addres, using a protocol named DHCP. You may asked what your domain name is; if you don’t know, then you probably don’t have one, and in your setting you can just make one up.
Post-Installation Configuration
This section describes some further steps I recommend taking after your installation is finished, of two kinds:
• There are some "extras" which would be nice to configure into your system after installing it.
• Your installation program may run into some problems and decide to skip part of the installation. An example of the latter situation might be that your installation program finds that it does not have a driver for your wireless card, and thus does not enable wireless. Without wireless, you could still work but not as well, and for those of you whose goal is to become adept at Linux, having a "full" Linux machine is a must. Indeed, going through the process of filling in the gaps will be your best Linux learning experiences of all.
Help in Hardware Configuration
Having trouble getting some hardware component to work under Linux? I’ll have some tips on that below, but keep in mind that a great source is the Web. Plug something like "Linux install HP ZE4901" (if that’s the machine you own) into Google, and you’ll find a number of reports of experiences by other people with
your machine.
Configuring Your Search Path ("Why can’t I run my a.out?")
Most Linux distributions do not include your current directory, ‘.’, in the PATH variable. Thus if for example
you compile a program and then type
a.out
the shell may tell you that a.out is not found. You can get around this by explicitly specifying the current
directory,
./a.out
but this is inconvenient.
To remedy this problem more directly in the case of the BASH shell (the default shell for most distributions),
edit the file /.bash profile In the line which sets PATH, append ":." (a colon and a dot) at the end of the
line, with no intervening spaces. Then log out and log in again, or do
source ˜/.bash_profile
Configuring a Printer
Your Linux distribution should have some program to help you configure your printer if something went
wrong during installation. For example, Fedora/Red Hat has the printtool program.
In an "emergency," you can print Postscript files without the usual process machinery (e.g. lpd print daemon).
Say the file name is x.ps and you have an HP Laserjet 4 printer. Then type
gs -dNOPAUSE -sDEVICE=ljet4 -sOutputFile = - x.ps > /dev/lp0
Specifying ‘-’ as the output file means stdout.
Wireless Networking
Device Compatibility
Some wireless network cards commonly sold with PCs today do not have direct Linux drivers available.
However, there is a very clever workaround, ndiswrapper. It takes the Windows driver for the card, and
converts the Windows-dependent aspects16
Here is how I got my wireless card working under Fedora 3 and 4:
• You’ll need to have the kernel sources installed. The ndiswrapper file INSTALL suggests running
ls /lib/modules/‘uname -r‘/build
to check whether the proper files are there.17
If you don’t have the files, you’ll need to either get them from the CDs or DVD that you installed
Linux from, or download them. Either way, put them in the proper subdirectory of /usr/src and then
make a link, as described in the Wiki cited below.
16Note that Intel machine language is Intel machine language, whether underWindows or Linux. So, most of theWindows driver
applies directly to Linux.
17Note the reverse apostrophes, which run the command uname -r, which returns the version of the kernel.
• I downloaded the source of ndiswrapper from the home page, http://ndiswrapper.sourceforge.
net/. I then followed the instructions on installation at that page (click on Wiki | Installation).
• I installed it, following the simple instructions.
• I determined which wireless card I had (Broadcom), both by running dmesg and lspci under Linux, and by exploring under Windows.
• I obtained the driver files for my Broadcom wireless card. Windows said that it was using bcmwl5.sys for this card. I downloaded bcmwl5.sys and bcmwl5.inf from the ndiswrapper home page. I also
got bcmwl5.sys from my Windows partition, in my case at
c:\windows\system32\drivers\bcmwl5.sys
(that’s an "ell," not a "one," before the 5) and found that it was different from the one I had downloaded.
It later turned out that the downloaded one was wrong, though bcmwl5.inf was all right.
• I put the various .sys and .inf files into the same directory, as requested.
• I installed the driver, by typing
ndiswrapper -i bcmwl5.inf in that directory.
This created the directory /etc/ndiswrapper/bcmwl5, with the .inf, .sys and other files there.18
• As a check that the driver was installed, I typed
ndiswrapper -l That got everything installed. Now, each time I boot up,19, I will type modprobe ndiswrapper dhpclient The first command automatically sets up a wlan0, and the wireless card starts working, e.g. scanning for wireless access points. The second command starts up the DHCP client, so that my machine will accept an IP address assigned by a wireless access point.
Useful commands are iwconfig, ifconfig, iwlist (with the scanning option) and dmesg. For example, to select a particular wireless access point named X, type
iwconfig wlan0 "X"
(Do this BEFORE running dhclient.)
If I ever want to delete it, I will type
ndiswrapper -e bcmwl5
I can automate this if I wish.
Other Considerations
I found in one wireless site that there seemed to be a problem with DNS, the system that translates "English" addresses like wwww.google.com to their numerical counterparts, e.g. 66.102.7.104. If you find that the former fails but the latter works, you probably have a DNS problem.
One way to handle this would be to configure your machine to have a secondary DNS site. You can use one given to you by your ISP, for instance. To add it, use the network configuration tool in your Linux distro.
For example, under Fedora and GNOME, select Applications | System Tools | Redhat Network.
Configuring KDE/GNOME for Convenient Window Operations
You should find that windowing operations are generally easier in Unix systems than in Windows, in the sense of requiring fewer mouse clicks, if you set things up that way. Personally, I find it annoying in Windows that, when I switch from one window to another, I need to click on that second window. In most Unix windowing systems, all I have to do is simply move the mouse to the second window, without clicking on it. The term for this is focus follows mouse, and we can configure most Unix windowing systems to do this.
Also when I move from one window to another, I want the second one to "come out of hiding" and be fully exposed on the screen. This is called autoraise, and can be configured too.
You can arrange this configuration in less than one minute’s time. Again, the exact configuration steps will vary from GNOME to KDE, and from one version to another within those systems, so I can’t give you the general steps here but here is how it works on a Fedora 3/GNOME system: click Applications | Preferences
|Windows, and check SelectWindows When the Mouse Moves Over Them (this may be referred to as focus on your system) and Raise Selected Windows After an Interval (this may be referred as autoraise). I move the slider for the latter all the way to the left, for 0.0 seconds.
Some Points on Linux Usage
Linux Start Icon
Since there are various Linux distros and GUIs, there is no single Linux analog of Windows’ Start icon. It can be the red hat under Red Hat or Fedora, the "K wheel" icon in KDE, etc. It doesn’t matter, though. Just become familiar with the one on your system.
Logging Out and Shutting Down
To log out, go to your Linux start icon (see Section 5.1), and choose Log Out from the menu. (Or, in Fedora/Red Hat, click on Desktop.)
You should then be presented with various choices, including Shutdown. If you choose the latter, note that with some Linux distros, at the end of the shutdown sequence you have to manually take action when it says Power Down. To do this, hold the On key on your machine down for four seconds.
More on Shells/Terminal Windows
In Microsoft Windows, most work done by most users is through a Graphical User Interface (GUI), rather than in a command window (Start | Run | cmd). In Linux, a lot of work is done via GUIs but also it is frequently handier to use a command window, called a terminal window. You should always keep two or three terminal windows on your screen for various tasks that might arise.
You can start a terminal window by going to your Linux start icon (see Section 5.1). The menu may have a Terminal entry, or you may have to go to something like System Tools. Another alternative you may have is to right-click in the background of your screen, and choose Terminal or something like that from the resulting menu. By the way, you may be given a choice of several terminal types, say gnome-term, xterm etc., but it doesn’t much matter which one you choose.
When you type commands in a terminal window, the program which reads and acts. The default shell in Linux is bash. It is very good, but if you are used to using, say, tcsh,21 you can use the chsh command in any terminal window to change your login shell.
Cut-and-Paste Window Operations The X11 windowing system used in Unix has its roots in 3-button mice, but you probably have only a button mouse. That’s no problem, because Linux does 3-button emulation for you. The middle button is emulated by simultaneously clicking both left and right buttons.
To do a cut-and-paste operations, hold down the left mouse button and drag it to highlight the text you wish to copy. Then go to the place you wish to copy that text, and simultaneously push both the left and right buttons.
Using Your DVD/CD-ROM and Floppy Drive from Linux
Mount Points
These days most Linux distributions have a designated directory at which file systems form DVD/CDROMs, floppy disks, etc. can be accessed. This will vary from one distribution to another, but typical directory names are /mnt, /media etc., with subdirectory names like /mnt/cdrom, /mnt/cdrom1, /mnt/floppy, /media/cdrecorder.
Check /etc/fstab if you can’t find the mount point. This file controls which file systems are mounted at boot time. Even if you are not familiar with this file, it should give you an idea as to where devices like CD-ROMs are automatically mounted at boot time, by looking for an entry marked auto in the file.
If the device is not automatically mounted, you have to use the Unix mount command to access it. For You may like gnome-term because it is more easily configurable, as to colors, size, etc.
Or if you want to use my shell tutorials, mentioned above.
example, say your CD-ROM drive subdirectory is /mnt/cdrom. Put the CD-ROM in the tray, and then type in a terminal window mount /mnt/cdrom
A file system will then be created with root /mnt/cdrom, containing the CD-ROM’s files.22
When you are done using the DVD/CD-ROM, you need to unmount it. Leave the /mnt/cdrom subdirectory and type either eject (which will also open the tray) or umount /cdrom before attempting to remove the CD-ROM. If you have any trouble (you shouldn’t, but just "if"), then reboot the machine.
You can check what is currently mounted by running the df command from a shell window (another good Linux learning experience).
CD Burning
There are various free fancy Linux programs for this, but I prefer to use the plain cdrecord command, included with most Linux distributions.
To burn a data CD, you’ll need it to be in ISO form. In some cases, e.g. where you download material from the Web which you want to burn into a CD, you may already have an ISO file, i.e. with .iso suffix in its name.
If not, then first put all your data in some directory, say x. Then make an ISO file from it, say named y.iso:
mkisofs -r -o y.iso x
Put a blank CD in the tray. (Do NOT mount it, as it has no file system to mount.) Then log in as root. Your CD device number might not be 0,0 (or 0,0,0; the first 0 may be omitted in certain cases). Type cdrecord -scanbus to find out.
Now burn the file:
Basically, you have added a new file system to whatever you have on disk, except that these files are on the CD, not on disk.
As a learning experiment, try running the df command before and after the mount, and compare.
By the way I’m assuming here that it is a data CD, not audio. For audio CDs, you don’t mount, since there are no files, thus no file system to set up. Instead, use other programs, e.g. gnome-cd. You can then access the files in the same way you do disk files.
DVDs, though, do have files, and thus must be mounted.
cdrecord -eject -v -isosize speed=2 dev=0,0 y.iso
A speed of 2 is very conservative, maximizing the chance that the burn has no errors. If you wish, try omitting the speed field in your command, and cdrecord may choose a higher speed.
A similar dvdrecord command exists for burning DVDs.
If an Emergency Arises
The Linux OS itself is highly stable, but an application program might contain a bug that makes the program freeze up. What can you do?
First of course there is Ctrl-C, typed into the window from which you invoked the program. Assuming you didn’t run the program as a background job (i.e. used an ampersand at the end of the line in which you invokved it), this is likely to work. The authors of some programs, though, have this feature assigned to some other functionality than program termination.
Next, you can try killing the process via the kill command. First look up the process number, by typing ps ax
Say for instance it is 2288. Then type
kill -9 2288
A more direct way is to use pkill, say as
pkill -9 x
where x is the name of the program being run. (Warning: This will result in all processes of that name being killed.)
What if your program has taken over the entire screen, so you can’t get to a window to kill the program? One solution would be to hit Alt F2, which will bring up a little window in which you can run a command, say pkill as above. Another solution would be to switch to another workspace, i.e. an entirely different (virtual) screen. You have four of them if you are running KDE or GNOME. In the former case, hit Ctrl-Alt-Right Arrow and in the latter case, Ctrl-F2. Set up a terminal window if you don’t already have one in that workspace, run pkill or whatever, and then Ctrl-Alt-Left Arrow or Ctrl-F1, respectively, to return to your original workspace.
A more drastic solution would be to close down KDE or GNOME entirely, by typing Ctrl-Alt-Backspace.
After that the login prompt will come up, and you can re-login. However, all your windows and applications that had been running will now be gone.
Try NOT to simply poweroff the machine, as that may do damage to your files.
Linux Applications Software
GUI Vs. Text-Based
Sophisticated Linux users tend to use text-based applications, rather than GUI ones, even though excellent
GUI applications are available. For instance, I and many others like the mutt e-mail utility
which is text-based. Here’s why, at least in my view:
• I often access my Linux machine remotely, while traveling.23 I might be at a university library, for instance, or at the business center in a hotel, and be "stuck" with a Windows machine, and logging in to my Linux machine via an SSH connection.24 This limits me to text.
• It’s very important to me that I use the same text editor for all my computer applications—e-mail, programming, word processing, etc.—so that I can take advantage of all the abbreviations, shortcuts and so on which I have built up over the years. This saves me huge amounts of typing. But most GUI applications, e.g. e-mail utilities, have their own built-in text editors, so I can’t use mine.
• I find that text-based applications often have more features, are better documented, etc.
However, in listing my favorite applications in Section 6.2 below, I’ve made sure to list both text-based and
GUI programs.
My Favorite Unix/Linux Utilities and Applications
Text Editing
I use a modern extension to the vi editor, vim. This is the version of vi which is built in to most Linux
Note: In the Fedora distro, somehow the version of vim that is linked to vi isn’t configured fully correctly. I suggest using /usr/bin/vim directly.
Even though vim is text-based, it does have a GUI version too, gvim. This comes with nice icons, allows you to do mouse operations, etc. Unfortunately, most Linux distros seem to have only the text-based program.
To get the GUI, you can download it yourself. See my tutorial on how to do this.
Web Browsing
Your Linux distro will come with a Web browser, either Konqueror or Epiphany, and possibly Firefox. If you don’t have the latter, download it from theWeb, www.mozilla.org/products/firefox/. And by the way, it’s available for Windows too.
I almost always use Firefox. But believe it or not, sometimes I use the famous text-based browser, lynx. In some caes, it is just plain quicker and easier.
Your Firefox system may not be configured for Java. If so, see www.mozilla.org/support/firefox/
E-Mail
I use the mutt e-mail utility. It is very flexible and customizable, and excellent features. For example, it has great search capabilities, important if you are a heavy e-mail user. I like its ability to record the fact that one has already replied to a message, and the fact that it allows you to save partially-written message for a later time when you can finish writing it. It is text-based, not GUI, but the functionality it gives is what really counts. If you prefer a GUI-based mail utility, many nice ones exist for Linux. Check the Web for these, or use the Thunderbird e-mail utility in the Firefox Web browser suite.
HTML Editing
I usually use Vim, along with some macros I’ve written for HTML editing, but I sometimes use Amaya, which is a full-featured WYSIWYG HTML editor, written by the Web policy consortium. One nice feature is that you can actually use the embedded Web links, good for testing them.
very nice things about a newer and more powerful package, Quanta+ (http://quanta.kdewebdev.org).
Integrated Software Development (IDE) For C/C++ work, I actually don’t use an IDE. I find that the vim editor (cited above) and the ddd GUI interface to the gdb debugging tool, work great together. For example in vim I can type :make (which I have aliased to just M, or with gvim click on the hammer icon, and the source code I’m debugging will b recompiled. And as I’ve mentioned, it’s important to me that I use the same text editor for all applications, It can be used with C, C++, Java, Perl, Python and many others.
Also, for KDE users, there is a very well-received IDE named KDevelop. I lean toward Eclipse, though, as it is easier to learn, is cross-platform, and can be used with more programming languages.
Word Processing
I use LATEX because of its flexibility, its beautiful output, and its outstanding ability to do math. You may like Lyx, which is a great WYSIWYG interface to LATEX which is especially good for math work.
If you wish to work with files compatible with the Microsoft Office environment, there is a free suite of programs, OpenOffice, which provide Microsoft compatibility. It is packaged with most Linux distributions. Playing Movies, DVDs, Etc.
MPlayer is free and very good. You do have to compile it yourself, but its capabilities are quite broad.
The documentation is extensive, and hard to navigate, but here are a couple of things to get you started:
To play a movie you have the file for, say x.avi, type
mplayer x.avi
To play a DVD, put the disk in the tray and mount the device (see Section 5.5). Then type mplayer dvd://1 -dvd-device /mnt/cdrom
There are many, MANY different options.
You may wish to try other players, e.g. Xine or Ogle.
Image Manipulation and Drawing
Want something like Adobe Photoshop? The GIMP program is quite powerful, and free. It’s included with most Linux distributions.
You can use GIMP to draw, but for "quick and dirty" tasks, I would suggest Dia, at http://www.gnome.org/projects/dia/.
Accessing Usenet Newsgroups
Linux distros generally come a text-based newsreader, either slrn or tin. I generally use slrn, but am not that happy with any known newsreader.
In the GUI arena, I sometimes use pan. You can download it from pan.rebelbase.com.
Firefox’s Thunderbird program includes a newsreader too.
I usually use the text-based ftp and sftp, the latter being an SSH version for security.
A very nice GUI program, though, is gftp, which you can download from the Web if your Linux system doesn’t already have it. In addition to the GUI, this program also has some functionality which ordinary
FTP programs don’t have.
Statistical Analysis
Use the statistical package that the professional statisticians use—R!
In my opinion from the point of view of someone with a "foot in both camps"—I’m a computer science professor who used to be a statistics professor—the R statistical package is the best one around, whether open source or commercial. It is statistically modern and correct, and it also is a general-purpose programming language.
Using RPMs
You can add more programs from your Linux CD-ROM or from theWeb (most of them are free). They tend to be in RPM packages, with .rpm suffixes in their names. To install such a package, type
rpm -i package_file_name
If you later wish to remove, i.e. uninstall a package, you can use rpm -e (‘e’ stands for "erase"). You do NOT have to have the RPM file present to do this.
Some packages will have different versions for different C libraries. Red Hat uses glibc. Type ls -l /lib/libc* to see which version you have.
You may find that you need some library files for a program you download, and that you are missing those files. You can usually get these from the Web too. If a program complains about a missing file, try the ldd command (e.g. ldd x if the name of the program which needs the library is x); this will tell you which libraries are needed, where they were found on your system, and which ones, if any, were not found.
Learning More About Linux
Wanna Get Good at Linux? Use It for Everything!
The only way to really learn Linux is to use it on a daily basis for all your computer work—e-mail, word processing, Web work, etc.
As you do this, the expertise you’ll want to pick up includes: file, directory and mount operations; process operations; roles of system directories (/usr, /etc, /dev and their various subdirectories, e.g. /usr/lib; search paths; network operation and utilities such as netstat; and so on. Don’t try to do this all at once.
Instead, take your time, and learn these naturally, as the need arises. As you use Linux more and more in your daily computer application work (e-mail, word processing, etc.), the needs will arise as you go along.
In some respects, it’s even better than S, the commercial product it is based on.
And remember, there’s lots of help available if you need it.
Getting Help
Newsgroups
There are various Usenet newsgroups devoted to Linux, a few of which are:
comp.os.linux.setup
comp.os.linux.hardware
comp.os.linux.answers
comp.os.linux.announce (excellent for news of new programs, mostly free, that run under Linux)
By the way, if you have a problem with hardware and post a query about it to a newsgroup, it is a good idea to include the output from the dmesg command. It gives a record of what occurred during bootup.
The Web
• Linux home page, at http://www.linux.org/ Lots and lots of information is available here.
• www.linux.com. Chock full of information and links.
• Google’s excellent set of links to various Linux sites, http://directory.google.com/Top/
Computers/Software/Operating Systems/Linux
• Another good set of Linux links, http://www.linuxjunior.org/resources.shtml
• If you are having trouble with specific hardware in your Linux installation, an excellent place to go for detailed information is the Linux HOW-TO documentation. (For the same reason, if you are
about to purchase a machine and suspect that some of the hardware is nonstandard, you can check the corresponding Linux HOW-TO to see if there are any problems with that hardware.
The HOW-TO documents are available at many sites, such as the one at linux.org.
LUGs
There are Linux Users Groups (LUGs) in virtually every city. You can join if you wish, or just get to know them casually. They are great sources of help! And by the way, many of them hold monthly Linux Installfests, where you can see Linux being installed or have it installed on your own machine.
What to Do in an Emergecny
One of Linux’s biggest strengths is its stability. If you are tired of getting Windows’ infamous "blue screen of death," then Linux is the OS for you. (It is also subject to far fewer virus and other attacks thanWindows.)
So emergencies are rare, but they can happen. Here is what to do in such a case:
If an application program freezes up and you invoked it from the command line within a shell, you can in most cases kill it by hitting Ctrl-c in the terminal window from which invoked it. If this doesn’t work, run the "processes" command by typing
ps ax
in another terminal window, and noting the process number of your program. Say for concreteness that that number is 2398. Then type kill -9 2398 to kill the program.
What if your entire screen freezes up? Again, this should be quite rare, but it is possible. I recommend the following remedies, in order:
• Try going to another screen! Linux allows you to switch among multiple screens. You can switch to the second screen via Alt F2 or Ctrl 2, depending on your system. Then open a terminal window in the new screen, find the process number of the program and kill the program, as described above.
• Try hitting Ctrl Alt Backspace (all keys simultaneously). This should cause an exit from Linux’s X11 windowing system but not an exit from Linux itself. You would then get an opportunity to log in again.
• As a last resort, try the famous Ctrl Alt Delete, to cause a reboot.
If You Are Upgrading or Replacing Another Version or Distribution of Linux (If you are installing Linux from scratch, skip this section.) Suppose you already have Linux installed but are upgrading to a newer version of the same distribution or changing to a different distribution. First of course you will want to make sure you back up your old files, just in case sometimes goes wrong.
Note that in addition to any "personal" files you have, you may also have added some downloaded packages, whose files are now in places like /usr/local/. You may also have modified files in /etc, such as
/etc/resolv.conf. You may wish to tar these into a save file too. (Don’t copy the Linux system files, .e.g in /usr/bin, though, since you want them to be replaced by their counterparts in the new version of Linux.)
Accessing Your Windows Files from Linux
Some Linux distributions give you access (at least read access) to your Windows partition from Linux, say as some subdirectory of /mnt. Fedora/Linux does not do this, but you can add free software for this purpose from the Linux-NTFS Project, http://www.linux-ntfs.org/
If You Wish to Remove Linux
If you wish to remove Linux from your machine, first run Linux’s version of fdisk and remove all the Linux partitions. (Be careful not to remove the DOS/Windows partitions!)
Then boot up Windows, and remove LILO/GRUB as follows. First, get a command window by clicking Start | Run | cmd Then type
c:\
cd \windows\command
fdisk /mbr
Subsequently Windows will boot up as it did before you installed Linux.
Finally, use Windows’ diskpart to recover the former Linux space as Windows partitions.