Installing Debian Linux 2.2 (Potato)
Click here if you want the Debian 3.0 (Woody) Installation Page Click here if you want the Debian 3.1 (Sarge) Installation Page
Click here if you want the Debian 4.0 (Etch) Installation Page
Click here if you want the Debian 5.0 (Lenny) Installation Page
Click here if you want the Debian 6.0 (Squeeze) Installation Page
Click here if you want the Debian 7.0 (Wheezy) Installation Page
The Potato (2.2) version comes on 3 CDs because it includes not only the operating system but nearly 4,000 packages containing software for applications, utilities, and OS enhancements. Debian CD images are available for download from www.debian.org or you can purchase a Potato CD set from Web vendors for around $15.
Many distros install the "full boat" by default and this isn't necessarily a good thing. If you want to learn Linux, the install routine does too much for you. And it sets up a system that's downright insecure if you want to use it as an Internet server. (They set it up this way because it means fewer tech support contacts for them.) The procedure below does a very basic OS install. This keeps things simple, results in a more secure configuration, and allows you learn more. Another advantage is that it doesn't clutter up memory with unnecessary processes.
The main knock against Debian over the years has been it's installation routine. They're working on making it better but it still has a ways to go before it compares with the install routines of the commercial distros. After trying countless different installtion configurations I have yet to get an install free of dependency failure errors whenever I include the GUI (Gnome) packages. Despite these errors, the GUI still seems to work OK with the installation routine detailed on this page (but who cares - we don't use the GUI that much).
The most important piece of advice I can give you is only install the latest stable release of Debian. The second most important piece of advice I can give you is know your video card chipset before you start the install. You will need to know it to install the appropriate XFree86 video "server".
Do NOT plan to use the system you will create using these guide pages as a "production" (real) server. It will NOT be secure!
There are many steps involved in creating a secure Internet or LAN server and it begins with the installation of the OS. A secure server will have its hard-drives divided up into multiple partitions which is not something we do in this procedure. While we do refer to some things you can do to make your system more secure, there are many other measures related to system configurations, accounts, and services that also need to be taken and they also are not covered on these pages.
These guide pages are meant as a learning tool which will allow you to "get your hands dirty" so you can get accustomed to working with Debian. The knowledge gained on these pages will help you make informed decisions when you do want to set up secure production systems.
While it is possible to set up Debian on a second partition of an existing system and set up a dual-boot configuration, I wouldn't recommend it if this is your first time installing Linux. In order to set up a dual-boot you'll need to over-write the MBR (Master Boot Record) of your hard-drive, and if you mess that up you could lose access to your entire system.
Given that Linux has such modest hardware requirements, you should be able to pick up a used Pentium II clone (non-name-brand) desktop system on places like eBay for around $100. Cheap insurance and a good investment in your education. If you've only got one system and money is tight, another alternative would be to get another hard-drive and install it in your current system (in addition to your current hard-drive). The key is to only have one hard-drive connected at a time. You'd have to do some cable swapping (the power and IDE ribbon cable) between hard-drives when you want to switch back and forth between your regular system and Linux. (Note that with this type of configuration both hard-drives would be jumpered as master). But since you'd only need a two to four gigabyte hard-drive for Linux, this would be a very low-cost option. Being that it's getting hard to find a new hard-drive for anything less than 20 gigabytes, you should be able to find a used 2 to 4 gigabyte hard-drive for $10 to $20. If you do plan to run the GUI you'll want at least 64 meg or RAM. Crucial has good prices on RAM on their system selector tool makes it easy to find out exactly what type of memory you need to order.
The options we select in this procedure are more appropriate for a server system (external Internet server or internal file server).
One thing you may want to check before you get started is in the BIOS setup of your system. Some systems have a
"PnP OS"option in the BIOS. Make sure this is set to No before you get started.
Installing the OS
The following procedure was developed installing the Debian "potato" (2.2r3) release on a Pentium II-233 clone with 128 meg of RAM, a 4-gig IDE hard-drive, and an IDE CD-ROM drive connected as the master on the secondary IDE channel. If you are installing Debian (or any Linux distro for that matter) on a name-brand system, which are inherently proprietary, you may run into some problems. In these cases it's best to check the support pages on the hardware vendor's Web site. Using the following routine on hardware with different configurations may also result in different prompts or windows appearing. It's important to READ the information presented on the various screens during the installation.
Don't worry about screwing things up. If you do, just hit the reset button on the PC and start over. Even if you don't screw something up, you can just boot off the CD to redo the install just to get more practice at it. I've gone through this install routine at least 80 times trying different options and, because you accept the default selections most of the time, you can literally whip through it in about 15 minutes once you're familier with it.
If you're using an older Pentium system with an older BIOS that doesn't allow for booting off of CDs, you'll have to use a Windows system to create two boot floppies. (They even have boot disk images for the old 1.2-meg 5.25-inch floppy drives if that's what's set up as the A: drive on your soon-to-be Debian system.) To create the boot floppies on a Windows system get two formatted diskettes and:
- Put the Debian CD #1 in the Windows system CD drive and a blank formatted floppy in the floppy drive.
- Open a DOS window and switch to the CD drive. On most systems this will be the D: drive so type in the letter D followed by a colon and press Enter.
- Go to the directory containing the disk creation program by typing in the following at the DOS prompt:
(The part of the path in blue may be different on your system. Use Windows Explorer to go down the directory tree on your CD to verify the above path.)
- If your A: drive is a 1.44-meg 3.5-inch floppy, enter the following two commands to create the two floppies:
rawrite2 -f ..\images-1.44\rescue.bin -d a
(insert the second floppy)
rawrite2 -f ..\images-1.44\root.bin -d a
- Label the two disks "Boot Disk #1" and "Boot Disk #2" in the order they were created. If your A: drive is a 1.2-meg 5.25-inch floppy drive, replace the blue part of the above commands with images-1.20
Now that you've got everything you need you can go to the system you'll be installing Debian on and begin the installation procedure.
THAT'S IT! Remove the CD and reboot the system by pressing the Ctrl-Alt-Del keys.
- Insert CD #1 into the CD-ROM drive and boot the system off of it. In the case of a non-bootable CD-ROM drive you still want to insert CD #1 in the drive but also insert the floppy Boot Disk #1 in the A: drive and boot the system. (You'll be prompted for the floppy Boot Disk #2 during the boot process.) The Welcome screen appears so hit Enter. The Release Notes screen is displayed with Continue highlighted so hit Enter and the Installation Menu will appear
The Installation Menu has two parts - upper area has a Next: and Alternate: and possibly an Alternate1: selection - lower part is the steps that you will progress through using the Next: selection
- If your hard-disk has existing partitions blow them away now (this includes any existing Linux partitions if you're redoing an install):
- Arrow down to Alternate1: Partition a Hard Disk and press Enter to run the cfdisk partitioning utility. If you're installing Debian onto the first hard-drive, highlight /dev/hda (for IDE drives) or /dev/sda (for SCSI drives). If you only have one hard-drive it will already be highlighted. Pressing Enter will display a screen about Lilo limitations. If you have an older system (which will have an older BIOS) you should read this.
- Pressing Enter with Continue highlighted will start cfdisk and the existing partitions will be displayed. (The up and down arrow keys will hightlight partitions in the upper part of of the cfdisk display. The left and right arrow keys highlight the available menu selections in the lower part of the display.) Use the arrow keys to highlight them and select Delete. After all partitions have been deleted, be sure to select the Write selection to update the partition table or nothing will change.
- After writing the updates to the drive's partition table you'll be back at cfdisk's main screen. Highlight the Quit selection and press Enter to return to the Installation menu.
- With the Next: Configure the Keyboard highlighted, press Enter and U.S. English (QWERTY) will be highlighted. Just press Enter if this is your desired selection and you'll be returned to the installation menu with the Next: step highlighted.
- This next step partitions the drive you may have just unpartitioned above. With the Next: Partition a Hard Drive selected press Enter.
- The first screen displays the list of connected hard-drive(s). Usually there's only one drive and it's already highlighted. If you have more than one IDE drive select /dev/hda for IDE drives or /dev/sda for SCSI drives and press Enter.
- The Lilo warning about 8-gig or larger drives on older systems with an older BIOS is displayed with Continue highlighted so just hit Enter to start cfdisk.
Note: The top part of the cfdisk display lists the partitions and free space and you use the up and down arrow keys to select those. The lower part of the display are the available menu options and you use the left and right arrow keys to select those.
- You should have a single line that says Pri/Log Free Space with the total free space on the disk displayed on the right. Right arrow over to the New selection and press Enter.
Note: You need to create a root partition and a swap partition (for virtual memory). You typically want a swap partition with a size that is double the amount of RAM in your system. For example, if you have 64 meg of RAM, you'll want a swap partition that's 128 meg in size. Be sure to set a root partition size which leaves enough free space for the desired-size swap partition.
Note also: If you have a large disk, you may want to leave a gig or two free for partitioning as other file types. As you will see, cfdisk can create a huge variety of partitions and you may want to try creating a FAT16 (DOS), Win95 (FAT32), or NTFS partition later to experiment with exchanging files with other platforms. For example, with a 4-gig disk I'll size the primary (Linux) partition to 3 gig. With a 256 meg swap partition, this leaves a little less than 1 gig free for later experimentation.
- With Primary highlighted press Enter but don't accept the default partition size value. This default is the entire disk and you won't have any room left for a swap partition. Enter a size in megabytes using the considerations mentioned above (3000 MB in my example).
- Once you've entered a value and press Enter you'll be given options as to where to locate the primary partition. Accept the default Beginning option and press Enter and the new partition will be displayed.
- Press the down arrow key to highlight the free space and use the right arrow key to highlight the New selection and press Enter and again accept the Primary selection by pressing Enter.
- The default partition size value is whatever disk space remains. Enter the desired size of your swap partition (I used 256 due to my system having 128 meg of RAM) and press Enter. You will again be presented with the location selection and you can just accept Beginning and press Enter.
- With this new partition highlighted, arrow over to the menu selection Type and press Enter which will display some of the different partition types cfdisk supports. Note at the bottom of the screen is a prompt that says Press a key to continue and when you do even more partition types will be displayed.
At the bottom of this second screen of partition types you'll see the Enter file system type: with the value defaulted to 82. This is the Linux Swap type which is what we want to just hit Enter.
- You should now have listed the root partition, the swap partition, and any free space remaining. Be sure to arrow over to the Write menu selection and press Enter so that all your changes get written to the disk's partion table.
- Once the partition table is updated arrow over to the Quit selection and press Enter to exit out of cfdisk and return to the installation menu.
- The installation menu will automatically highlight the Initialize and Activate a Swap Partition (hda2) so you can just press Enter. If you want to scan for bad blocks (a good idea even with new drives) Tab to No at the prompt asking you if you want to skip the scan and press Enter, and then answer Yes at the Are you sure? prompt.
- You are then prompted to initialize the Linux Native partition (the first parition you created - hda1). When you select to do this you are asked if you want to retain Linux 2.0 kernel compatibility. Accept the default Yes and press Enter.
- You are again presented with the option of skipping the scan for bad blocks. Again, Tab to No and press Enter, and again answer Yes to the Are you sure? prompt. After this, answer Yes to the prompt to mount the root file system.
- The next item in the installation menu is Install Operating System Kernel and Modules. This is where it gets a little strange. You've probably already booted off the Debian #1 CD, but it still asks you where the install files are located so you have to select the cdrom option. And then, even though it's already in the drive it tells you to put the CD in the drive. Just hit Enter.
- Configure Device Driver Modules is where you are given the chance to load additional drivers. First you're asked if you have any drivers on floppy disks. Just accept the default Yes answer to skip this. Then you are presented with a list of module categories which allow you to add some goodies to your system.
Each category has a bunch of modules listed and you have to highlight them and press Enter to install them. If you are prompted for any "Command line arguments" just leave it blank and press Enter.
Install the listed modules from the following categories. Don't try and install any hardware drivers for hardware that isn't installed and ready.
- fs - The following are modules you'd want if this would be a system which is not going to be directly connected to the Internet such as an internal file, print, or application server. For our purposes, select all of the following:
- binfmt_aout - for backward compatibility
- binfmt_aout - (same as above)
- nfs - for UNIX/Linux network file storage
- nfsd - (same as above)
(Note that lockd is selected automatically with nfs.)
Note: When installing 2.2r5 I got an error when selecting the binfmt_aout module and submitted this to the Debian bug tracking system. If you encounter an error when selecting this module, de-select by press Enter again while it is still highlighted. This will remove the + next to it. Not having it installed shouldn't be a problem.
- ipv4 - The following modules are for a system which would be connected to the Internet for firewall or proxy capability (but not needed if this will be a network file server). For our purposes, select the following:
- ip_masq_ftp - kernel support for firewall functionality
- ip_masq_irc - (same as above)
- ip_masq_mfw - (same as above)
- ip_masq_portfw - (same as above)
- ip_masq_raudio - (same as above)
- net - select ppp support (useful for more than just modems) and if you're connecting your system to a network select your NIC driver if it's listed. Many times it's easy to figure out which driver you need because the driver name coincides with the name of the NIC. However this is not always the case. The driver is often based on the chipset used by the card, not the card manufacturer or model. In the table below are some common NICs and the driver you need for them.
Note: Many drivers will prompt you for command line options. If you have a good hub or switch and a decent card, you should not have to enter any command-line options for the cards to work. They auto-negotiated a 100 mb, full-duplex connection.
NIC Driver 3C509-B (ISA) 3C509 3C905 (PCI) 3C59x - 3C590 series Vortex driver SMC 1211
Allied Telesyn AT2550
rtl8139 SMC 8432BT
SMC EtherPower 10/100
Many other cards use the pcnet32 or lance drivers. If your NIC is not one of the ones listed above you may find it, and its corresponding driver name, in the Ethernet HOWTO list.
Note that I've had problems using some SMC cards (9432 in particular) were you get errors saying "too much work at interrupt" and the card does not work properly. Your safest bet is to use a 3Com 3C509-B (ISA) or 3C905 (PCI) card. They're widely supported, I've never had a problem with them, and they're readily available on eBay.
- Because you selected net modules, the next step in the installation menu is to Configure the Network.
- Enter a hostname for your system. If this is going to be an Internet server, use a name that describes its function (ex: "www" or "mail"). If it's going to be in an internal domain in your company, use a name that uniquely identifies it. If this is going to be a home Web/e-mail server using dynamic DNS you'll want to pick something that's really unique. If not, you can just accept the default "debian" name.
- If you installed a NIC driver the eth0 (ethernet 0) selection will appear. Press Enter to continue.
- Select the No response to the question asking you if you want to use DHCP or BOOTP.
- Next you have to enter an IP address for your system. If you're installing this machine on an existing network, MAKE SURE IT'S AN AVAILABLE IP ADDRESS!. If you choose an IP address that's used by another system you'll cause all kinds of problems. (You can use a different system to try and ping the address you plan to use to make sure there are no replies to it.) If you don't know what IP address to use don't accept the default since it's commonly assigned in home networks.
Note: If you're installing this machine on an existing network, even a home network, try this:
- Go to a Windows machine that's also on the network
- Open a DOS window
- At the DOS prompt type in winipcfg or ipconfig (one of them should work) and see what the IP address of the machine is
- Think of an address for your Linux system where the first three "octets" are the same. For example, if the Windows machine has an address of 192.168.10.23, the address for you Linux machine should be 192.168.10.xxx (you make up a number for "xxx" from 1 to 254)
- Try to ping the number you come up with. For example, if the number you come up with for xxx is 45, at the DOS prompt type in ping 192.168.10.45 and make sure there are no responses to the ping. This means the address isn't being used by another system so you can use it for your Linux system.
- The subnet mask will be automatically calculated for you based on the class of the IP address you entered and it should be OK as long as you're not on a subnetted LAN.
- Enter a gateway address if you know what it is (the default route off your network). If it's a home network you probably not have a gateway (unless you have a cable/DSL router). Don't just accept the default entry as a system that's not a gateway may already have this address. The procedure above using a Windows system already on the network may display a default gateway address. If not, just back-space out the default value and press Enter leaving the field blank.
- You will then be prompted for a domain name. Enter your domain name if you already have one. If you're just playing around, use your last name (for example smith.net). You'll see why on the
Internet Serverspage. If you accepted the default "debian" host name earlier, your system will then be referred to as "debian.smith.net". Don't worry about conflicting with a real domain that may have that name since this machine won't have a DNS record created on any ISP's DNS server.
Note: There are up to three types of "domains" to consider when you are asked for a domain name in Linux. If this will be a system in your Internet domain space, naturally you would use that name. Companies can also set up an internal domain space which has the same type of naming hierarchy as the Internet domain naming system. This type of domain name can be anything you want because it is not visible to the outside world nor do you have to "register" the name with any domain naming authority. In other words, a company can have a public (Internet) domain name (registered through someone like Network Solutions) and a private (internal) domain name. They can be the same or they can be different.
The third type of domain are familier to those who work with Windows NT networks. These domains only have a single-word domain, not the dotted hierarchy found on the Internet and in internal Linux/UNIX networks. Linux does not support these type of domains. However, starting with Windows 2000, Windows servers also started using the dotted hierarchy domain naming convention. If you have any such Windows servers on your network, your Linux system can be put into this domain space (i.e. be given the same dotted domain name as your Windows 2000 servers).
- At the prompt for a DNS address, enter the address of one of your ISP's DNS servers. (Most companies don't have heir own DNS servers and will usually use the DNS servers of their ISP or WAN service provider.) Here again you don't want to just accept the default because that address may be used by another machine on the network which isn't a DNS server. If you're not sure of your ISP's DNS server addresses, just backspace out the existing address and leave it blank.
Note: If you enter your ISP's DNS server address, some network-related functions (like establishing a telnet session) may operate slowly until your get your system connected to the Internet so it can "see" the ISP's DNS server. However, this is the only viable entry to use on networks that don't have their own DNS server.
- Back at the installation menu Install the Base System is highlighted which only involves confirming the cdrom as the source of the files.
- Once installed you now Configure the Base System which involves making several selections:
- For the timezone select your country in the left column (if you're in the US, choose "US" and not "America") and press Enter and then select your time zone in the right column.
- Tab over to the No selection when the prompt appears asking you if your hardware clock is set to Greenwich Mean Time.
- The next three selections refer to setting up the system to boot up.
- Select Make Linux Boot Directly From Hard Disk
- Select the default Install Lilo in the MBR
- You don't need to Make a Boot Floppy so arrow down to Alernate: Reboot the System press Enter and answer Yes to the confirmation.
Be sure to remove the CD as the system reboots to force it to boot off hard-drive. This next phase of the OS installation will install some basic software and configure some basic OS operations. You may see some errors messages in all of the text that's displayed during the boot process. Don't worry about those at this point.
- The first series of dialogs will be password and account related. Note that the cursor will not move and nothing will be displayed when you enter passwords.
- First you'll be asked if you want to use MD5 passwords. Use default No selection.
- Next you'll be asked if you want to use shadow passwords. Use the default Yes selection.
- Then you'll be prompted to enter, and re-enter, a password for the root (super-user) account. REMEMBER IT.
- Finally you'll be be asked to to create a non-root user account entering the username, full name, and password. Create one for yourself.
- When asked if you want to remove the PCMCIA files accept the default Yes answer.
- When asked Do you want to use PPP to install the system? use the default No answer.
- At this point the apt (package installer) configuration begins. Before continuing, place the CD #1 back in the drive. What apt is going to do is scan the CDs and create an inventory of the packages on them and store it in a database for later use. Press Enter to accept the default cdrom selection.
- After the CD #1 is scanned it will ask if you have another CD to scan. Pop in CD #2, Tab to the Yes selection and press Enter. Also do this for CD #3.
- Once CD #3 has been scanned, remove it and and put CD #1 back in the drive. This time, accept the default No to the prompt asking if you have another CD to scan and press Enter.
- When prompted to add another apt source accept the default No answer and press Enter.
- The next window to appear is the System Configuration window where you are asked to choose between the Simple and Advanced configuration options. Accept the default Simple option and press Enter.
- The Task Installer appears with a list of task packages you can select using the space bar. Only select following at this time:
- C++ Dev
- C Dev
- All four Gnome selections
- X Window System Core (don't select "X Window System")
Tab to Finish and press Enter.
The GUI setup begins....
- Accept the default Yes to have anXious detect your video card and another window appears saying that a default X server has been selected based on the detected card. Take note of the X server that was selected! (For example, on my system it said "The s3v server will be installed.") You may need this later. Then just press Enter.
- In the font selection window xfonts-75dpi is already selected so Tab to OK press Enter
- An "X terminal" is like a "MS-DOS Prompt" window in Windows 9x, basically just a window with a text-based interface in it so you can enter commands at the shell prompt while in the GUI. When the X terminal selection appears, you can't see it because it's further down the list but xterm is already selected so just Tab to OK and press Enter
- On the Window Manager selection screen you can't see it because it's further down the list but twm is already selected so just Tab to OK and press Enter
- Accept the default No to not install X Display Manager and press Enter
- On the mouse selection screen, only use the Microsoft selection if you are using a serial mouse. Select PS/2 if your mouse is connected to a PS/2 port. Tab to OK and press Enter.
- Accept default Yes to emulate 3 buttons by pressing Enter.
- The location of the mouse driver appears with the default /dev/mouse displayed. If you're using a serial mouse, change this to /dev/ttyS0. For a PS/2 mouse, change it to /dev/psaux and press Enter.
- Press the Space Bar to select US/Standard keyboard unless you have one of the other models listed, Tab to OK and press Enter.
Next you'll need to select the horizontal and vertical sync frequency ranges of your monitor. In both cases you want to use the Custom selection so you can enter the values that conform to your monitor.
- For the Horizontal Sync Range arrow down to Custom and press space bar. Tab to OK and press Enter. Then enter the low and high horizontal sync range values separated by a dash (-) only. Example (for my 17" Viewsonic monitor):
and press Enter. If you can't find the horizontal sync range of your monitor, try using the #5 selection (
800x600 60 Hz 640x480 72Hz).
- For the Vertical Sync Range again arrow down to Custom and press the Space Bar. Tab to OK and press Enter. Enter the range using the same format as above (for my 17" Viewsonic monitor I entered "50-180") and press Enter. If you don't know the vertical sync range of your monitor try using the #3 selection (50-100).
- Accept the My Monitor default value by pressing Enter.
- The Amount of Video Memory should already be selected from when anXious probed the card so just Tab to OK and press Enter and press Enter again to accept the default My Video Card value.
- Press the Space Bar to select None for a clock chip value and Tab to OK and press Enter.
- Unless you're running a 486, accept the default No to probe a clock line by simply pressing Enter. If you have a 486 you may have an older video card so you may want to try Tab-ing to Yes and pressing Enter to see if the probe finds anything.
- Accept the default 8bpp by Tab-ing to OK and pressing Enter.
- If you have a 15" monitor, you'll waat to have only the 640x480 selected for the resolution. If you have a 17" monitor have only the 800x600 value selected (i.e. de-select the 640x480 value) using the Space Bar. Then Tab to OK and press Enter.
- For supported resolutions select the same resolution you selected above and no others. Then Tab to OK and press Enter
- Accept the default path and file name for the configuration file by pressing Enter
- The X Configuration Complete window appears with OK highlighted so just press Enter.
Done with the GUI setup
- At this point it will tell you how many packages will be installed, how much disk space will be used, and asking you if you want to continue. The upper-case Y indicates that Yes is the default answer so just hit Enter.
- You will be prompted to insert CD #1 which you put back in the drive in a previous step so just prsss Enter. (You'll likely also get prompted to insert the other two CDs along the way).
- You will then be asked if you have sound hardware installed. If you do, you can accept the default Yes to set it up if you want to but you probably won't have much use for it. Otherwise just Tab to No and press Enter.
Note: At some point around here you may see a list of gnome and lib packages with a message about:
dpkg returned an error code (1)The setup of these will come later in the process. Just blow past the error by pressing Enter.
Also: At some point you will likely see a prompt about:
No default X server previously setand prompting you to use one that is listed. This should be the same X server you noted earlier in the installation (at the anXious probe). If it is, accept the default Yes answer by presing Enter. If it isn't, answer No and enter the X server you noted earlier.
- Next you see a message about helping you configure your mail system. Debian installs the Exim e-mail server software by default which is a shame. 99% of the UNIX/Linux world uses Sendmail. On the
Internet Serverspage we'll remove Exim and install Sendmail but for now:
- Press Enter at the "Press Return" prompt
- Select option 5 to not configure Exim
- You may get a prompt asking you if you want to retry because some:
packages failed to installThis is due to the earlier errors. Accept the default Y for this and press Enter.
- If you get a prompt about erasing the .deb files accept the default Yes by pressing Enter.
We're not actually done with the initial setup of the system yet. The rest will be covered on the Packages page. For now though, try taking your new Debian system out for a spin around the block in the next section.
As your system reboots a lot of messages will be displayed. With a faster system you won't be able to read them all. You can use the Shift-PgUp and Shift-PgDn key combos to scroll through this previously-displayed text to look for any error messages, etc. Don't be too concerned about error messages at this point. We still have to install and update the packages.
Once your system restarts you'll be presented with a login prompt. Because Linux is a multi-user OS you have to indentify yourself to the OS via a login. Log in using the root username and the root password you entered during the install.
Once you log in the shell prompt debian:~# is displayed. The # indicates you're logged in as root. (Non-root users get a $ prompt.) The debian is the hostname you gave to the system during the install. The ~ indicates that you have been placed in root's home directory. Whenever you first log in you will see this prompt because every user defaults to their home directory at login. (User home directories are created automatically when the user accounts are created on the system.)
All non-root users have a sub-directory under the /home directory. The names of these home sub-directories for non-root users match the user names (ex: /home/fred). The root user is a little different. root's home directory is off the root of the file system. Instead of /home/root it's at /root. It's important to understand that /root is the root user's home directory. Don't confuse it with the "root" of the file system, which is denoted by a single slash (/).
Since you're in the root user's home directory, look at the files the install routine created by typing in ls and pressing Enter. You won't see anything because there's nothing there. Kind of. There are no user files there. However, there are some system files there. Try typing in ls -laF and pressing Enter. You'll see two files that start with a period, the .bashrc and .profile files. They're both kind of the same thing, like a config.sys file on DOS systems.
The .bashrc file sets certain environment defaults when you use the bash shell. The .profile does the same thing, regardless of which shell you use. You can look at the contents of the .profile file by typing in
('cat' is the equivalent of the DOS TYPE command which just "types out" the contents of a text file on the screen.) As you can see, it's mainly just the setting of the PATH variable and you can see what the value of your path is set to. Notice I said your path. In UNIX/Linux each user gets their own path.
Now lets look at the .bashrc file. Type in
There's a little more here but most of it is commented out. In most UNIX/Linux configuration files any line that begins with a pound character (#) are comments (or are commands that have been commented out as in the case of numerous alias commands in the .bashrc file).
Note: There is one case where a line starting with a pound character (#) is not a comment. The very first line is shell scripts will look something like this:
This is known as the "bang" or "shebang" line. It specifies the path to the shell that the script should be run in. (You can run a shell script under a different shell than the one you're currently using.)
alias commands let you substitute one command for another, or "create" your own command. Note the line in the .bashrc file:
alias rm='rm -i'
This just substitutes the standard alias command with itself but using the -i command-line switch. The -i command-line switch is interactive mode, which means it will prompt you for a confirmation whenever you use the rm command to delete a file (a safety measure).
You can also "create" your own commands by aliasing existing commands with a different name. For example, you could enter the following line in the .bashrc file:
alias zapfilz='rm -i'
to "create" a zapfilz command.
Linux defaults it's "virtual terminal" sessions (what you use when you are working at a shell prompt) to the "tty" (teletype) specification. However, some text editors don't get along with the tty terminal type very well. They work better with a "VT100" type of terminal. (The term "terminal" refers to the old "green screen" keyboard/screen devices that were commonly used with mainframes.) Since you tend to work with text files quite a bit in Linux, it would be beneficial to set our virtual terminal sessions to use the VT100 terminal type.
Lets use the infamous vi text editor to edit the .bashrc file to change our default terminal type to VT100. We'll do this using an export statement.
Note that what we just did changes a startup file. It won't have any effect until the next time you log in. However, just enter that same command at the shell prompt and it will take effect immediately. Once your enter it at the shell prompt, you can make sure it took effect by entering this command at the shell prompt:
- At the shell prompt type in
vi .bashrcto open the file in the editor and the contents will be displayed.
Note that there already is one export statement in the .bashrc file. This statement is what sets our shell prompt to display the hostname and current working directory.
- Press the down arrow key until you get to a blank line in a file (the position of the command in the file isn't important).
- Press the 'a' key (for append).
Note: If you screw things up and you want to quit without saving, just press the following keys in the given order:
Esc : q ! Enter
- Type in the following line (don't start the line with a pound sign):
- Now press the following keys in the given order to save the changes and exit vi:
Esc : w q Enter
You can also try entering this command the next time you log in to make sure that the statement you entered into the .bashrc file is correct. $TERM is the environment variable which stores the current terminal value. All environment variables are upper-case. You use the $ character in front of them to indicate you want to echo the contents of the variable. If you didn't use the $ in the above command the word TERM would simply be echoed to the screen.
The vi editor is legendary in it's difficulty to master. For one, it's a line editor, not a full-screen editor. For another, it has an "edit" mode and a "command" mode. (We went into edit mode above when we pressed the 'a' key above, and went back to command mode when we hit the Esc key.) There are entire books written on vi. It's only fair to mention though, that vi's keystroke combinations were devised in such a manner that once you get really good with vi, you'll rarely have to take your fingers off the "home" positions on the keyboard. The reason you want to at least become familier with vi is because every Linux and UNIX system will have it, no matter how old or eccentric a distro it is. That can't be said about any other editor.
Keep in mind that changes made to the .profile only take effect when you're logged in as the same user that you are logged in as when you make the changes. Each user has their own .profile file located in their home directory (but as the root super-user you can edit everyone's .profile file if you want to set up a standard).
The same is true of the .bashrc file, except that, in addition to it only being valid for the current login, it is also only valid if you choose to run the bash shell. Likewise, every user that is set up to use the bash shell by default (which is the default shell in Linux) will have a .bashrc file in their home directory.
If you type in:
you'll see that you are using the Linux-default bash shell.
Where to learn more - The best of our bookshelves:
Debian GNU/Linux Bible is your typical Bible-series book. It's nothing you'd want to sit down and read cover to cover but it's a good reference to have as a starting point when you want to play around with something new. It covers a very wide range of subjects without a lot of depth but throws in a lot of command and code examples. It gets into backups, scripting, multimedia, GUIs and GUI apps, adding peripherals, all the various types of servers you can set up (including NIS), and monitoring tools. (Note that this book covers version 2.2 but most of the material is also relevant to 3.0.)
Here's something you can try. Log out of the system using the exit command. Start to log back in as root, but this time use the wrong password. You'll simply get an error message saying it was incorrect and another login prompt. At this second login prompt, use the correct password. Right above the shell prompt you'll see the message:
1 failure since last login
The "failure" the system is referring to is a login failure for the user account you just logged in as (works for all users, not just root). This is good to know as it will let you know if someone has been trying to hack in using this particular username.
What's next? If your system is connected to a network you should try seeing if you can ping another workstation on your network. You can use the procedure in Step 10 of the installation above (using winipcfg or ipconfig) to find the IP address of any Windows system on your network. For example, if the address of another system on your network is 192.168.10.12 you'd type in
and see if you get "64 bytes from" the address. Left on its own, Linux ping will just keep pinging so press Ctrl-C to end it.
If you don't get any ping responses or get errors indicating that the "Network is unreachable" you can enter the ifconfig (not ipconfig as with Windows) and check the settings for your eth0 interface (this is the NIC). The lo interface is the local loopback which is only used for testing.
If no eth0 interface is listed, you want to check to see if the kernel driver module got loaded at boot up. Enter the lsmod command. You should see 3c59x or whatever driver you specified during the install listed.
If the module IS loaded (but eth0 doesn't show up in the ifconfig list) it means that the kernel "sees" the NIC. It's just not being brought up automatically at bootup. Check to see if it's set to be brought up automatically by typing out the contents of the interface configuration file with the command:
and look for the line:
If there is no line like this, or if "eth0" isn't on the line, or if it has a pound character (#) at the beginning of the line (commented out) that's the problem. On the Packages we'll install a text editor called ee. You can wait until this editor is installed to open this file and correct the problem or you can try to edit it using the vi editor.
If the module ISN'T loaded try loading it with the command:
Substitute the "3c59x" for the name of the NIC module you selected during the installation. After doing this you may also need to bring the interface up manually. Use the ifconfig command to see if eth0 is now listed. If not, bring it up with the command:
ifconfig eth0 up 192.168.10.50 netmask 255.255.255.0
substituting an address and subnet mask appropriate for your network. If you couldn't load the module you may have specified the wrong driver module during the installation or your NIC may be bad or, if this is a used non-PCI NIC, may have had the default IRQ, etc. settings changed at some point.
Once everthing is working, back up your server using our backup page.
Solving Hard-Drive Problems
The one downside of using an older system to set up a Linux server is that the most likely devices to fail are the power supply and hard-drive. When a hard-drive starts to go bad on a Linux system you'll usually find out about it when you boot the system.
The messages displayed when disk errors are encountered duing boot-up are pretty ominous, and a little confusing. You're told to run fsck manually but not really told how. The command to mount a file system as Read/Write is also given and that's NOT what you want to do. You're given the choice of pressing Control-D for "normal startup" (which is actually just a reboot which won't help the problem at all) or entering the root password for system maintenance. When presented with these errors and this choice, do the following:
- Enter the root password.
- Run the command fsck -fp /dev/hda1 (or whatever your root partition is).
- Repeat the above command until no errors are displayed.
- Reboot the system using the init 6 command.
- Run the command badblocks -sv /dev/hda1 (or whatever your root partition is). It will take awhile.
One way to tell if your hard-drive is starting to fail is to turn the system off for about 30 minutes. If you don't have problems for the first hour or so of using, but then problems start popping up, the hard-drive is failing. That's because failing hard-drives are more sensitive to heat and the hotter the drive gets the more likely it is to have problems. Replace these heat-sensitive drives ASAP.
While the above installation procedure got you an operational system, it's pretty much bare-bones at this point. Next we'll install the "base" and some optional packages on the Packages page to put some meat on the bones.
Did you find this page helpful ?
If so, please help keep this site operating
by using our DVD or book pages.
Site, content, documents, original images Copyright © 2003-2013 Keith Parkansky All rights reserved
Duplication of any portion of this site or the material contained herein without
the express written consent of Keith Parkansky, USA is strictly prohibited.
This site is in no way affiliated with the Debian Project, the debian.org Web site, or
Software In The Public Interest, Inc. No endorsement of this site by the Debian Project
or Software In the Public Interest is expressed or implied. Debian and the Debian logo
are registered trademarks of Software In The Public Interest, Inc. Linux is a registered
trademark of Linus Torvalds. The Tux penguin graphic is the creation of Larry Ewing.
IN NO EVENT WILL KEITH PARKANSKY OR BLUEHOST INCORPORATED OR ANY OF ITS' SUBSIDIARIES BE LIABLE TO ANY PARTY (i) FOR ANY DIRECT, INDIRECT, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF PROGRAMS OR INFORMATION, AND THE LIKE), OR ANY OTHER DAMAGES ARISING IN ANY WAY OUT OF THE AVAILABILITY, USE, RELIANCE ON, OR INABILITY TO USE THE INFORMATION, METHODS, HTML OR COMPUTER CODE, OR "KNOWLEDGE" PROVIDED ON OR THROUGH THIS WEBSITE, COMMONLY REFERRED TO AS THE "ABOUT DEBIAN" WEBSITE, OR ANY OF ITS' ASSOCIATED DOCUMENTS, DIAGRAMS, IMAGES, REPRODUCTIONS, COMPUTER EXECUTED CODE, OR ELECTRONICALLY STORED OR TRANSMITTED FILES OR GENERATED COMMUNICATIONS OR DATA EVEN IF KEITH PARKANSKY OR BLUEHOST INCORPORATED OR ANY OF ITS' SUBSIDIARIES SHALL HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, AND REGARDLESS OF THE FORM OF ACTION, WHETHER IN CONTRACT, TORT, OR OTHERWISE; OR (ii) FOR ANY CLAIM ATTRIBUTABLE TO ERRORS, OMISSIONS, OR OTHER INACCURACIES IN, OR DESTRUCTIVE PROPERTIES OF ANY INFORMATION, METHODS, HTML OR COMPUTER CODE, OR "KNOWLEDGE" PROVIDED ON OR THROUGH THIS WEBSITE, COMMONLY REFERRED TO AS THE "ABOUT DEBIAN" WEBSITE, OR ANY OF ITS' ASSOCIATED DOCUMENTS, DIAGRAMS, IMAGES, REPRODUCTIONS, COMPUTER EXECUTED CODE, OR ELECTRONICALLY STORED, TRANSMITTED, OR GENERATED FILES, COMMUNICATIONS, OR DATA. ALL INFORMATION, METHODS, HTML OR COMPUTER CODE IS PROVIDED STRICTLY "AS IS" WITH NO GUARANTY OF ACCURACY AND/OR COMPLETENESS. USE OF THIS SITE CONSTITUTES ACCEPTANCE OF ALL STATED TERMS AND CONDITIONS.