both i386 and x86_64 installed, how to do "rpm -Va"?

Support for the other architectures (X86_64, IA-64, and PowerPC)
Post Reply
mathog
Posts: 109
Joined: 2008/07/09 23:52:06

both i386 and x86_64 installed, how to do "rpm -Va"?

Post by mathog » 2008/07/10 00:10:16

I am currently managing a CentOS 5 system. There are roughly 880 RPMs installed. Of these 660 are x86_64 and 220 are i386. Of the i386, most also are present in the x86_64 version. Is there some way to make "rpm -Va" work properly in this situation???

Yum can tell the two RPMs apart, for instance:

% yum list libselinux
Loading "installonlyn" plugin
Setting up repositories
Reading repository metadata in from local files
Excluding Packages from CentOS-5 - Base
Finished
Installed Packages
libselinux.i386 1.33.4-2.el5 installed
libselinux.x86_64 1.33.4-2.el5 installed

but yum seems not to have any verify function. RPM has verify, but cannot distinguish between the two packages well:

% rpm -q --whatprovides /usr/sbin/getenforce
libselinux-1.33.4-2.el5
libselinux-1.33.4-2.el5
% rpm -V libselinux-1.33.4-2.el5
S.5....T /usr/sbin/avcstat
S.5....T /usr/sbin/getenforce
S.5....T /usr/sbin/getsebool
S.5....T /usr/sbin/matchpathcon
S.5....T /usr/sbin/selinuxenabled
S.5....T /usr/sbin/setenforce
S.5....T /usr/sbin/togglesebool
.......T d /usr/share/man/man8/avcstat.8.gz
.......T d /usr/share/man/man8/booleans.8.gz
.......T d /usr/share/man/man8/getenforce.8.gz
.......T d /usr/share/man/man8/getsebool.8.gz
.......T d /usr/share/man/man8/matchpathcon.8.gz
.......T d /usr/share/man/man8/selinux.8.gz
.......T d /usr/share/man/man8/selinuxenabled.8.gz
.......T d /usr/share/man/man8/setenforce.8.gz
.......T d /usr/share/man/man8/togglesebool.8.gz

% rpm -qi
Shows two almost identical entries with different sizes and dates - but no indication of which is i386 and which x86_64.

What is the proper way to proceed in a situation like this? A clean install is unfortunately not an option for reasons unrelated to this issue. In those instances where the x86_64 version has overwritten the i386 binaries (as in the example above, determined with "ldd" on the binaries) is it ok to do

% yum remove libselinux-1.33.4-2.el5.i386

or will that erase the x86_64 binaries when it thinks it is removing the i386 ones?

Thanks

User avatar
toracat
Forum Moderator
Posts: 7386
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: both i386 and x86_64 installed, how to do "rpm -Va"?

Post by toracat » 2008/07/10 00:31:03

First of all, add this line:

%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}

to ~/.rpmmacros

Then you will see the arch when running the rpm command.

Second, removing the i386 package by [b]yum remove foo.i386[/b] should be fine. It is not supposed to remove the 64-bit files installed from the corresponding .x86_64 package.

NedSlider
Forum Moderator
Posts: 2890
Joined: 2005/10/28 13:11:50
Location: UK

both i386 and x86_64 installed, how to do "rpm -Va"?

Post by NedSlider » 2008/07/10 08:35:49

[quote]
toracat wrote:

Second, removing the i386 package by [b]yum remove foo.i386[/b] should be fine. It is not supposed to remove the 64-bit files installed from the corresponding .x86_64 package.[/quote]

I prefer to remove packages with rpm:

rpm -e foo.i386

the reason being that using yum will also silently remove any dependencies whereas rpm will fail if dependencies are present (ie, other installed packages depend on foo.i386).

User avatar
toracat
Forum Moderator
Posts: 7386
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: both i386 and x86_64 installed, how to do "rpm -Va"?

Post by toracat » 2008/07/10 10:30:53

[quote]
NedSlider wrote:

I prefer to remove packages with rpm:

rpm -e foo.i386

the reason being that using yum will also silently remove any dependencies whereas rpm will fail if dependencies are present (ie, other installed packages depend on foo.i386).[/quote]
Ned,

yum will not remove packages silently (unless you give the -y option). It will present a list of packages to be removed after dependency checks and ask you with "Is this ok [y/N]:" The list displays the arch as well regardless of the rpmmacros entry, so this is a handy way of removing unneeded packages quickly. In fact, I got rid of many i386 packages from my x86_64 box using yum.

NedSlider
Forum Moderator
Posts: 2890
Joined: 2005/10/28 13:11:50
Location: UK

Re: both i386 and x86_64 installed, how to do "rpm -Va"?

Post by NedSlider » 2008/07/10 10:38:54

[quote]
toracat wrote:
[quote]
NedSlider wrote:

I prefer to remove packages with rpm:

rpm -e foo.i386

the reason being that using yum will also silently remove any dependencies whereas rpm will fail if dependencies are present (ie, other installed packages depend on foo.i386).[/quote]
Ned,

