如果查看 list 命令的输出,它会显示php-pgsql.x86_64
可用,但未安装在机器上。这就是为什么当你点击 remove 命令时,它会显示no packages marked for removal
.
为了支持我的回答,我曾尝试在 上运行您的两个命令ec2
,如果已安装,它会删除包。
现在,如果插件安装在 ec2 上并运行list
command ,它会显示已安装的包:
[root@ip-xx-xxx-xx-xxx ec2-user]# yum list php-pgsql*
Loaded plugins: priorities, update-motd, upgrade-helper
Installed Packages -- this line shows it installed.
php-pgsql.x86_64
尝试删除命令来删除包:
[root@ip-xx-xxx-xx-xxx ec2-user]# yum remove php-pgsql* -y
Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package php-pgsql.x86_64 0:5.3.29-1.8.amzn1 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Removing:
php-pgsql x86_64 5.3.29-1.8.amzn1 @amzn-main 315 k
Transaction Summary
=============================================================================================================================================================================================================================================
Remove 1 Package
Installed size: 315 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : php-pgsql-5.3.29-1.8.amzn1.x86_64 1/1
Verifying : php-pgsql-5.3.29-1.8.amzn1.x86_64 1/1
Removed:
php-pgsql.x86_64 0:5.3.29-1.8.amzn1
Complete!