You've just done a fresh install of Mandriva and people are telling you that you need to add online sources and update your system and you have no idea what this means or where to start. This page will show you.

It is very important that you keep your Mandriva install updated on a regular basis. If you don't several things can happen. First is that the users on IRC who try to help you won't be able to do so properly. The reason is because you have old software. If you aren't running/using the latest version of a certain app it may be that this is the reason why it's not working or doing what you want and/or need. We're not saying that running the latest version is 100% for sure going to work, but it's the best place to start. Secondly, if you aren't updated and you're running older versions of apps like the linux kernel, openssh or very vital things such as these, you could have a system that has a hole, bug, exploit in it and can be used against you and/or other computers on the internet.

One of the first things we suggest you do is to remove all of your currently set sources as chances are you only have the CD's or DVD as your current media. To do so, you need to perform the following command as the root user:

urpmi.removemedia -a

The -a switch tells the command to remove all media that is currently specified. You can however remove individual media sources by using something similar to the following command:

urpmi.removemedia DVD

The above command should remove any media source that is labeled with DVD in the name. There are several ways to remove media sources. These are just two of the most common ways.

Once you have removed your currently specified media, then you need to open your webbrowser and visit Urpmi-Addmedia. This site is an online configuration tool for adding new online media sources to your Mandriva install. What this accomplishes is that it allows you to access several media sources which are kept updated on a very regular basis. It is highly suggested that you add a source for the following media: Main, Main Updates, Contrib and Contrib Updates. We also strongly recommend that you add a source for the PLF-Free and PLF-NonFree(you do not have to pay for this) media as this will allow you to get some very important packages such as codec files for viewing all sorts of video files. PLF also contains packages for playing and backing up your DVD's. Currently at this point and time we do not recommend adding any of the backports media. As you will see on Urpmi-Addmedia there are warnings in big/bold red letters stating why not to add these media sources. However, the choice is totally up to you and please take note that you have been warned about the possibilities that can happen.

Once you have added your media sources you can always list them by media name or by media URL. To do so, you can run the following commands:

urpmq --list-media

urpmq --list-url

The first one will list by media name and of course the second one will list by media URL. Both commands are very handy at various times.

If you have added your media sources and have verified with one of the two commands that those media sources that we stated should be added are definitely there it is now time to update your Mandriva install. This is actually a very simple task. The first update will usually always be the largest and if you continue to do this on a regular basis, the update will be relatively small and take very little time.

To update your system now that you have just added online media sources you need to perform the following command:

urpmi --auto-update --auto

The above command will update any packages that are currently installed with any new versions from the media sources that you set earlier. The additional --auto at the end of that command tells the system to answer all yes/no questions with a yes and proceed to the next step. If you would rather see an entire list of what is going to be installed before you say yes, then use the following command instead:

urpmi --auto-update

The above command will probably take a bit of time since this is your first time to update your system. Just let it run and let it do what it needs to do. When it's done it will return you to a bash prompt in your terminal where you can do whatever else you want to do afterwards. Also please keep in mind that you can run only ONE instance of urpmi at a time. This means you can't run one of the above commands and then go install other stuff using urpmi. This also means that you can't open or already have rpmdrake open while you do the above command(s).

Now, what you need to do is to make sure you do this on a regular basis. You could set the command up as a cronjob and then check your logs daily for what happened. I personally prefer not to do it like that. The command that you need to run atleast 2 - 3 times per week if not more is as follows:

urpmi --auto-update --auto

The urpmi.update -a part of the command will update the list of packages from a file on the URL's you defined earlier. It will update every source you added one by one until they are completely updated. The && part of the command means that once the first command is completed successfully, then proceed to the next part which we described above what it does. I recommend you do this atleast 2 - 3 times per week though personally I do it everyday.

I have written a script that gives plenty of output of what is going on and that will update your media sources and then your system for you automatically by simply typing the word 'updater'. Makes it easier to update your system every day because you don't have to remember several commands. Here is the page on this wiki that explains the script, how to set it up and use it: Mandriva Easy Updater Script. Just follow the directions on that page and if done properly, you should then be able to type the following command as root user to update your system whenever you want:

updater

It needs to be noted that none of the above will upgrade your kernel. There is something more you have to do to upgrade your kernel in Mandriva. The above will however upgrade your kernel-source package if you have it installed. What this means is that if you use Nvidia or ATI drivers that after the update and once you restart X or your system, you may not be able to boot into your window manager(KDE, GNome or whatever). You will need to either update your kernel to match the kernel-source or downgrade the kernel-source package to match your currently running kernel. To do that you need to follow this page: Getting Your Kernel-Source To Match Your Running Kernel.

It's that simple. It's also that important to keep an updated system as we stated above for several reasons. As you will see on the Urpmi-Addmedia page that there is quite a bit of useful information that should be read and possibly followed. Below is a list of important URL's you should read that are also listed on the above page:

Package Repositories Defined

2007 Media Source Information

Why Not To Compile Apps On An RPM Based Distro

Rpm How-To

RPM and URPM* Tools Defined

Upgrading Your Current KDE To A Newer Version

Using And Understanding Crontab/Cronjobs

Getting Your Kernel-Source To Match Your Running Kernel

Installing Nvidia Graphics Drivers From Nvidia.com