Skip to content

Home > GNU/Linux > Your own local repository for Mandriva

Your own local repository for Mandriva

How to use the downloaded iso image for a faster access to your media

Wednesday 25 August 2010, by Stéphane Téletchéa

Nowadays, RPMs are mostly downloaded from internet. Since accessing RPMs from the hard drive is still faster, we will see in this little article some tips and tricks to use a local repository on your system, either using an entire mirror of the distribution or using the DVD edition as a local source.

Setting up your own mirror

The easiest way is to use rsync to keep your local mirror up-to-date, for instance to grab the entire tree for the 2010 Spring release under the i586 architecture:

su -
mkdir /var/ftp
exit (no need to be super-user for the command hereafter)
rsync -rav --delete-after rsync:// /var/ftp

The initial download time will depend of your internet connection (beware, if you have a bandwith constraint, this command will download around 25 GB of data...).

If you use the mirror seldomly you can issue the command manually, otherwise you can put it in a cron task (see

Using the DVD as an additionnal media

The iso image is lying on your hard disk, waisting space. A good way of using it is to mount it as a loop:

su -
mount -o loop /path/to/mandriva-linux-free-2010-spring-i586.iso /var/ftp

Do not forget to change /path/to/ for the real pathway to the iso file.

If you wish to do it permanently, add this entry to the /etc/fstab file:

/path/to/mandriva-linux-free-2010.1-i586.iso /var/ftp iso9660 ro,loop=/dev/loop0 0 0

Adding the mirror/iso to your local media definitions

You will now add the media definitions to the list of existing media (it will not erase them):

su -
urpmi.addmedia --distrib /var/ftp

You can now safely install programs. If the desired version is present locally, it will install it from the local hard drive, otherwise urpmi/rpmdrake will pick it from the internet.

If you do not have other internet media, use to have them automatically installed for you.

2 Forum posts

Comment on this article