computer tutorial 


SPIFFING UP UBUNTU 6.06

Ubuntu is a brilliant Linux distribution, and the latest release (Ubuntu 6.06 TLS, codename Dapper Drake) came out almost a month ago - on 1st June. It was an immediate success, following in the footsteps of its celebrated predecessor. But, Ubuntu being Ubuntu, there are several key things missing. A desktop Operating System should be able to do what every home user and office user wants - word and spreadsheet processing, email, web browsing, playing music and DVDs, etc. However, with a default Ubuntu install you can't listen to MP3s, you can't watch your new DVD copy of Chicken Little, and you can't even test out those spankingly marvellous graphics effects offered by XGL! Sometimes your graphics card will not be supported (especially ATi ones), and so you won't be running Ubuntu with your screen's native resolution. Well, all of this can soon be fixed. Let me show you how.


Update Ubuntu

The first thing you should do when you have a working internet connection is to update Ubuntu. In the top right corner of your screen, there should be a small popup asking you to update (see Figure 1). If you are not sure how to get your internet connection working, and you connect to either an ethernet network (via a cable) or a wireless one, then I will give you a hint: you can do it all from the System -> Administration -> Networking panel. I will not go into too much depth here, as the Network Manager panel is quite self-explanatory, and very intuitive.


UPDATETHUMB

Figure 1: Update Ubuntu


Getting Your Graphics Drivers Working

In this day and age, many of us have AGP or PCI-E graphics cards - and the most popular GPU manufacturers are ATi and NVidia. The chances are that your computer will have a graphics card which is based on hardware from one of these two companies - and it usually requires a bit of extra work to set up properly. Integrated graphics (what lower end laptops and desktops tend to have) do not require any fiddling with settings most of the time, as Ubuntu tends to configure them automatically.

I have an ATi card - namely an ATi Mobility Radeon X700XL in my Advent laptop - so I will begin by explaining how to set up the proprietary ATi driver. Please go to the section with the instructions for your graphics card.

- ATi cards

First, open a terminal window. This can be accomplished by either clicking on the Applications menu, and going to Accessories -> Terminal, or by pressing Alt+F2, typing 'xterm' and hitting Enter. Either way, you should now have a terminal window. Make sure you have a working internet connection, and, if you do, enter the following commands:

$ sudo apt-get update
$ sudo apt-get install linux-restricted-modules-$(uname -r)
$ sudo apt-get install xorg-driver-fglrx
$ sudo aticonfig --initial
$ sudo aticonfig –overlay-type=Xv


You have just installed the proprietary ATi driver (fglrx), and have configured it to work with your system. Reboot the computer (or, alternatively, hit Ctrl+Alt+Backspace to restart your Graphical User Interface), and login as usual – you should notice a difference in the quality and resolution of your screen. Just to be sure, open a terminal window and enter the following command (I have included its output on my laptop as a reference):

