offline
- gamzzy
- Legendarni građanin
- Pridružio: 24 Apr 2003
- Poruke: 10725
- Gde živiš: Novi Sad
|
In this first of a two part series, I will try to guide you through installing Debian Linux for a desktop computer.
For those unfamiliar with Debian, all I can say is I've tried and used a lot of distributions, but nothing comes close to Debian. Debian is the old grandfather of Linux and was one of the first Linux distributions out there.
It was certainly the first distribution with package management. Besides having a rich history, Debian is reputed to be rock-solid, has excellent package management system and to go along about 15,000+ packages (as of today). It is completely free in spirit and in cost.
So why isn't everyone using this wonderful distribution? Critics have come up with several reasons. They say Debian isn't user friendly enough. They say the installer is too archaic. They say the packages are too outdated. And it's all true to some degree...but only if you choose the Debian Stable branch.
Now for a little explanation about the branches. Debian is divided into three branches: stable, testing, and unstable. Debian Stable contains packages which have passed their rigorous testing procedures.
The "Testing" branch contains tested packages that aren't considered stable. But it is the "Unstable" branch that interests us. It's the one that contains more recent packages and is perfect for desktop use. "Unstable!" I hear you say. Why would you use anything called unstable? Well, you've got to take the name with a grain of salt. After all, Debian creates the most stable Linux ever created.
Their idea of unstable is in regards to server use and is perfectly suited for desktop users. If you don't like the name, Debian Unstable also goes by "Sid".
Interested yet? Before we begin I must warn you that Debian requires you to have some Linux knowledge, but by no means do you have to be a elite hacker to run Debian.
You must be able to:
- Be comfortable with building kernels, loading and unloading modules.
- Have a decent knowledge of your computer's hardware (model names and numbers), in case you need it.
- Edit configuration files and read documentation.
If you aren't comfortable doing some of the above things, Debian will give you a great opportunity to learn. If you'd rather run Debian without going through all the fun of installing and configuring Debian, there are a multitude of Debian-based Linux distributions such as MEPIS and Libranet. Lastly, it is also recommended that you have a broadband connection.
Ready to go on a Debian installation spree? Let's get started.
Obtaining Debian
Just like most other distributions, you can download an ISO file and burn it onto a CD. There is a list of mirrors (PLEASE INSERT LINK: http://www.debian.org/CD/http-ftp/) where you can download from. Keep in mind that we'll be getting the Debian Stable ISO and we will upgrade it to Unstable after installation. For most of us, the file to download (as of today) is debian-30r2-i386-binary-1.iso. Download and burn the ISO, put the CD in your drive and reboot.
The Installation:
Much has been said about the Debian Installer. Most of it is very negative. However, it really doesn't live up to its expectations. It's actually a simple yet powerful installer. You are presented with a list of choices with the two most likely options at the top. You can jump around from one step to the other, but it's best to stick to the tried and true routine. The installer defaults work quite well for most people.
The first screen you encounter is the "Welcome to Debian GNU/Linux 3.0!" At the "boot:" prompt please enter "bf24" (without the quotes) and press enter. This is essential to do because it tells the installer to install the 2.4 kernel series. You will see some boot messages scroll past the screen. After this you will be greeted with a standard language selection screen. I'm going to assume this will be English for most of us. Press "Continue" on the Release Notes screen as this screen is just informational. Then we will arrive at the main installation screen.
Press enter to get to the keyboard configuration screen. Press enter again to accept qurerty/us as your keyboard unless you are sure you have a different kind. On the next screen, press enter again to select partitioning your hard disk as the next step. You will be presented with a list of hard drives and must pick which one you wish to partition.
The next two screens are informational so please make note of them and move on. You should now be presented with the cfdisk partitioning utility. You must create a minimum of two partitions, a swap and a root. First, let's set up the swap partition. Use the buttons at the bottom of the screen to create the partitions. Press the "New" button and then press.
"Primary" and then for the size put in a value about double the value of your RAM. Don't make it too big though, 512MB is a good high number. Press "Beginning" when it asks you where you want the partition. Then press the "Type" menu entry and then press enter twice. Make sure the partition is correctly shown as "Linux Swap" and the size is right.
Similarly, make the root partition. It should be atleast a few gigabytes, the more the better. There is no reason to change the type for this partition. Now press the "Write" button and then type "yes" to confirm your decision. Type q or press the "Quit" button to exit cfdisk. You will return to the installation screen.
Press enter to move to the swap partition initialize screen. The installer will ask you if you want to scan for bad blocks. Say no. Say yes to confirm the initialization of the swap partition. Press enter again to get to the initialize Linux partition screen.
You will be asked to select what filesystem you would like. While ext2 is a good choice, ext3 is better yet because it provides journaling capabilities. The journaling capacity of ext3 means fewer file system checks and less data corruption. Ext3 is the recommended choice here, although you can choose ext2 and even reiserfs.
On the next screen, say no when it asks you to run a bad-block scan. The next screen is another confirmation screen: say yes. You will see some messages as the installer formats your partition. On the next screen, say yes when it asks you to mount the root filesystem.
You will return to the installer menu. Press enter to get to the kernel installation screen. The installer should detect your Debian CD and ask you whether you want to use it as the primary medium. Say yes. The installer will then copy the kernel and some modules onto your hard drive.
Press enter again to get to the driver category screen. This is an important screen. For most people, the Debian installer should have detected your hardware and loaded appropriate drivers and you don't need to do it manually.
However, if at a later stage of the installation you find that (say) your network isn't working you need to return to this screen and loaded the appropriate driver. However, for now press enter to exit this screen and you should return to the installation menu again.
Press enter to configure the network if you are connected to the internet directly (not through a dial-up modem). The first screen you will see is the hostname screen. Change it to a desired name and press enter. On the next screen, say yes to automatic DHCP configuration unless you know what you're doing.
In a few seconds, you should get a confirmation that the settings were properly detected. If it does not or if the installer did not find a network interface altogether, you need to troubleshoot your network. Make sure the cable isn't loose and call your ISP to see if the network is having problems. If these tactics don't work, go back to the driver category screen and select a module for your network card. If the module installation is successful, come back to the network configuration screen and try again.
Press enter to install the base system. The installer will install base and core packages. It will not install X or KDE or Gnome or any kind of graphical interface. We will install it ourselves after installation is over.
After the base system is installed, press enter to get to the make system bootable screen. Now we will install the boot loader. Install LILO to the master boot record (this will work for most of us). If the installer detects any other operating systems on your computer it will ask you whether you would like to add them to the LILO boot menu. You should add these as you may need to boot them in the future.
Almost done! You can optionally make a boot floppy but I always skip this step. Select the "Reboot the System" option. The computer will reboot and you should see a LILO menu and Debian should boot by default.
Upon rebooting, you will be presented with a few questions about your system such as your time zone etc. Next, it will ask you to set the root password. Say yes to enabling MD5 and shadow passwords. Set a root password. Then it will let you add a user for daily use. Next, say yes to remove PCMCIA packages. Say no to PPP installation unless you have a dial-up connection.
For the next step make sure your Debian CD is in the drive. This is to ensure that the packages on it are scanned. When you are asked if you would like to add another apt source, say yes and then select the "Edit sources list by hand" option. A text editor will be opened. Append the following lines to the file:
# Primary
deb ftp://ftp.us.debian.org/debian testing main contrib non-free
#deb-src ftp://ftp.us.debian.org/debian testing main contrib non-free
deb ftp://ftp.us.debian.org/debian unstable main contrib non-free
#deb-src ftp://ftp.us.debian.org/debian unstable main contrib non-free
# non-US
deb ftp://ftp.ie.debian.org/debian-non-US testing/non-US main contrib non-free
#deb-src ftp://ftp.ie.debian.org/debian-non-US testing/non-US main contrib non-free
deb ftp://ftp.ie.debian.org/debian-non-US unstable/non-US main contrib non-free
#deb-src ftp://ftp.ie.debian.org/debian-non-US unstable/non-US main contrib non-free
# Experimental
#deb http://ftp.us.debian.org/debian ../project/experimental main contrib non-free
#deb-src http://ftp.us.debian.org/debian ../project/experimental main contrib non-free
# ***Do not edit above this line, ok to change sources below this line***
# Security updates
deb http://security.debian.org testing/updates main contrib non-free
# java
deb ftp://metalab.unc.edu/pub/linux/devel/lang/java/blackdown.org/debian unstable main non-free
Press Control-X to exit the text editor. It will ask you whether you want to save changes. Press "y" and then press enter. The configuration program will ask you whether you want to add another apt source. Press no. Say yes when it asks you to use security updates. When it asks you to run tasksel, select no because we still haven't upgraded to the unstable branch. Say no to run dselect also.
If you select to remove PCMCIA packages, it will do so now and delete unnecessary package files if needed. Setup will probably run exim configuration. Press 5 (No configuration) to exit this. You should be presented with a login prompt. Login with the root account.
The other file we need to modify is the /etc/apt/apt.conf file. Create that file using your favorite text editor and add the following lines:
APT::Default-Release "unstable";
APT::Cache-Limit 10000000;
Apt::Get::Purge;
The most important line of apt.conf is the first one which tells it to get packages in the "unstable" branch. To finalize our completion switching our Debian system to unstable, enter the following commands as root:
apt-get update
apt-get dist-upgrade
This should take a few minutes. The first command refreshes the list of packages in the apt system database and the second one upgrade packages on the system to unstable. Having a broadband connect really helpful here as the system downloads and installs packages.
After this process is finished, you will have a fully working Debian Unstable installation. However it is far from being a complete and up to date desktop. We don't even have our graphical system and window manager installed.
For the purpose of installing XFree, Debian provides a meta-package (a sort of super package) that contains all the packages you need. This package is called x-window-system. To install it, type:
apt-get install x-window-system
Similarly, there is a meta-package for Gnome and KDE. To install gnome and KDE
apt-get install gnome
apt-get install kde
So now you have either Gnome and/or KDE installed. You probably also want a display manager such as kdm and gdm to allow for graphical logins.
apt-get install gdm
or
apt-get install kdm
If you use a graphical display manager you're most likely going to want to run automatically at bootup. To configure bootup services, Debian has an excellent tool called rcconf. To install rcconf, you guessed it:
apt-get install rcconf
After it installs, run rcconf and select gdm or kdm as a service you would like to run.
No desktop system is complete without good hardware detection and plug and play support. Two plugs in play services that I like to use are discovery and hotplug. For example, just the other day I plugged in my USB keyboard into one of my computers. I didn't expect Debian to detect it. Not only did it detect it configured it for my use because I had hotplug and discovery running at bootup.
apt-get install discovery hotplug
Notice how you can chain two packages together into one command. This will install both discovery and hotplug. Also, run rcconf again to make sure these services are started at bootup.
So now we have a completely functioning Debian desktop! In the next part of this series I will show you how to properly configure audio, video, and printing. I will also give some great optimization tricks that will make Debian fly including upgrading to the 2.6 kernel.
Till then, happy Debian hacking!
About the Author: Tarun Agnani is a senior in Computer Science at university. He has a internship doing software development at the current moment. When he's not tinkering with computers (and breaking them), he enjoys pursuing the Rich Inner Life through friends, family, and fun. You can find his website here
|