LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 04-05-2006, 10:43 PM   #1
vmlinuz.gz
Member
 
Registered: Nov 2005
Posts: 123

Rep: Reputation: 15
How I got Debian 3.1 to do everything Windows can.


I'm a beginning programming student and computer science major and thought it would be worth it to try something besides Windows for a change. I felt that trying Linux and learning it about would benefit my education.

Naturally, like most Linux beginners, I had a few problems getting it to work right. Luckily, I found LinuxQuestions.org. It helped me substantially. Also, having connections to an IT worker didn't help either.

So, for anyone who is bored, I've decided to write about how I got my Debian system up and running from the beginning to the end.

Step #1: Installation.

I've heard from numerous sources that installing Linux (and Debian in particular), was a difficult process. I've found this to be ridiculously false. In fact, I thought it was easier then Windows, and I even had a recently installed hard drive and partition resizing to deal with.

Without much thinking I inserted my newly burnt Debian 3.1 netinst installation disk into the CDROM drive and rebooted my computer. After mashing the Enter key at various prompts, I found myself at the partitioner screen. It was there that I came across my first (and only) problem with the installer; it wouldn't resize the Windows partition. That was easily solved. A quick Google search revealed that it probably refused to resize my partition because my main hard drive wasn't defragmented. After running the Windows defragmenter utility, it was very obvious that it was exactly the problem. My hard drive was a complete mess, to put it lightly. My iTunes library may have been the culprit. Anyway, I'm pretty glad that it didn't actually resize the partition; if it did, I imagine I basically would've lost half my system. (:

After defragmenting, getting the base system up and running with the installer was only a few more Enter key-mashing sessions away. Before I knew it, I was booting in to version 2.4.27 of the kernel, where a prompt was eagerly awaiting commands.

Step #2: Installation of core utilities.

Before I went about getting the GUI set up, I immediately made use apt/aptitude and installed fundamental programs I couldn't live without. (G)Vim, sudo, ncurses, make, wget, bzip2 and such. For now, I just used the stable repositories (probably outdated, to be honest). No problems; and more of an extension of Step 1 then anything.

Step #3: Getting X to work.

This is where the problems began. Thinking I was ready, I went ahead and asked apt to retrieve the X Window System for me. That went okay...until I actually tried to run it! It kept crashing everytime I tried to start it.

I went ahead and shoved my error messages into Google. There, I found that it probably wasn't a good idea to run my particular version of X on version 2.4.x of the kernel. So, I then looked into upgrading it.

Step #4: Getting version 2.6.16 of the kernel set up.

Now, I wasn't ready to compile anything just yet. It was late at night I believe, and I would be hardpressed to do something that involved that much...time. So, I asked apt to get the image for me. Not such a smooth move. For one thing, my internet didn't work when I booted into version 2.6. X finally worked, but my system would be of little use without internet. I tried and tried and without success to get the image working. It was no use, and I moved to the last resort: compile the kernel from scratch.

It seems like most Debian users like to use apt to install the kernel sources and headers. I prefer a different method. Of course, I had to boot into version 2.4.27 to access the internet. Here's how I got my sources compiled (here, I will be using version 2.6.16):

Code:
$ wget http://www.kernel.org/<whatever_the_path_to_the_sources_was>/linux-2.6.16.tar.bz2
$ sudo tar -xjvf linux-2.6.16.tar.bz2
$ sudo mv linux-2.6.16 /usr/src/
$ cd /usr/src/
$ sudo ln -s linux-2.6.16 linux
$ cd linux-2.6.16
$ sudo make mrproper
$ sudo make O=/home/<my_name>/build/kernel menuconfig
$ sudo make O=/home/<my_name>/build/kernel
$ sudo make O=/home/<my_name>/build/kernel modules_install install
$ cd /boot/
$ mkinitrd -o /boot/initrd.img-2.6.16 2.6.16
$ vim grub/menu.lst
$ sudo reboot
Make took 70 minutes to compile the kernel on my Intel 2.1GHz setup. In the step before the last, I edited my menu.lst and pointed an entry in the direction of my new kernel:

Code:
title           Debian 3.1; kernel 2.6.16.
root            (hd0,1)
kernel          /boot/vmlinuz root=/dev/hda2 ro
initrd          /boot/initrd.img-2.6.16
savedefault
boot
I don't honestly know if becoming root all those times was necessary, but at least it always worked. Of course, I kept my old kernel; having it around is always a good idea.

And now, everything just worked, and I started hating myself for not having done this sooner. Now, I could see webpages through a graphical browser on Linux for the first time.

Step #5: Install Microsoft's TrueType fonts.

Out of the box, Linux comes with a, um, a less then vast collection of open source fonts. Adding the non-free repositories to my /etc/apt/sources.list and then

Code:
$ sudo apt-get install msttcorefonts
did the trick. Now, the webpages look how they intended to look.

