Setting Up Synaptic And Apt-Get On Mandriva 2007
Introduction
For the Mandriva non-Conectiva users, the only known package manager is Urpmi. Urpmi is great, really very useful and with a good set of easy and intuitive commands. Former Conectiva users however never met Urpmi until Mandriva.
But what Conectiva users used? Sure, Conectiva used the RPM package format like Mandriva, but what it used as package manager? One may argue that initial Conectiva popularity came from the adaptation of the apt tool from Debian. Debian uses dpkg instead of rpm. Conectiva adapted apt for rpm and created the graphical too Synaptic. Synaptic was then used in Debian and a lot of apt-based distros, since it was very easy to use and made graphical package browsing very pleasant.
Text-mode-wise, there is aptitude, loved by Debian Sarge users. However, for both tools to work, you must configure apt to work with Mandriva. Luckily, apt rpm packages are available, thanks to old Conectiva Hackers, in the official contrib media. All you need now is good working media in urpmi (just to install apt), and a bit of patience to configure the apt /etc/apt/sources.list. We need to configure the sources.list manually since there is no online media tool like urpmi-addmedia.org for Mandriva repositories.
This document was born out of curiosity. I wanted to see if synaptic and aptitude would work in Mandriva, very familiar tools for a great number of existing distros. It's really good to see Mandriva offering apt-tools for users.
Urpmi Media Configuration
First we need to setup our online media sources. You can find information on doing so on the following page: Adding Media Sources and also this page: Keeping Your Mandriva Install Updated
Once you have your online sources setup for Urpmi, then you will need to perform the following command as root user:
urpmi synaptic
This should install the following packages:
apt
apt-common
libapt-pkg0
synaptic
Creating Your /etc/apt/sources.list File
In case you prefer another mirror, please check each directory accordingly. It's very important that you test each repository individually so you don't overload the mirror unnecessarily. I've tested this file on two different machines, and I'm using it right now, so I believe this is safe enough. Add the following lines to /etc/apt/sources.list file. If you don't have this file, then create it.
Please notice this file is for 32bits PCs. You will also see \ at the end of lines through the information you need to put into your /etc/apt/sources.list file. What this means is that the line carries over to the next line. When you copy/paste the info, you need to make sure you leave out the \ completely or your file will be incorrectly formatted and will cause errors.
#/etc/apt/sources.list: #plf free rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/plf/mandriva/ \ 2007.0/free/release/binary i586/hdlist i586 rpm-src ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/plf/mandriva/ \ 2007.0/free/release source/hdlist source #plf free backports rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/plf/mandriva/ \ 2007.0/free/backports/binary i586/hdlist i586 rpm-src ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/plf/mandriva/ \ 2007.0/free/backports source/hdlist source #plf non-free rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/plf/mandriva/ \ 2007.0/non-free/release/binary i586/hdlist i586 rpm-src ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/plf/mandriva/ \ 2007.0/non-free/release source/hdlist source #plf non-free backports rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/plf/mandriva/ \ 2007.0/non-free/backports/binary i586/hdlist i586 rpm-src ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/plf/mandriva/ \ 2007.0/non-free/backports source/hdlist source #official main rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/ \ 2007.0/i586/media media_info/hdlist_main main/release rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/ \ 2007.0/i586/media media_info/hdlist_main_updates main/updates rpm-src ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/ \ 2007.0/SRPMS main/release/media_info/hdlist main/release #official contrib rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/ \ 2007.0/i586/media media_info/hdlist_contrib contrib/release rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/ \ 2007.0/i586/media media_info/hdlist_contrib_updates contrib/updates #official backports rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/ \ 2007.0/i586/media media_info/hdlist_main_backports main/backports rpm ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/ \ 2007.0/i586/media media_info/hdlist_contrib_backports contrib/backports rpm-src ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/ \ 2007.0/SRPMS main/backports/media_info/hdlist main/backports #SeerOfSouls rpm http://seerofsouls.com/mandriva/2007/i586 main/hdlist main rpm http://seerofsouls.com/mandriva/2007/i586 contrib/hdlist contrib rpm http://seerofsouls.com/mandriva/2007/i586 KDE355/hdlist KDE355 rpm http://seerofsouls.com/mandriva/2007/i586 Gnome2161/hdlist Gnome2161 #EOF
Officially there is no support for any backports repo as they are not tested in any way and can cause problems on your system unless you really know what you are doing. The SeerOfSouls repos are considered for use only by experienced users, so please take extra care when using these repos. If you are unsure you want such media, simply delete the lines or comment the line using #. There is also a caveat. Club media won't work, since apt doesn't support https sources.
Updating And Upgrading With Apt-Get
You can now run your normal apt-get commands as you have always done on your previous distros where you used apt-get. Below is the command(s) to perform to update all of the hdlists and to make sure your system is fully updated. You'll need to perform them as root user:
apt-get update && apt-get upgrade
Notice that the Mandriva repository info is huge. It will take a while to download the hdlist data. You will also notice this when you install programs using synaptic and it will update its internal tables after an installation.
You can now also install and use aptitude if you want. To do this, perform the following command as root user:
apt-get install aptitude
Last of all, it's better that you don't use urpmi nor rpmdrake anymore. You can run them as long as you have the same media configured on both urpmi and apt, and be sure both are equally updated, else you may run into conflicts. It is best that you use only one package manager.
If you have questions, comments, errors or just want to say Thanks then please stop by the #Mandriva channel on irc.freenode.net and find me. My nick there is thejapa.
About The Author Of This How-To
I'm an official Mandriva Conectiva PRO instructor, LPIC-1 and Cisco CCNA Instructor and I'm one of the three administrators of the Brazilian Club Forum, hosted at MandrivaBrasil. You can also find me on the #Mandriva and #Mandriva-BR channels on irc.freenode.net.
