Linux-Tip News

We are proud to present the Linux-Tip Portal in a new design and hope you will find it helpful, whether you are new to Linux or a seasoned user. We will attempt to provide you with effective tips and tricks, or at least to point you in the direction of the help you may need. We would like to offer a great big "Thanks!" for their excellent work to Jommla!  and  to RocketTheme . Please enjoy Linux news and workshops. Feel free to send your comments and suggestions.

 
Home arrow Tips and Tricks arrow Linux Tricks arrow Trick: URPMI quick and easy
Trick: URPMI quick and easy Print E-mail
Monday, 27 November 2006

One of the best Mandriva specific tools is, without a doubt, urpmi. This tools allows a better and easier package management and helps to find a way out of the “dependency hell” that many inexperienced users complain about. This article gives you an overview of the most often used options and some tricks how to use it efficiently.

 


urpmi.addmedia

First of all we need an urpmi repository. The Mandriva Linux ftp mirrors should contain:
  • main which contains most programs.
  • contrib which contains optional programs.
  • update which is used for correcting security problems.

You will easily find a mirror and hdlists for the mentioned packages in the Internet, but the best way is to use web forms like this:

The following output was created by using easyurpmi. You just have to cut and paste the code into your console and run it:

urpmi.addmedia main ftp://mirror.pacific.net.au/MandrivaLinux/official/2007.0/i586/media/main/release with media_info/hdlist.cz
urpmi.addmedia contrib ftp://mirror.pacific.net.au/MandrivaLinux/official/2007.0/i586/media/contrib/release with media_info/hdlist.cz

urpmi.removemedia

If you want to get rid of a repository, this is the command you have to use:

urpmi.removemedia name_of_media

I also recommend using the following command before adding the sources. This will give you a nice and clean URPM setup

urpmi.removemedia -a 

urpmi.update

This command will update your sources and get the latest versions of your installed RPM's. I recommend doing this right after the Mandriva installation but also frequently using a cron job.

urpmi.update –a       will update „all“ media 

The most efficient way to stay your Mandriva installation updated is to integrate this command in a cron job. Make sure  to do this as root. Create a new file like this:

vi /etc/cron.daily/SoftwareUpdate

save the following lines in it:

#!/bin/bash
urpmi.update -a #update all your sources
urpmi urpmi #make sure you have the latest urpmi package
urpmi --auto --auto-select #update your box

and make it executable like this:

chmod 755 /etc/cron.daily/SoftwareUpdate


next you’ll find some other useful commands:

urpmi --keep --auto --auto-select

update all packages but don't remove anything, just tell what didn't work

urpmi --auto-select

figure out what needs to be updated and prompt for yes or no

urpmi

This is the main package management command, which you can use to install the packages. It will search the sources it has defined for the package you specified and will prompt you for any additional dependencies it needs. If you accept the dependencies it will download and install both the package supplied and it's dependencies automatically. You can install just one but also more packages at the same time like this:

urpmi fetchmail

urpmi wget bzip2 unzip zip nmap openssl lynx fileutils


urpme

This is the command that uninstalls packages. It works out the dependencies and tells you if any software that's still installed depends on what you want to uninstall. You will so get the chance to abort the procedure or to uninstall the package and those that depend on it. 

urpme fetchmail


urpmf

This command you can use to find any file that you may want. The following scenario happens very often if you compile software from source. The configure script complains about a missing file or library:

thelibfile.h missing

You can try to find the missing library by executing the following command:

urpmf thelibfile.h

 

urpmq

This command  allows you to query the rpm database. So you can find out information about the packages that you have installed. I always recommend using the option fuzzy. This will  not only return the package by default, but other packages which including the same name also.

urpmq packagename --fuzzy

packagename
packagename-static
packagename-static-devel



 
< Prev   Next >

Bookmark this article

Virus Info Feed

Alexa Traffic Stats


Urlaub Spanien