Step #6: Getting a 1280 x 1024 resolution.

Being accustomed to 1280 x 1024 (I got a new LCD monitor last Christmas), working in a 1024 x 768 environment was...less then pleasant. I knew I wouldn't be able to stand that much longer.

After editing my XF86Config-4 without success a few times, it became apparent that X alone will not get me the high resolution I want. So, I decided to stop by NVIDIA's website to get the drivers for my video card.

Now, for whatever reason, NVIDIA likes to keep their their drivers closed-source (who writes closed-source software for Linux, anyways?) so problems are more common. Mine was that the kernel module wouldn't compile. Fortunately, NVIDIA released a patch (http://www.nvnews.net/vbulletin/showthread.php?t=62021) that solved the problem. The module compiled successfully. And now X finally...crashed beautifully!?

That's because it was having trouble loading GLX. Read on to see how I got that working. For now, a quick "dd" over the

Code:
Load "glx"
line (located in /etc/X11/XF86Config-4) in Vim solved the problem. (: No OpenGL support for now, though.

Step #7: Upgrade Fluxbox.

Apt's stable respositories gave me an archaic version of Fluxbox (0.1.14, I believe) that is barely still even supported. Upgrading seemed to be a good idea. Fluxbox.org had source I needed to compile the newer version, 0.9.15.

Rebooting left me with a minor - but annoying nonetheless - problem, no antialiasing. There is no way I'd be able to live with that. The Fluxbox developers want to use X to antialias the fonts now, it seems, after looking at their change log. No problem, but wasn't

Code:
Xft.antialias: true
in my ~/.Xresources supposed to be enough? Apparently not; XFT support in Fluxbox was disabled. Installing the XFT development package over apt and a recompile of Fluxbox did the trick.

Step #8: Deuglify X.

Fluxbox has beautiful styles for the edges of windows, titlebars and the toolbar. But because I haven't installed KDE/GNOME, X styled most of the interface itself, with...less then pleasant results.

GTK+ was the answer. Installing it seemed to be best way to skin the GUI. The problem was, without GNOME/KDE, there was no system utilites menu to select the skin from. That's where gtk-theme-switch comes in. I used

Code:
$ sudo apt-get install gtk-theme-switch
to get it. Now, switching between downloaded themes is as easy as typing "switch2" at the command prompt (and "switch" for themes that use version 1 of GTK+).

Step #9: Getting sound to work.

For all people trying to get sound to work, I offer this piece of advice: please, please compile the kernel with ALSA built in. I had nothing but problems trying to compile ALSA, and nothing but problems trying get it working after retrieving it with apt. It only worked after a kernel recompile. The recompile itself was simple; repeat every step after retriving the source code, and making sure to create a new initial ram disk (mkinitrd -o /boot/initrd.img-<version> <version>). In menuconfig, find your way over to the "Sound" section. Build ALSA in, and make sure to select support for your appropriate sound devices.

Okay, the applications will play music now, but still no output! This is because the ALSA developers decided to mute sound by default. That may be a good idea for reasons I know not of, but not for my case. No problem, all we need to do is obtain alsa-utils, to help us interface with the built-in ALSA. As per usual, I used apt. After that, listing to music is as simple as

Code:
$ sudo alsamixer
and unmuting the channels by pressing the <M> key. Now, we can adjust the volume for each by using the arrow keys. Next, I obtained amaroK and I was set.

Step #10: Printing.

Just like with the installation process, I've heard bad things with printing under Linux. Fortunately, getting it working was nowhere near as big of a hassle as I thought.

The first thing I needed to is get CUPS working. After compiling CUPS, a simple

Code:
$ sudo cupsd
started the CUPS daemon and made http://localhost:631/ available. Now, I had access to the CUPS interface.

All the computers in my residence are connected to a LAN network; with my printer directly connected. Therefore, getting it to work on a system involves installing the drivers for it and figuring out its location on the network.

I installed the drivers for my Brother printer and CUPS, and now CUPS had my printer available for management. The only thing my driver did wrong is think that it was directly connected to my PC. That wasn't the case. I needed to find the IP address of my printer and point CUPS in that direction. I was able to find that IP address by moving through the menus on the display screen attached to my all-in-one printer-fax-scanner-copier-and-whatever-else.

However, I wasn't done yet. I still needed to find the port. Nmap helped with that. By typing

Code:
$ nmap <ip_address_of_printer>
I got a list of all available ports on my printer. Seeing that port 9100 was open, I set "socket://<ip_address_of_printer>:9100" as the device URI (by using "Modify Printer" in CUPS) and tried to print a test page. It worked! I then used CUPS to set that printer as the default. Now, I can print out a text file simply using

Code:
$ lp <file_name_of_file_to_be_printed>
and of course, by selecting the "print" option in whichever GUI app I happen to be using.

Step #11: Getting the NVIDIA driver to support OpenGL and opening the testing repositories.

Getting GLX working wasn't as big of a hassle as I expected it to be. As always, it was a matter of searching for the answer.

In this case, the problem of OpenGL support was solved by accessing the testing repositories and using apt to retrieve the latest version of nvidia-glx. I readded the "Load "glx"" line in XF86Config-4 after retrieval of nvidia-glx, and to my surprise, X started flawlessly.

Step #12: Getting Xgl (not really...).

Seeing that I had finally enabled OpenGL support for my video drivers, I decided to look for ways to harness the power of my video card and OpenGL to create interesting special effects. At first, Xgl (www.novell.com/linux/xglrelease/) looked very impressive. Both true transparancy, and the cube effect looked very interesting.

But doing some research afterwards gave me other ideas. For one thing, it isn't very stable. It's also very hard on the graphics card, and its support in Fluxbox were other reasons why it didn't look good. As far as Xgl goes...I think I'll wait until its a bit more mature.

Step #13: Setting up a development environment (Java only).

Now that I was mostly up and running, I decided to give a shot at using Linux for what it was made for: programming. It immediately became apparent to me that developing on Linux would be much easier then Windows, even at my early stages. The power of the command line and the effiency of bash together with VIM are two major factors. The only problem was that gij isn't quite mature yet and gave me some minor problems. That was solved by installing Sun's version of Java.

---

And that's it! It's working now; and I can do nearly everything with Linux that I could Windows. Now that I know more about how Linux works, its benefits are becoming clearer. Again, this website was major source of help! Without it...I probably wouldn't be very far at all, if anywhere.
 
Old 04-06-2006, 12:23 AM   #2
bc8o8
Member
 
Registered: Jun 2003
Location: Boston, MA
Distribution: Debian
Posts: 57

Rep: Reputation: 15
Thumbs up

First of all -- Great tutorial!! This would have helped me out a WHOLE lot if it had existed when I started with Debian! Here are some additions/suggestions for the tutorial:
-----------------------------------------------------------------

For another way of connecting a Linux system to a Windows printer share, here is an excerpt from a great tutorial (http://excess.org/docs/linux_windows_printing.html )

Code:
3.2. CUPS Configuration

Once you have found a Windows printer you may configure CUPS. First verify that your installation of CUPS has the smb backend with the following command:

ls -l /usr/lib/cups/backend/smb

If this file does not exist create it by issuing the following:

ln -s `which smbspool` /usr/lib/cups/backend/smb

The following is an example of setting up the printer shown above. You will have to become root or use sudo to execute these commands:

/usr/sbin/lpadmin -p RicePrinter -v smb://fred:mypass@rice/INKJET -P /root/inkjet.ppd
/usr/bin/enable RicePrinter
/usr/sbin/accept RicePrinter
/usr/sbin/lpadmin -d RicePrinter

As mentioned above, bash has a builtin command called enable, so bash users must use the full path (/usr/bin/enable) to enable printers.

The "lpadmin" command sets up a the shared Windows printer by giving the username, password, netbios name and printer name as a single parameter. See Section 2.3 for a further explanation of the commands above.

Your printer is now ready to test. Send a file to the printer with the lp command followed by a filename, or by printing a document from within an application.
-----------------------------------------------------------------

If you're doing java development (or even C++ development now) you might want to check out Eclipse. I've looked for a long time for a good IDE and trust me, this one is good. The installation is simple and it really "just works"
http://www.eclipse.org/
-----------------------------------------------------------------

For modifying kernel module options (which from time to time you may have to do), just create/modify an appropriate file under /etc/modprobe.d/ to add your options. For example, to modify the ivtv driver parameters, you could create the file /etc/modprobe.d/ivtv and add the following lines:
Code:
alias char-major-81 videodev
alias char-major-81-0 ivtv
alias char-major-81-1 ivtv
options ivtv ivtv_std=1 tuner=57,57
and now each time the ivtv module is loaded, these parameters will get set.
 
Old 04-06-2006, 12:35 AM   #3
vmlinuz.gz
Member
 
Registered: Nov 2005
Posts: 123

Original Poster
Rep: Reputation: 15
Thank you, bc808, for the additions and the compliments. [:
 
Old 04-06-2006, 12:56 AM   #4
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Very nice job and deserves stickification!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
windows emulator for debian montijo_007 Debian 2 12-13-2004 11:52 AM
Printing To Windows In Debian Little Dump Linux - Newbie 1 09-19-2004 11:05 AM
No X-Windows in Debian tuxrules Linux - Newbie 4 09-01-2004 11:41 AM
Windows Emultion For Debian jeffthespasm Linux - Software 5 08-03-2004 11:36 AM
Windows XP to Debian 3.0 Surfer_Zombie Linux - Newbie 1 09-29-2003 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 09:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration