« latest dia - installation issue on windows | Main | Create a Virtual Machine for Windows XP on Ubuntu in five minutes »

August 11, 2006

Installing and updating applications in Linux (Ubuntu)

'The Linux Newbie' has a good post about how to pick a Linux distro.

It recommends visiting Zegenie Studios Linux Distribution Center list of questions, which is well put together and easy to use. It gave me a number of suggestions, top of which was Mandriva (formerly Mandrake) and the last of five was Kubuntu, the distro I actually went with in the end.

Linux Newbie went with Kubuntu also. I would have tried Ubuntu but I just don't like Gnome as a desktop, I find KDE to be more configurable and a better fit for me.

One thing that Linux Newbie had an issue with was installing packages. He went to great lengths describing downloading tarred packages, finding dependencies etc. Yes, that sometimes happens and it was one of the issues I used to have with Linux.

Apart from very few applications so far I have found Kubuntu's built-in package (application) management software excellent. It obviates the need to manually satisfy dependencies and the like.

You can run it through a graphical interface called Adept, or through the command line using apt-get.

The one thing you have to look out for is making sure that the sources for repositories of applications are up to date, which can be a little confusing and trying but once you have that set up all should be golden.

If you have been having issues installing applications you can try the following.

Open a command/terminal window. Type sudo su which will switch you to run as root. You will be prompted for the password that you supplied at installation. Once you are root type vi /etc/apt/sources.list. This will allow you to start editing the file that lists the sources of repositories from where you can install your applications.

Scroll down through the file using your cursor keys. You should see some lines resembling:

deb http://ie.archive.ubuntu.com/ubuntu/ dapper main restricted

if any lines that resemble this have a hash sign '#' in front of them, that means they are commented out. This can happen when you are installing if you have no network connection or if the installation couldnt setup the network card/tcp-ip setting correctly. The installation will check to see if it can connect to all the repositories listed and if it can't then it comments out all the entries that are unavailable, which makes sense when installilng but causes issues when you have installed and are looking to get the latest version of OpenOffice or whatever.

So, if you find a line that is commented out you will have to edit it. This is a little tricky, but stick with me. First of all move the cursor to the start of the line that is commented out. Hit 'i' to start editing the file (inserting in vi speak). Stuff like end/home pg up/pg dn may or may not work, so better just to stick to using the standard left/right/up/down cursor keys. Delete the # from the start of the line. When you have done that you will want to check the rest of the file for more commented out lines. HIt the escape (Esc) key to stop editing - this won't exit the file, just stop allowing you to type characters into the file. Find and repeat the process until you have removed all the hashes from the start of any of the lines starting with 'deb'. There are other commented lines in there but they are mainly notes regarding the meat and potatoes and they should have two hashes ## before them any way - ignore them.

When you are happy with your changes and you have hit Esc to stop editing (inserting) it is time to save the file.

Hit Esc again, this will put vi into a state where it wil accept commands. Next type the characters between the single quotes - ' :wq! '. This basically tells vi to save and exit.

By the way if you get yourself into trouble while editing (easy enough to do with vi), don't panic. Just bring yourself to command enter mode by hitting Esc a couple of times and enter ' :q! ' which will tell vi just to quit. Then start editing the file again by typeing vi /etc/apt/sources.list. If you keep getting yourself into trouble then you might try editing one line at a time, then saving and quit before re-opening the file and editing the next line.

Assuming you have completed editing all the commented lines you will next have to tell apt-get to update its locally held list of applications and their versions.

Type apt-get update.

Stuff will happen for a while - let it finish, it will only take a short while. If you are asked anything it is fine to just type Y to say yes, continue, whatever it takes.

Once that is done, you are best running Adept. This is found under the KDE equivalent of the 'Start' button, found in the lower left of the window on the taskbar. Find the system menu, click on 'Adept'. It will ask you for your password and then display lists of applications that you can install. Play with a while and you will soon see it is quite easy to use.

I prefer to use the command line for most things. In the example that Linux Newbie gave installing or updating OpenOffice is simple:

apt-get install openoffice.org

Stuff will happen and when it is done you can be sure that you have the latest, stable version of Open Office on your machine. Compare that with windows - open your browser, navigate to OpenOffice.org, find the download page, go through the screens to get to your download, download it, find it on your drive, double-click, yadda yadda....

I think you can see that apt-get is a much easier solution all round :)

As an extra bonus you can do the following

apt-get upgrade

Which will check ALL your installed applications and OS components etc. and update the whole lot automatically while you go off and get a cup of tea.

Posted by dottie at August 11, 2006 12:56 AM

Trackback Pings

TrackBack URL for this entry:
http://www.5thpercentile.com/blog/mt-tb.cgi/1

Comments

Post a comment




Remember Me?

(you may use HTML tags for style)