PDA

View Full Version : Linux in a Nutshell



.Maleficus.
06-30-2007, 11:31 AM
Linux in a Nutshell

Welcome to my Linux in a Nutshell. Here, I will hopefully teach you something you didn't already know about Linux, or convince you to maybe give it a spin for yourself. This is a modding forum after all, and with all the customization and tweaking you can do to the OS, it is the modder's OS ;). This will be split into a few different parts. Feel free to skip whatever you don't think you need.

Intro
What is Linux exactly? Well, Linux isn't actually an OS. Linux is the kernel used by many different OSs that "make" it Linux. Linux was developed by Linus Torvalds as open-source (or OSS - Open Source Software) meaning it can be tinkered with, tweak, and generally screwed with to your hearts desire. This is great for people wanting a fully customized system, or a system optimized for their specific hardware. There are a bounty of Linux "distros" (distributions) that you can choose from, the most popular being Ubuntu, Fedora, Gentoo, Mandriva, and openSuSE. There are others that have been popular for a while like Debian, and others that are also just gaining popularity like Arch that are also excellent choices.

Finding a Distro
Like I said above, there are many distros to choose from. It can be a little overwhelming at first deciding on what exactly you want the system to do, how you want it to look, etc. There is a great site called DistroWatch (http://www.distrowatch.com) that is a compilation for every Linux/UNIX distro out there with details on every one, and links to screenshots and download sites. You can browse the different distros if you'd like, but now I will also give my personal recommendations. I have worked most extensively with 3 distros, those being Ubuntu, Gentoo, and Fedora. Ubuntu is considered the "easiest" distro for people new to Linux, because most of the hard stuff (and fun stuff) is done for you. You can get away with not using the command line at all (the command line lets you do just about anything you want) and use it just how you would Windows. Gentoo is the exact opposite. Gentoo is installed all via command line, and after the install completes, you have a black screen with command prompt. You install everything else you want after, making this the best distro for a lightweight, or fully customized OS. It is considered Gentoo isn't for people new to Linux, but it's also a great way to learn and become familiar with Linux. Finally, Fedora is a lot like Ubuntu, meaning it's a very friendly distro, and has the most compatibility and software being developed by the Red Hat team.

Getting your distro
Getting your distro is pretty straight forward. Go to DistroWatch.com (http://www.distrowatch.com) and download it from there, or go to the homepage of it and download it from there. You'll download a .ISO image file that needs to be burned to either a CD or DVD as an image file. You will probably have an option to do this on your burning software, but they are all different. I use Deepburner, which as an option when starting to "Burn ISO Image" (or something like that). Choose that option on yours. Navigate to the image you saved to your drive, and start burning. It is recommended that you burn it at the lowest speed possible to avoid errors, but if you can't control the speed you'll usually be fine. Then, wait for it's done, grab the CD out of the drive, and label it :D.

Installing
This section will be split into 2 parts, Dual-booting and Normal Install. I will walk you through the dual-boot steps for Ubuntu, and the normal install for Fedora. But first, choosing what's best for you. Dual-booting will let you run both Windows and Linux from the same computer, and you choose the OS to boot when the PC starts. This is great if you're just trying it out, or have Windows apps that aren't on Linux. A normal install will just erase everything or install on a fresh hard drive. *Pleas note: You can only dual-boot if you have free, unpartitioned space on your hard drive. You can read about that here (http://www.webtechgeek.com/How-to-Partition-a-Hard-Drive-Windows-XP.htm), as I won't go into it.


Dual-Booting
For this, I assume you already have free, unpartitioned space on your hard drive. If not, do that first. I also assume you have your distro burned to a CD or DVD. Like I said earlier, I'll be using (X)Ubuntu for this.

Step 1. Pop in the CD into the drive and reboot. If it isn't already set to do this, change the boot order in your BIOS to CD, then Hard Drive, then whatever you want. Let it boot into the CD, which will either have a desktop environment or straight installer.

Step 1.5. If it has a DE (desktop environment) play around with it. See how it is. It will behave very slowly, because it's running from a CD, but try some stuff out. Return here when you're finished ;).


http://i98.photobucket.com/albums/l257/andypwnsall/desk.jpg
Xubuntu Desktop - Xfce 4.4

Step 2. Double click the Install icon. It will run through the installer. Pretty straight forward stuff, but I have included some pics as well.


http://i98.photobucket.com/albums/l257/andypwnsall/language.jpg
First page of installer

http://i98.photobucket.com/albums/l257/andypwnsall/namescreen.jpg
Naming your system

Step 3. We have now reached the partitioning stage. You have 2 options. Erase the entire disk, or partition yourself (what we will do). Click the circle and then Next.

Step 3a. We need to make a /boot partition. For this, click the gray space of your rectangle and then New. You'll be greeted with a new screen. Make the size of the partition 128MB, the filesystem ext2, and have it be a Primary partition.

http://i98.photobucket.com/albums/l257/andypwnsall/bootpartish.jpg
Creating /boot partition.

Step 3b. We now need a linux-swap partition. Follow the steps above, but this time with 512MB, linux-swap as the filesystem, and Primary for the type.

http://i98.photobucket.com/albums/l257/andypwnsall/swappartish.jpg
Creating linux-swap partition.

Step 3c. "/" partition time. / means root, where everything gets installed. Same as above, but make this the remainder of the space, ext3 as the filesystem, and Primary for the type.

http://i98.photobucket.com/albums/l257/andypwnsall/rootpartish.jpg
Creating / partition.

Step 4. Click Next, and have it Apply the Operations. Just let it do it's thing.

http://i98.photobucket.com/albums/l257/andypwnsall/operations.jpg
Applying Operations.

Step 5. Set the mountpoints. It will detect linux-swap and "/" for you, but you need to select the first partition you made and set it as /boot.

http://i98.photobucket.com/albums/l257/andypwnsall/mountpoints.jpg
Setting the mountpoints.

Step 6. Installation. Pretty easy here, click Install.

http://i98.photobucket.com/albums/l257/andypwnsall/install.jpg
Install time!

Now you're done! Let it do it's thing, reboot, and ta-da! You can now select either Ubuntu or Windows, and have a working dual-boot system! Yay!


Installing from Scratch
I just realized that there's really no need for me to go through another set of install instructions when they are basically the same. Please read Dual-Booting for install instructions. To install over everything though, either use a new disk or erase the one you are using during the partitioning stage.

.Maleficus.
06-30-2007, 03:34 PM
Choosing a DE
Choosing a DE (desktop enviroment) is really all preference. There are quite a few to choose from. The most popular here are Gnome, KDE, and Xfce. Like I said, picking one is all taste, so I recommend going to Gnome-Look.org (http://www.gnome-look.org), KDE-Look.org (http://www.kde-look.org), and Xfce-Look.org (http://www.xfce-look.org) to find some themes or screenshots you like. You can then base your distro choice by DE too. After that, you can customize even more with a differnt WM (window manager). There are a bunch to choose from, like Openbox, Blackbox, Evilwm, FVWM, and more. Google is a good place to find more about those, because installation will vary based on the DE you have.

Using the Command Line
The command line is what makes Linux special (and to some scary). Think of it as DOS on steroids. It's in the same format and looks pretty similar, so if you know something about DOS then you'll be fine with the command line. Here's a list of the most useful commands I've found.

su - su gives you total root access for as long as the terminal is open.
sudo - sudo gives you root access for one command, but can also be longer if you continually type commands after it.
cd - cd /directory/path will let you "jump" into the directory you specify.
gedit - gedit /path/to/file.conf will open the file you specify so you can edit it. *For Gnome only*
nautilus - nautilus /path/to/folder will open the folder that you specify. *For Gnome only*

Installing Packages
Package installation varies for each distro. Ubuntu uses Aptitude for installing packages, while Gentoo uses Portage and Fedora uses Yum. You'll have to research each installer on your own because it's too lengthy for this, but there is one way that all distros have in common, and that's installing from source. There are really 4 steps to installing from source (for most applications; some use different methods of installing from source, and if that's the case, consult the package README for instructions). The steps go like this:

cd /path/to/folder
./configure
make
make install
If there are no errors, then hooray! It's installed. If there are errors, consult the README again, or look through bug-reports or use Google to find a solution.

Multimedia
Linux ships with lack-luster multimedia support, but that's because it is free and open source, and it is some sort of copyright infringement. The easiest way I have found to get MP3 support and all that, is to use AmaroK and install the amarok-nonfree extras. To do this, open your terminal, and type:

sudo "apt-get install/yum install/emerge/whatever your packager uses" amarok amarok-extras-nonfree
Without the quotes. AmaroK is a superb music program, and with the amarok-extras-nonfree package, you get MP3 support as well.

Wireless Networking
For most, wireless networking under Linux is a pain. I myself have decided to give up on it all together and just hardwire myself to the modem, but that doesn't mean you have to. For those who want to still use their wireless cards, but aren't supported out-of-the-box, you need the tool ndiswrapper. ndiswrapper uses certain files from your Windows driver install disk and "wraps" them around the hardware in a way that Linux can recognize. To use ndiswrapper though, you must first install it, meaning you need some way to connect to the internet. For a short time you need to be wired, but there are a few ways of getting around that. For Ubuntu users, I believe you can use the install CD. But I'm not here to talk about that, so Google "ubuntu install cd as repository" to find out how. Back to ndiswrapper. You need to install a package called ndiswrapper and ndiswrapper-utils. You can use whatever means you like, whether it be command line or package manager. Once both of those are installed, it's time to break out the Windows disk.

1. Put it in your drive. You'll be able to open the drive, and you'll see all sorts of files. If you have certain disks, you may have drivers for a few different cards on the same disk. Look at your adapter, find the name (ex. "Linksys WUSB54Gv4") and navigate to the folder called that on your CD.

2. Now, you need to copy the contents of that folder onto a folder on your hard drive. Pick an easy spot to remember (ex. "/home/username/wireless"). When you copy that contents, there will be a few types of files. The important one is the .inf file (but copy the rest too). That's what ndiswrapper will use to "wrap" the driver. Plug in your adapter.

3. Open up your terminal and type this.

ndiswrapper - That will show you the interface and familiarize you with ndiswrapper (not necessary)
ndiswrapper -i /path/to/file.inf - This command actually installs the driver. -i means install, and the path to the .inf file is, well, the path to the .inf file.
ndiswrapper -l - This will list the installed driver (if it installed) and list the hardware. Hopefully it will say "Present" for the hardware.
depmod -a - If there is no error, continue.
modprobe ndiswrapper
Hopefully that will get you up and running. After completing these steps, you should be able to use the internet. If not, then, I wish I could help more, but that's all I know.

Nvidia 3D driver
3D drivers under Linux can be a pain sometimes. Nvidia is the best at making this easy, but it's still not a walk in the park. Here's how to do it (may vary from system to system):

1. Download the latest driver from the Nvidia website.

2. Log in with no GUI. There are several ways to do this:
a. CTRL-ALT-F1 (sometimes F2-F6). Log in as root, and type "init 3".
b. Type "3" at GRUB boot prompt.

3. Log in as root if you haven't already.

4. Run the driver you just downloaded. ex:

sh driver-1.2.04.run

5. Edit your /etc/X11/xorg.conf file. Under devices, you should see the name of your card and then "nv" as the driver. Change "nv" to "nvidia".

6. Log out, restart X, and if you see the Nvidia splash screen, you know it worked.


Also, I think I'll be done for now. There are a few things I could add, and I will later, but for now it's pretty much done. If you have any suggestions for things to add, PM and I will add.

XcOM
07-01-2007, 07:38 AM
very well covered my friend, i tink you near enough covered all the bases there.

+Rep

Moofaa
07-24-2007, 10:11 AM
So...on a new rig, with brand new HD, what do you install first? Ubuntu or Vista?

.Maleficus.
07-24-2007, 01:49 PM
So...on a new rig, with brand new HD, what do you install first? Ubuntu or Vista?
You'd want to install Vista first, leaving space on the hard drive for Ubuntu. If it were me, and I had say, a 250GB hard drive, I'd do 200GB Vista and the remaining for Ubuntu. I'd say for most people, even that is overkill. You'll want the extra space on the Vista install, because you won't be installing 5GB+ games on Ubuntu. You can go ahead and choose the space you need, but make sure when you install Vista you don't install it over the entire hard drive. Keep some raw space for Ubuntu. Then, once that is done, pop in the Ubuntu CD and follow my instructions. Hope that helps!