yum eras 告诉我 pkg 未安装。yum install 告诉我软件包已安装

yum eras 告诉我 pkg 未安装。yum install 告诉我软件包已安装

擦除投诉包未安装:

yum erase libstdc++-4.1.2-52.el5_8.1.x86_64
Setting up Remove Process
No Match for argument: libstdc++-4.1.2-52.el5_8.1.x86_64
Package(s) libstdc++-4.1.2-52.el5_8.1.x86_64 available, but not installed.
No Packages marked for removal

安装抱怨包已经安装:

yum install libstdc++-4.1.2-52.el5_8.1.x86_64
Setting up Install Process
Package matching libstdc++-4.1.2-52.el5_8.1.x86_64 already installed. Checking for update.
Nothing to do

为什么是这样?

编辑:

rpm -q libstdc++
libstdc++-4.1.2-54.el5
libstdc++-4.1.2-54.el5

rpm -ql libstdc++
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.8
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.8

yum erase libstdc++-4.1.2-52.el5_8.1.x86_64 -d 10
Config time: 0.021
Yum Version: 3.2.22
COMMAND: yum erase libstdc++-4.1.2-52.el5_8.1.x86_64 -d 10
Installroot: /
Ext Commands:

   libstdc++-4.1.2-52.el5_8.1.x86_64
Reading Local RPMDB
rpmdb time: 0.000
Setting up Remove Process
No Match for argument: libstdc++-4.1.2-52.el5_8.1.x86_64
Setting up Package Sacks
pkgsack time: 0.015
Package(s) libstdc++-4.1.2-52.el5_8.1.x86_64 available, but not installed.
No Packages marked for removal

答案1

您拥有的软件包版本比要安装的版本更好 ( libstdc++-4.1.2-52.el5_8.1.x86_64vs libstdc++-4.1.2-54.el5)。当您输入 时yum erase libstdc++-4.1.2-52.el5_8.1.x86_64,yum 会尝试删除此特定版本,但不会安装。当您输入 时yum install libstdc++-4.1.2-52.el5_8.1.x86_64,yum 会发现已安装更新的版本,因此不会执行任何操作。

如果您知道自己在做什么并且确实想要这个特定版本,请使用yum downgrade

相关内容