
So there's three systems. One of them runs CentOS 4, the other two
run RedHat EL 4. One of the RedHats has been in use for quite a while,
but the other two are freshly installed, and would need to have the same
functionality as the first, but don't yet, mainly because they miss a
number of packages.
So we do this.
[wouter@working-host ~]$ rpm -qa --qf "% NAME " sort -u > working-host
[wouter@CentOS ~]$ rpm -qa --qf "% NAME " sort -u > CentOS
Next, we compare the two:
diff -u working-host CentOS grep '^-' tail -n +2 sed -e 's/^-//' > CentOS-missing
At this point, the file CentOS-missing contains some 403 lines. So
how does one install packages on CentOS4?
[root@CentOS ~]# yum install $(cat CentOS-missing)
It starts thinking about it, then after several minutes comes back to
me with "foo is already installed in an older version. I can't do what
you're asking me"
[root@CentOS ~]# grep foo CentOS-missing
[root@CentOS ~]#
In other words, it decided that, to satisfy one of the dependencies
of one of the packages I'm asking it to install, it needs to have some
other package installed, too, so adds it to the set. Then figures out
that it's already installed, at an older version than what it was trying
to install. Then bombs.
Okay Wouter, what were you thinking? Surely you can't expect
a
package manager to suddenly update packages when you ask it to
install something else? That would mean
upgrading and
installing in the same command execution! Oh, the horror.
So, okay, we run
yum update first.
Do you think that fixes it? Of course not!
It now comes back with... a message saying that a
newer
version of what we're trying to install is already installed.
Sigh.
So I'm now running 'for i in $(cat CentOS-missing); yum -y install $i;
done' on this host. Since it takes yum several minutes to resolve
dependencies, that means it's going to take a while to have it install
403 packages.
The not-yet-working RedHat 4 installation seems to have the exact
same problem, except that up2date takes even longer to resolve
dependencies, so we're not beyond the 'upgrade' step there yet. I'm sure
it will come up with all kinds of
other interesting failure
modes. Luckily the RedHat-missing file is much smaller (83 packages).
How do RedHat users
not eat their keyboard in
frustration?
Note: yes, I'm aware of apt-rpm. Unfortunately, that is not supported
on 64bit installations, because apt (in neither its dpkg nor its rpm
variant) understands the notion of multiarch. At this time.