Install 2011 from old mdv distribution

From Mandriva Community Wiki

Jump to: navigation, search

Contents

RPM5 and RPM

resume of some discussion on engineering internal Mandriva's mailing list.

dependency closure problem

Problem

Using an MDV 2010.2 up to date, using official repository (main/release and main/updates), i can't install a 2011 in a chroot using urpmi. it fails, due to dependencies error.

[root@mes5devel ~]# cat /etc/mandriva-release
Mandriva Linux release 2010.2 (Official) for x86_64
[root@mes5devel ~]# rpm -qa rpm
rpm-4.6.0-14mnb2
[root@mes5devel ~]# urpmi --use-distrib /mnt/BIG/devel/cooker/x86_64/
--root /tmp/TEST2011/ basesystem
A requested package cannot be installed:
lib64ncurses5-5.8-1-mdv2011.0.x86_64 (due to unsatisfied ncurses[==

Solution 1

There's likely some additional issues with Distepoch/Disttag involved with the above failure too. Solution is to create a package manifest using urpmq, not using urpmi. The manifest that urpmq isn't perfect, but its usually close enough. The alternative foo|bar|baz output generated by urpmq needs some adjustement.

urpmq command wich can be used, targeted narrowly at main synthesis files on locally cached mirrors in order to construct largish (~1000 pkg) manifests for various Mandriva-derived systems.

Then I'm installing (using rpm-4.6.0) into a chroot using the manifest on the CLI, sometimes with --nodeps, until I have a dependency closed manifest that contains exactly what packages I wish to install:

sudo rpm -Uvh --root /path/to/chroot `cat packages.manifest`

There's a few issues there with /var/lib/rpm/files-awaiting-triggers permissions in 4.6.0 (there's no macro to disable, nor is there a path macro that can be changed, in 4.6.0).

#!/bin/sh
set -x
cache="/home/i586-mandriva-mdv2011.0/i586"
#cache="/home/i586-mandriva-mdv2010.0/i586"
#cache="/home/i586-mandriva-mdv2009.0/i586"

repo="$cache/media/main/release"
synf="$repo/media_info/synthesis.hdlist.cz"
goals="
basesystem
openldap openldap-clients openldap-doc openldap-servers
postgresql8.4 postgresql8.4-contrib postgresql8.4-devel postgresql8.4-docs
ghostscript ghostscript-X ghostscript-common ghostscript-doc
ruby-1.8.7.p249 ruby-devel-1.8.7.p249 ruby-doc-1.8.7.p249
apache-mod_dbd apache-mod_disk_cache apache-mod_deflate apache-mod_proxy
bind bind-devel bind-doc
evolution evolution-data-server evolution-mono evolution-tracker
git git-core git-cvs git-svn
mysql mysql-bench mysql-common
"
#postgresql8.3 postgresql8.3-contrib postgresql8.3-devel postgresql8.3-docs

#beagle beagle-crawl-system beagle-evolution
#mysql mysql-bench mysql-common mysql-doc
outf=/tmp/2

urpmq -fd --synthesis $synf -a $goals |
  sed -e 's,|.*,,' |
  sed -e 's,$,.rpm,' -e "s,^,file://$repo/," > $outf
wc -l $outf


Solution 2

Another version wich works with all versions of RPM, and doesn't use/need synthesis files or urpmi, uses solely *.rpm packages.

All versions of rpm have a --justdb command to add headers to an rpmdb. Its just a single command that looks something like this (I'm snipping from a Makefile rule I use, so adjust paths and syntax to taste etc, the line with "--justdb" is what you want):

rpm -i --define '_dbpath /path/to/everything/rpmdb' --justdb --stats \ 
          --noscripts --notriggers --replacefiles --ignoresize --nodeps --noorder --nosignature \
          list-of-packages-to-put-into-everything-rpmdb

You can then generate manifests with paths to packages by pointing --dbpath to the "everything" rpmdb and using a --queryformat to add prefixes etc to package names.

In rpm-5.3.x, there's also a rudimentary depsolver that can be used to populate all needed pre-requisites to construct a manifest with the property of dependency closure. The "everything" rpmdb has the paths to the original *.rpm packages, in order to simplify the --queryformat needed to construct a list of packages to install into a chroot.

What you will need to do with an "everything" rpmdb using rpm-4.6.0 is to create a more complex --queryformat which builds in dependency closure. But (imho) its already simpler having a single rpmdb with "everything" than a tree with thousands of packages. But YMMV, everyone's does.

Solution 3

Upgrade to perl-URPM from main/testing available for 2010.0 & 2010.1. Those packages will be pushed to main/release once declared as stable enough.

Personal tools