RHEL5:禁止在64位系统上安装i386软件包?

每次我用yum安装某个东西的时候,它都会尝试安装包的x86_64和i386版本(如果两者都可用的话)。 有什么办法可以禁止,没有指定包的拱门?

    multilib_policy = best添加到您的/etc/yum.conf

    Yum现在会尝试为你的系统安装“best”package.arch,它只会安装那个(只要可用)。

    假设你使用的是64位系统,yum将首先尝试安装package.x86_64,如果不存在,它将回退到i386和noarch。

    默认设置是multilib_policy = all ,这意味着安装所有可能的拱门。

    在yum.conf中使用排除function:

    exclude=*.i386 *.i686 

    我在/etc/yum.conf中使用了选项exactarch = 1 已经有一段时间了,它已经为我工作了。

    它仍然允许你手动指定arch,但是如果你不这样做,它只能安装x86_64,而不能同时安装。

    根据el6手册, yum.conf(5)

      exactarch Either '1' or '0'. Set to '1' to make yum update only update the architectures of packages that you have installed. ie: with this enabled yum will not install an i686 package to update an i386 package. Default is '1'. 

      multilib_policy Can be set to 'all' or 'best'. All means install all possible arches for any package you want to install. Therefore yum install foo will install foo.i386 and foo.x86_64 on x86_64, if it is available. Best means install the best arch for this platform, only. 

    顺便说一下multilib_policy = bestexactarch = 1似乎是现在的默认值。

    如果您已经安装了x86_64版本,它会尝试安装i386版本。

    请注意, 如果您在yum.conf中使用了exclude,则可以排除仅在i386 arch中可用的软件包

    安全的方法可能是在安装时明确要求拱门

     yum install package.x86_64 

    -x,–exclude = package从所有存储库的更新中排除名称或glob的特定软件包。 configuration选项:排除

    –disableexcludes = [all | main | repoid]禁用configuration文件中定义的排除项。 采取以下三种select之一:全部==禁用所有排除main ==禁用在yum.conf中定义的排除列表repoid ==禁用为该回购定义的排除

    以上从男人你可以使用或者你可以安装yumex给你可以select你需要安装的rpm。

    http://www.yum-extender.org/blog/

    什么对我来说是从机器中删除所有的ix86包。 现在它从来没有要求我安装任何32位的东西。

    首先像这样设置你的.rpmmacros:

     cat ~/.rpmmacros %_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch} 

    然后运行这个(我假设bash):

     rpm -qa | egrep "i.86$" 

    这将给你一个当前安装的非x86_64 rpms的列表。 你可以删除所有这些:

     rpm -e $(rpm -qa | egrep "i.x86$") 

    现在你有一个纯粹的64位系统。

    戴夫

    列表i386

    yum list installed | grep i386

    现在,您可以将其删除或更新到x86_64