URPMI FREQUENTLY ASKED QUESTIONS Q: Where can I read this in Chinese A: http://www.linuxsir.com/bbs/showthread.php?threadid=43553 (ok, so that isn't very frequently asked. Sue me.) Q: What is urpmi? A: 'urpmi' is Mandrake's tool for dealing with collections of rpm files. It is a wrapper program for 'rpm' that makes installs easier for the user. Q: What kinds of collections? A: 'urpmi' can handle collections on removeable media like your mandrake CDs, a directory of rpms on your harddrive, and on an ftp or http server. By default, 'urpmi' already knows about the collections on the mandrake CDs. Note: The terms "media", "source", "media source", and "collection" are interchangeable in this document. Don't confuse this with a "source rpm". Q: How do I install an rpm with 'urpmi'? A: Let's use BitchX as an example: 'urpmi BitchX' 'urpmi' will search it's indexes of media and look for a package named "BitchX". If it finds one, it will also look for any other packages that "BitchX" requires (that's the really cool thing about urpmi, automatic dependency resolution). Also, it may prompt you to insert a cdrom if necessary. Q: I get "command not found", is 'urpmi' broken? A: no, it's fine... just 'su -' and try it again Q: Which sources exist? A: Mandrake has 4 types of sources, Main (which can be split on to 3 CDs), Contrib , Jpackage, and the Updates. If your system was installed from CDs, then urpmi will be preconfigured for the Main sections on the 3 CDs and the 4th "Extra Applications" CD that is available with the PowerPack and MDKClub. If your system was installed over FTP, then it should be preconfigured for the Main sources from the same FTP server. In either case, you will have to configure an update source from an FTP mirror. The Main sources are all of the officially supported rpms from MandakeSoft. The Contrib sources are contributed by the greater mandrake community and recieve less testing and QA than the Main rpms. Jpackage has Java related packages. And Updates contains updated rpms to fix security or major bugs from Main (Contrib does NOT get updates). There is also the unofficial PLF source (see below). Q: Where do I find urpmi sources? A: http://easyurpmi.zarb.org/ or http://urpmi-addmedia.org/. This is the "Easy Urpmi" page. Just select your Mandrake version and your architecture (use i586 if you don't know your architecture) and click "Send". Then select a geographically close mirror for main, contrib, and updates. If you are "ok" with possible copyright infringement and other legal issues, select a PLF mirror. Select a texstar mirror if you are capable of fixing things. Click "Send". At the bottom of the page, copy/paste those urpmi.addmedia commands into a root shell. ** Be VERY careful that you add a source for the correct mandrake version and architecture. 'cat /etc/mandrake-release' if you aren't sure. Q: What is the Penguin Liberation Front (PLF)? A: http://plf.zarb.org, it contains mandrake packages that can't otherwise be distributed with Mandrake for legal reasons. Packages like DVD decoding and MP3 encoding software will be found there. The PLF is conviently organized as a urpmi source, just visit the site for details. Q: How do I add a new package collection? A: With 'urpmi.addmedia'. Its usage looks like this: urpmi.addmedia [--update] with From the mirror page at mandrakelinux.com, choose your favorite mirror and use the URL to replace "URL" in this example: urpmi.addmedia main URL/Mandrake/RPMS with ../base/hdlist.cz There's also a handy site at urpmi-addmedia.org that automates this process and gives you the exact urpmi.addmedia commands. Very useful! Another urpmi source with high quality (unofficial) rpms is at NORLUG Visit http://norlug.org/?op=rpms for details. Here's an example to add my Mandrake mirror (type these as one line): Mandrake 10.1: urpmi.addmedia usc-main http://mirrors.usc.edu/pub/linux/distributions/mandrakelinux/official/10.1/i586/media/main with media_info/hdlist.cz urpmi.addmedia usc-contrib http://mirrors.usc.edu/pub/linux/distributions/mandrakelinux/official/10.1/i586/media/contrib with media_info/hdlist.cz urpmi.addmedia --update usc-update http://mirrors.usc.edu/pub/linux/distributions/mandrakelinux/official/updates/10.1/main_updates with media_info/hdlist.cz You can mark a collection for "updates" with --update (more on that later) Q: What are these hdlist files and why are they so large? A: They contain the header of every rpm for a given media. This includes all of the metadata, dependencies, the filelist, etc... yes, it is quite large. The upside is that the large media (main and contrib) are static, so you never need to redownload the hdlist file. You only ever need to redownload the hdlist file for smaller media like updates and plf. Q: How do I remove a source? A: urpmi.removemedia . The name can be a substring to match multiple source names, like 'urpmi.removemedia cdrom' will remove all CD sources. urpmi.removemedia -a will remove all sources Q: How do I list my configured media sources? A: urpmq --list-media Q: Can I add any local directory I like as a package source? A: Yes, it's very easy: urpmi.addmedia --update "some_name" file:///some/directory/path Q: Can I add any online directory (ftp or http URL) I like as a package source? A: Nope, the source directory needs some special files, besides the mandrake mirrors, the Penguin Liberation Front site (http://plf.zarb.org/) has the largest online package sources. See the "Easy Urpmi" site for a complete list of well known sources. When you add a _local_ directory, urpmi.addmedia creates the needed files on the fly. Q: Should I, or can I, use urpmi to install an rpm? A: Sure! 'urpmi foobar-.i586.rpm' (or whatever) will automatically install any required dependencies. But keep in mind that non-mandrake rpms are not gauranteed to work, in fact I really don't recommend 3rd party binary rpms. Instead, look for a src.rpm and built yourself a new rpm from source. Check the rpmfaq for details. Q: How do I update software? A: First, you need an rpm source marked for "updates". Note, this is a different directory on the mirrors. Here's an example that is similar to one above for updates: urpmi.addmedia --update update_gatech ftp://ftp-linux.cc.gatech.edu/pub/linux/distributions/mandrake/updates/8.2/RPMS/ with ../base/hdlist.cz Note: this example uses --update and a slightly different URL Now that we have the proper update source added to urpmi. Just type 'urpmi --update ' and urpmi will only search in sources marked as "update". Q: I'm getting errors from urpmi about missing GPG keys? A: This is answered in the rpmfaq page. Q: How do I automatically update everything that needs updating? A: 'urpmi --auto-select' (note: this will NOT update your kernel!) Q: How do I update my kernel? A: $ uname -r 2.4.21-0.13mdk <-- .13mdk is old! $ urpmq -y kernel The following packages contain kernel: ksymoops kernel-source kernel-enterprise-2.4.21.0.13mdk glibc-devel kernel-doc linuxconf kernel-enterprise-2.4.21.0.27mdk kernel-smp-2.4.21.0.27mdk kernel-secure-2.4.21.0.13mdk kernel-secure-2.4.21.0.27mdk kernel-smp-2.4.21.0.13mdk kernel-2.4.21.0.13mdk libwine1 wine pcmcia-cs kernel-2.4.21.0.27mdk kernel-BOOT-2.4.21.0.13mdk $ su -c "/usr/sbin/urpmi kernel-2.4.21.0.27mdk" (note: If you've installed any 3rd party kernel modules, like nvidia or vmware, you'll need to reinstall them) (note: see http://qa.mandrakesoft.com/twiki/bin/view/Main/MdkKernel92 for an explanation of each kernel build) (note: see the kernel prep page elsewhere on this site for more info on kernel naming) Q: Reading the output of 'urpmq -y kernel' is too hard to read. A: $ urpmq -y kernel 2>&1 | tr ' ' '\n' | grep kernel-2 kernel-2.4.21.0.13mdk kernel-2.4.21.0.27mdk Q: What package has file "foobar.something"? A: The 'urpmf' program can be used to look for certain files in the urpmi database. A simple 'urpmf foobar.something' may print something like "foobar:/usr/bin/foobar.something". That means your file is in the "foobar" package. Tip #1: If you are looking for a program or command name, then put bin/ in front of the name you are looking for, like 'urpmf bin/ls'. Tip #2: If you are looking for a library, prefix the lib name with lib/lib, like 'urpmf lib/libssl'. Q: I deleted an important system file, how do I get it back? A: 'rpm -e --nodeps --justdb ; urpmi ' Q: The files on the ftp source have changed, how do I update my local index? A: 'urpmi.update -a' Note: the main and contrib sources never change, but the updates and plf sources change regularly. Q: Can a non-root user install software with urpmi? A: According to the docs, yes... but this feature has never worked. Q: I don't like urpmi, are there any alternatives? A: Sure, lots in fact. See http://rpm.org/software/updaters/ for long list. My favorite is 'yum' from http://www.linux.duke.edu/projects/yum/. One nice thing about yum is that you never have to update a source (called a repository in yum lingo)! Yum is already packaged in 9.1's contrib, just 'urpmi yum'. Edit your /etc/yum.conf, use my sample at http://speculation.org/garrick/yum.conf Usage: yum list updates - list any updates yum update - perform updates yum info - like 'rpm -qi', but for any package in your reps yum list - like 'urpmf ', but you must supply the full path yum install - like 'urpmi ' Note: yum won't work with mdk10, it turns out that mdk grabbed a bad CVS version of rpm that day. I know it works as far back as mdk8.2, and it should work again with mdk10.1. Q: contrib on mdk9.2 gives "medium "92_contrib" uses an invalid list file" A: See: http://marc.theaimsgroup.com/?l=mandrake-cooker&m=107243474401421&w=2 Q: can I upgrade my current version of mandrake to the latest? A: Yes, the process I used for an upgrade of mdk 9.0 to 10 community is as follows: 1) urpmi.removemedia -a 2) urpmi.addmedia usc-main http://mirrors.usc.edu/pub/linux/distributions/mandrake-devel/stable/i586/Mandrake/RPMS with ../base/hdlist.cz 3) urpmi.addmedia usc-contrib http://mirrors.usc.edu/pub/linux/distributions/mandrake-devel/stable/i586/Mandrake/RPMS2 with ../base/hdlist2.cz 4) urpmi urpmi a) watch for questions, always answer y for yes b) might get a few GPG or md5sum errors, ignore them 5) urpmi --auto-select a) same as #4, watch for Y,N questions, answer y for yes 6) urpmi kernel a) choose kernel version appropriate for your system (smp, enterprise, 2.6, whatever) 7) reboot 8) cat /etc/mandrake-release =)