Quickstart Guide to Installing Software on Linux
- How is installing software on Linux different from doing so on Windows?
- What's the best way to install software in Linux?
- I can't find a certain program? Or some software refuses to install?
- Commonly used URPMI Repositories
- Installing Individual RPM files?
- I can't find a Mandriva RPM for a particular program?
- How do I get updates? What about automatic updates?
How is installing software on Linux different from doing so on Windows?
When you want to install a program in Windows you would usually go to its website (or a download site such as download.com) and download it as a self-installing executable file ie. a setup.exe type of file. When run this program would take you through a series of steps (agree to licence agreement, select which folder to install in etc.) and eventually installs the programs files in the correct folders and automatically does anything else (such as configuring registry entries) that the program requires.
Unfortunately due to the huge number of Linux distributions out there and the sometimes significant differences between them most software which runs on Linux will be released only in source code form on its maker's website, you can typically pick this if the file you try to download has the extension .tar.gz. Although for some software compiling from source is extremely simple it is not something you'll want to try and do for every bit of software, especially since if you did so you would lose the tweaking that distribution maintainers such as Mandriva do to each package to make sure it works smoothly with all the other software in their distribution.
Mandriva uses RPM (RedHat Package Manager) to package up software into a nice easy to install format. An RPM package is similar to a Windows installer in that it bundles up all the program files and an install script into a single file. Unlike a Windows installer an RPM is not a program that you can run. Instead RPM packages rely on a program called, funnily enough, 'rpm' to look at the contents of the RPM and install it. This rpm program is always installed by default on Mandrivalinux.
However because software is often dependent on other software already being installed many RPMs will have 'dependencies'. This means that they will refuse to install unless your system already has a particular RPM package already installed. In turn these pieces of software may have their own dependencies which need to be installed and so on until you get a sitution known as "RPM Hell", similar to "DLL Hell" on windows.
To solve this problem, and to manage the huge numbers of packages making up a modern Linux distribution, most distributions have a system that organises packages into 'repositories' and uses those repositories to automatically resolve dependencies, Mandrivalinux uses a system called urpm (also called urpmi). Basically a repository is just a directory with lots of RPM files in it and a few index files which urpmi will create. A repository can be located on your hard drive, on one or more CDs or DVDs, or on an internet site available via HTTP or FTP.
What's the best way to install software in Linux?
To install software using urpmi you can use either the command line or the Mandriva Control Centre. To use the Mandriva Control Centre to install software open it (in 10.1 its under System->Configuration->Configure Your Computer on the menu) click the 'Software Management' tab on the left hand side and chose to either remove, install or update software. These programs should all be self-explanatory but if necessary the other part of this guide has good documentation on them: Basics Index
If you want to use urpmi from the command line see Basics Brpm3
I can't find a certain program? Or some software refuses to install?
A lot of Mandriva users will be using 'Download Edition' or 'Discovery' versions of Mandrivalinux. Becuase these versions consist of only 3 or 4 CDs most users aren't aware that the full 'Powerpack' version of Mandrivalinux consists of 6 or more CDs Or a full DVD worth of software. On top of this there are even more repositories of software such as contrib, jpackage, plf and more (see below for an explanation of each one). In fact for Mandriva 10.1 Official these repositories combined with the main software repository on the Powerpack DVD contained 9831 unique pieces of software, far more than the 1500-2000 that would fit on a 3 CD Discovery edition set.
The point of all this is that in most cases there's no need to search the internet for software for Mandrivalinux its all in the repositories and its all available for free to anyone. To set this up browse to http://easyurpmi.zarb.org/ and follow the steps to generate the a script of the necessary commands. Once you've done this you can open a terminal window (System->Terminals->Konsole on the menus) type 'su' (without the quotes) into the command window that appears, enter your root password and then copy and paste in the script produced for you by the easyurpmi website.
Commonly used URPMI Repositories
There's no harm in having all these repositories configured so you may as well just go to the easyurpmi website (as described in the section above) and get them all.
main This is the repository that contains all the software packages for the actual core Mandrivalinux distribution. Generally you will get all of this repository on your CDs or DVD if you have Powerpack edition, otherwise a 3 or 4CD Discovery or Download Edition set will contain a subset of the most important packages in this repository. If you already have the Powerpack edition installed don't bother setting this repository up again (it'll just waste your internet bandwidth downloading stuff you already have on the CDs or DVD) but otherwise this is a must-have. The important thing about this repository is that Mandriva is committed to providing security and bugfix updates to packages in it.
updates Contains updated packages from those in main. The 'Updates' program in the Mandriva Control Centre looks here to get updates.
Contrib Contains programs packaged by members of the open source community for Mandriva. While these packages aren't supported by Mandriva in terms of security or bugfix updates the sheer number of packages (over 5000 in Mandriva 10.1) make this a must-have repository.
PLF (free and non-free repositories) Unfortunately due to insane legal issues in some countries there are some very useful programs that Mandriva prefers not to distribute. The PLF (Penguin Liberation Front * see their website (http://plf.zarb.org/) for an explanation :)) is an independent project that packages such programs.
JPackage Independant project that packages some programs written in Java for various Linux distributions, including Mandriva. Definately useful at times.
Installing Individual RPM files?
If you have RPM files lying around on your hard drive (ie. not part of any repository) that you want to install the simplest way is to just double-click on them.
This may not work if one of the files depends on another that is not in a repository. In this case you could either put them together in a directory and define that directory as a repository in the 'Media Manager' in the Mandriva Control Centre or you can install them simply from the command line. For Example:
su <type root password when prompted> cd directorywhererpmsare urpmi rpmfile1.mdk.i586.rpm rpmfile2.mdk.i586.rpm
Note that you can press the tab key to get the command line to "guess" the names of the files or directories you are trying to type out.
I can't find a Mandriva RPM for a particular program?
Unfortunately there may be some programs that you can't find a Mandriva RPM for. In this case you should look for an RPM on the projects web site or try using an RPM from a similar distribution to Mandriva (Redhat's Fedora Core 2 or 3 or above are quite similar). You should also look for anything on the project's website about an installer or a 'Binary release', since a 'Binary Release' or 'Binary Download' usually means a pre-compiled version of the software (ie. not the source code which you have to compile yourself).
If its a program written in a scripting language such as perl, python or php then no compilation is required and its usually fairly easy to get it installed even if there's no RPM for it.
Some notable projects which make it easy to download and install their software if you don't have an RPM are Mozilla (http://www.mozilla.org), OpenOffice.org (http://www.openoffice.org) and Limewire (http://www.limewire.com). For example, as of Mandriva 10.1 the Limewire RPM in the JPackage repository is extremely out of date and it is actually better to go to limewire.com and install the RPM file from there, even though its not specifically targetted at Mandriva.
How do I get updates? What about automatic updates?
You can retrieve updates (both security updates and bug fix updates) by running the 'Updates' program in the Software Management section of the Mandriva Control Centre. This should be pretty self-explanatory but further documentation is available from Basics Index
Although currently (as of 10.1) there's no option in the Updates GUI program to setup automatic updates its very easily done. Simply copy and paste the following lines into a text file and save it in the folder /etc/cron.daily. Since this must be done as root the easiest way would be to click 'Run Command..' on the menu and enter the command 'kdesu kwrite' (no quotes). After it prompts you for the root password you should have kwrite (a text editor similar to notepad) running as root. You can now copy and paste these lines into kwrite and save the file in that directory (call it whatever you want).
#!/bin/bash urpmi.update update_source urpmi ––auto ––update ––auto-select
After you've done this click File->Open in kwrite (the one you started as root), navigate to /etc/cron.daily again, right click on the file you just saved and select properties, click the permissions tab and check the 'Is executable' check box.
The updates script by default will run at 4:02am every night. If you're computer isn't usually on at this time you can edit the file /etc/crontab (again using your kwrite program that you started as root) and change 2nd number (ie. the '4') in the following line to whatever time of day you want (its in 24 hour time, ie. 22 would be 10pm):
02 4 * * * root nice -n 19 run-parts /etc/cron.daily
Note: The updates retreived will only be for packages in the main repository. Generally the other repositories will only be updated between Mandriva releases (this is true for contrib and PLF as far as I know). Although this may seem a bit problematic its really no different than the way the Windows world works where millions of 3rd party programs have no unified update method many have no built-in facility for downloading updates short of going back to their maker's websites and downloading updates. At the end of the day due to the sheer number of packages in the main repository you'd be unlikely to need to use software from one of the other repositories in mission-critical or internet-facing services. Certainly if you're a home user you probably don't need to worry about any of this all the security or stability critical software components you're likely to use will be in the main repository and subject to updates.
Version 1.6 last modified by imr on 27/09/2006 at 20:00
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!