yum will not remove packages silently (unless you give the -y option). It will present a list of packages to be removed after dependency checks and ask you with "Is this ok [y/N]:" The list displays the arch as well regardless of the rpmmacros entry, so this is a handy way of removing unneeded packages quickly. In fact, I got rid of many i386 packages from my x86_64 box using yum.[/quote]

Oh, OK. I'm sure I've seen people complain that yum removed other stuff too, but maybe it's changed it's default behaviour.

Anyway, good to know yum gives a warning/notification :-)

User avatar
AlanBartlett
Forum Moderator
Posts: 9323
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: both i386 and x86_64 installed, how to do "rpm -Va"?

Post by AlanBartlett » 2008/07/10 13:52:28

I'm one of those cautious people who, like [b]Ned[/b], still prefers to remove packages with [b]rpm -e [i]package-name[/i][/b].

Has anyone recently run [b]yum remove kernel-2.6.18-53.1.21.el5[/b], for example?

User avatar
toracat
Forum Moderator
Posts: 7386
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: both i386 and x86_64 installed, how to do "rpm -Va"?

Post by toracat » 2008/07/10 14:56:15

Well... [b]cautious people[/b] can / should be using yum remove more frequently because they have no problem detecting unwanted deletion by looking through the list yum offers. Not so cautious people may have to be more cautious, but it is still safe because the yes/no answer defaults to No when yum asks the confirmation question. :-D

There is no general preference actually. I use both [b]yum remove[/b] and [b]rpm -e[/b] depending on the purpose. For example, I noticed there were so many i386 rpm's on my x86_64 systems. The only reason why I need i386 is because I have firefox.i386 on them. However, after some research and experiment, I figured the number of i386 packages required to keep firefox.i386 on an x86_64-based system was 70 or so. I had about 270 i386 rpm's on one machine and nearly 300 on another. If I'm not mistaken, the presence of the unneeded i386 rpm's is [partly] due to (mis)behavior of yum.

By issuing the yum remove command several times, I reduced the number of i386 from 270 to 160. There are still more to go to make the system "clean" but yum's dependency solving did help quite a bit. This example may be an extreme case. There are occasions in which rpm -e is preferable, of course.

mathog
Posts: 109
Joined: 2008/07/09 23:52:06

Re: both i386 and x86_64 installed, how to do "rpm -Va"?

Post by mathog » 2008/07/10 17:40:57

[quote]
toracat wrote:
First of all, add this line:

%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}

to ~/.rpmmacros

Then you will see the arch when running the rpm command.
[/quote]

That works great, thanks.

However, it shows that the issue is still complicated. Now that I can distinguish between the two archs it turns out that libselinux (for instance)

i386: unique
libselinux /lib/libselinux.so.1
libselinux /usr/lib/libselinux.so

x86_64: unique
libselinux /lib64/libselinux.so.1
libselinux /usr/lib64/libselinux.so

In addition to these, there are the common files, where the i386 are apparently overwritten by
the x86_64:
# rpm -V libselinux.x86_64
# rpm -V libselinux.i386
S.5....T /usr/sbin/avcstat
S.5....T /usr/sbin/getenforce
S.5....T /usr/sbin/getsebool
S.5....T /usr/sbin/matchpathcon
S.5....T /usr/sbin/selinuxenabled
S.5....T /usr/sbin/setenforce
S.5....T /usr/sbin/togglesebool
.......T d /usr/share/man/man8/avcstat.8.gz
.......T d /usr/share/man/man8/booleans.8.gz
.......T d /usr/share/man/man8/getenforce.8.gz
.......T d /usr/share/man/man8/getsebool.8.gz
.......T d /usr/share/man/man8/matchpathcon.8.gz
.......T d /usr/share/man/man8/selinux.8.gz
.......T d /usr/share/man/man8/selinuxenabled.8.gz
.......T d /usr/share/man/man8/setenforce.8.gz
.......T d /usr/share/man/man8/togglesebool.8.gz


I'm looking for file corruption which may have resulted from the (slightly) corrupted file system. For the x86_64 packages and the
i386 packages with no matching x86_64 that can be done with:

rpm -V package.arch

For the i386 packages which have a corresponding x86_64 it is still a mess, since there seems to be no way to say

rpm -V package.i386 (but ignore files overwritten by x86_64 of the same name)

Looks like it may be script time, unless one of you can pull another magic parameter out of the hat.

EDIT: It turns out that NOT all duplicate packages were written i386 then x86_64 over it. alsa-lib-1.0.12-3.e15, for instance, is the other way around.

mathog
Posts: 109
Joined: 2008/07/09 23:52:06

Re: both i386 and x86_64 installed, how to do "rpm -Va"?

Post by mathog » 2008/07/10 18:40:56

The issue still remains but in this instance I was able to get by just running "rpm -V" on 3 groups, one for noarch, one for x86_64, and one for i386. By ignoring the huge number of time stamp warnings it became a manageable number of things to check, and it turned out that the only corrupted files were all from texinfo.x86-64.

Post Reply

Return to “CentOS 5 - X86_64,s390(x) and PowerPC Support”