$ fglrxinfo
display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: MOBILITY RADEON X700 SE Generic
OpenGL version string: 2.0.5814 (8.25.1Cool


If the output of that command is something like the above (involving ATi and Radeon), then you're good to go! Please continue to the next step – Getting Automated. However, if that command's output is something else (like VESA), then it hasn't worked, and you will need to try some other steps to get it working. Do the following:

Press Alt+F2, enter the following command, and hit Enter (you will probably be prompted for a password again): sudo gedit /etc/X11/xorg.conf

The graphical text editor gedit will start up, and will have opened your xorg configuration file – in summary, this is where all the information to make your graphics work on Linux is set.

Scroll down to the Section "Screen", and change the Identifier line to:

Identifier "aticonfig-Screen[0]"

Scroll down slightly further until you reach the Section "Device" - there may be more than one Section "Device", so you will need to do this for all of them. You will need to change the driver line to:

Driver "fglrx"

Now, reboot, and login. The driver should now be working. If it still isn't, a great place to ask is <a href=”http://linuxquestions.org”>LinuxQuestions.org</a>.


- NVidia cards

If you have already done the ATi section (because you have an ATi card), then please skip this and move on to the Getting Automated section below.

So, you have an NVidia card. Let's get started. To begin, you will need to enable the Restricted repository, because that is where the NVidia driver is kept. To do this, follow these steps:

1. Go to the System menu at the top left of your screen;
2. Go to Administration, and then Synaptic Package Manager; you may need to enter your password;
3. Click on Settings and then Repositories;
4. In the window that pops up, click Add, and make sure the 'Restricted copyright' box is ticked; if it isn't, tick it, and hit Add;
5. Close the Repositories window, and hit 'Yes' when Synaptic asks you to reload the repositories database;
6. Quit Synaptic.

Great - now we're ready to install the NVidia driver. But, before we do that, we need to determine which driver you need. Assuming you know which card you have, look for it on this page - if it is at the end of the list, among the "legacy GPUs", then you will need the legacy driver. If it is not in the list of legacy GPUs, then you will need the standard driver.

Now that you know which driver you need, let's install it. Open up a terminal window, either by clicking on the Applications menu, and going to Accessories -> Terminal, or by pressing Alt+F2, typing 'xterm' and hitting Enter. You should now have a terminal window. Enter the following command:

$ sudo apt-get update

Stay in the terminal window. If you have a current GPU, then enter the following command:

$ sudo apt-get install nvidia-glx

However, if you have a legacy GPU, enter this command (make sure you don't enter both!):

$ sudo apt-get install nvidia-glx-legacy

Now, irrespective of your NVidia GPU, finish with the following commands:

$ sudo apt-get install linux-restricted-modules-$(uname -r)
$ sudo nvidia-glx-config enable


Close the terminal window, and reboot. If you see an NVidia logo, that means the driver has been correctly installed.

If you want to remove this logo before the login screen (it will come up every time you start your computer), then please continue reading here. If not, skip to the Getting Automated section.

Now, press Alt+F2, and enter the following command (you may need to enter your password): sudo gedit /etc/X11/xorg.conf
The text editor gedit will open the xorg configuration file. Scroll down until you see the line 'Driver "nvidia"', and enter the following line just after it:

Option "NoLogo"

Save the file, and quit gedit. Now, either reboot or press Ctrl+Atl+Backspace. The logo should not appear before the login screen. If it does, and you hit Ctrl+Alt+Backspace instead of rebooting.. Reboot Wink


Getting Automated

Now that we (hopefully) have our graphics driver correctly installed and configured, it's time to turn Ubuntu into a home-usable distro. Some of you may not want to violate your new Ubuntu installation in such a way - but, as I like to listen to MP3s, play DVDs, read PDF files with Adobe Reader, use Skype for Voice-Over-IP, have another browser to play with (Opera), and not have to do this all myself, I get Automatix to do it for me! Don't worry if I have mentioned a few things you do not want - you will be able to customise your installation choices within Automatix.

Open a terminal window. Now, enter the following command:

$ sudo gedit /etc/apt/sources.list

gedit will open the file sources.list - this is a list of the repositories you are using. Scroll to the very bottom, and press Enter to go to a new line. Then, add the following line:

deb http://www.beerorkid.com/automatix/apt dapper main

Close gedit, and return to the terminal window. Enter the following commands:

$ wget http://www.beerorkid.com/automatix/apt/key.gpg.asc
$ gpg --import key.gpg.asc
$ gpg --export --armor 521A9C7C | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install automatix


That should all have worked flawlessly. When automatix has been installed, run the following command to start it:

$ automatix

You should see a window like the one in Figure 2 appear. Nod your head out of respect to its excellent programmers, and click "OK".

AUTOMATIC 


Figure 2: Contributors

You should then see a window like the one in Figure 3. This will warn you that installing some of the video and DVD codecs is illegal in the US, and that it's all your fault if you do that while in that country. Of course, you wouldn't even dream of installing those if you live in the US - so make a mental note of it (as you normally do with anything like this) and hit "OK".

AUTO2

Figure 3: Multimedia and DVD codecs warning

After this, you will see yet another popup, informing you of what to do if you decide to install Wine. If you are going to install Wine using Automatix, write this information down (or take a screenshot), to remind yourself what to do later. Figure 4 shows this.

AUTO3

Figure 4: Wine and 'winecfg' notice

We finally arrive at the main Automatix window. Take a good look at all the available packages, and tick the boxes next to any you want to install. I have selected a few packages in Figure 5. Click "OK" once you're satisfied with your selection.

AUTO4


Figure 5: Selecting the packages to install

Automatix will most probably ask you your password during the installation, and possibly more than once - enter it as requested. When the packages have finished installing, Automatix will give you the option of either keeping the repositories it has added, or removing them and going to what you had before - I am accustomed to hitting 'Cancel', which leaves the repositories Automatix has added, as it will give you a greater selection of packages to install in the future. It is nothing to worry about.

Once that's done, quit Automatix. You don't need to reboot - all your newly installed applications are already available from the Applications menu! If you want to install any other applications (for example, the game 'neverball'), go to the System menu, then Administration, and then Synaptic Package Manager. There, check all the packages you would like to install, and then install them - Synaptic will do all the work for you.



Turning Up The Graphics

XGL was created by Novell and a few Open Source developers (however small a part they had in its coding). Wikipedia has a fairly extensive article on XGL, which should prove informative enough. So, what is so amazing about this 'XGL'? Well, I am not one to sing its praises, as I have only been using it for about 24 hours - but, one thing I can say is that I love it. It improves usability, makes work a lot more enjoyable (if a little distracting!), and lessens the need for the use of the mouse. That latter point is the one that interested me most.

No screenshots or videos can do XGL justice - so, if you have a 3D accelerated card (if your computer is a few years old, or less, you should be fine), then you can try it out for yourself! Another reason XGL is so great is that it can run on slow computers, and still perform just as well as on a powerful PC - I'm almost certain Vista will not be able to do that!

Enough blabbering - I know your itching to install it! Let's get this over and done with. Open a terminal (you should know how to do this by now), and enter the following commands:

$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo gedit /etc/apt/sources.list


A gedit window should appear, with the sources.list file open. Go to the bottom, hit Enter to go to a new line, and add the following three lines to the ever-growing list:

deb http://www.beerorkid.com/compiz/ dapper main
deb http://xgl.compiz.info/ dapper main
deb-src http://xgl.compiz.info/ dapper main


Save the file, quit gedit, and return to the terminal. Enter the following commands:

$ wget http://www.beerorkid.com/compiz/quinn.key.asc -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install compiz xserver-xgl libgl1-mesa xserver-xorg libglitz-glx1 compiz-gnome


NOTE wrote:
NOTE: After entering that last command, you may receive an error similar to the following: "/var/cache/apt/archives/xserver-xgl_7.0.0-0ubuntu15_i386.deb: trying to overwrite `/usr/share/man/man1/Xserver.1x.gz', which is also in package xserver-xorg-core". If, and only if, that error has appeared, type the following command:

$ sudo dpkg-divert --package xserver-xorg-core --divert /usr/share/man/man1/Xserver.1x.gz.xgl --rename /usr/share/man/man1/Xserver.1x.gz
If you had to enter this last command (sudo dpkg-divert...), then go back and type the command that produced the error in the first place (sudo apt-get install compiz...) - it should not produce an error this time.



Now that we have the XGL and Compiz packages installed, let's do the dirty work to set everything up. Still in the terminal window, enter the following command:

$ sudo gedit /usr/bin/startxgl.sh

gedit will open. In that empty file, add the following code:

Xgl -fullscreen :1 -ac -accel glx:pbuffer -accel xv:pbuffer & sleep 2 && DISPLAY=:1
# Start GNOME
exec gnome-session


Save the file, and quit gedit. Return to the terminal, and run the following command to make the script executable:

$ sudo chmod 755 /usr/bin/startxgl.sh

Now that we've finished making XGL's startup script, let's make Compiz's. Enter the following command into terminal:

$ sudo gedit /usr/bin/startcompiz

gedit will open once again. Into the empty file, add this code:

#!/bin/sh
killall gnome-window-decorator
wait

gnome-window-decorator &
compiz --replace gconf &


Save and quit gedit. Return to the terminal, and let's make this script executable as well:

$ sudo chmod 755 /usr/bin/startcompiz

The Compiz startup script has now been finished. But wait, there's still more.. You do want to try out XGL, right? Good. In that case, enter the following line into terminal:

$ sudo gedit /usr/share/xsessions/xgl.desktop

And add this code into the file:

[Desktop Entry]
Encoding=UTF-8
Name=XGl
Exec=/usr/bin/startxgl.sh
Icon=
Type=Application



Excellent! Almost all the command line work is done. Feel free to wipe that sweat off your forehead! However, we still aren't finished. There's a tad more to do before you can test out this eye candy goodness! And notice that I said 'almost' finished with our beloved terminal.. Wink

Go to the System menu, and then to Preferences -> Sessions. When the Sessions window opens, select the Startup Programs tab, and click the Add button. As the 'startup command', enter: /usr/bin/startcompiz
Once you have added it, close the Sessions window, and return to the terminal window. If you accidentally closed it, no problem - just open another one. Once you're there, run the following two commands:

$ sudo apt-get update
$ sudo apt-get dist-upgrade


When that last command has finished, reboot. We're almost there!

When you have booted back into Ubuntu, you will eventually reach the login page. But, before you type in your login details, move your mouse to the bottom left corner of the screen and click on Options. Then, click on 'Select Session...', and choose 'XGl'. Press "OK". Then, log in as usual, and choose just to try this session once - you want to make sure that XGL works before setting it as your default session. If it does work, make sure you change your session again next time you restart, and hit the option to make it your default session! If it doesn't work, then either you made a mistake somewhere along the line while following this tut (and I cannot possibly know where), 3D acceleration is not enabled on your graphics card, or your graphics card doesn't support 3D acceleration full stop. There are also several other reasons, but those three seem to be the main ones.

Now that you have XGL working (if you do), there are some helpful shortcuts you should know get to know off by heart:

Quote:
o Switch windows = Alt+Tab
o Arrange and view all windows = Moving the pointer to the top right screen corner turns on or off; clicking a window will zoom it to the front
o Switch desktops on cube = Ctrl+Alt+Left/Right Arrow (or moving your mouse to the edge of your screen and rolling your mouse wheel)
o Switch desktops on cube with the active window following = Ctrl+Shift+Alt+Left/Right Arrow
o Rotate cube manually = Ctrl+Alt+Left-click and grab an empty desktop space.
o Make window translucent/opaque = Either with the "transset" utility or Alt+Mouse wheel (or right clicking on a window's title bar, and selecting the settings from 'Appearance')
o Zoom in once = Super-key+Right-click
o Zoom in manually = Super-key+Mouse wheel up
o Zoom out manually = Super-key+Mouse wheel down
o Move window = Alt+Left-click
o Snap move window (will stick to borders) = Ctrl+Shift+Left-click
o Resize window = Alt+Right-click
o Bring up the window below the top window = Alt+Middle-click
o Slow-motion = Shift+F10
o Water = Hold Ctrl+Super key, and move mouse
o Rain = Shift-F9

Note: The default Super key is the "Windows key" on most keyboards.




A short note about Compiz: at the moment, there is a small problem with it and GNOME. This is that, when you press Shift+Backspace, Compiz crashes. There is a temporary fix for this, which can be found as the last link in the references list below.

Thank you for reading this tutorial, and feel free to let me know if you have encountered a problem along the way! If not, enjoy! Very Happy





References and further information:

ATi cards and NVidia cards on Ubuntu
XGL and Compiz for 32 bit GNOME HowTo
Shift+Backspace crashes Compiz/XGL (temporary fix)






Original Tutorial by J_K9 for TheTAZZone-TAZForum

Originally posted on July 1st, 2006 here

Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post...we do not sell, publish, transmit, or have the right to give permission for such...TheTAZZone merely retains the right to use, retain, and publish submitted work within it's Network.