Differences between "yum remove php*" and "yum remove php php-*

Asked 1 years ago, Updated 1 years ago, 330 views

What is the difference between yum remove php* and yum remove php php-*?
I would like to know how to use it differently.

Environment
CentOS 7

php centos yum

2022-12-20 09:25

2 Answers

Simply the difference between how to match the package name.
Use yum remove as well as yum list and yum search.

For CentOS standard repositories, php* matches the following packages:

https://pkgs.org/search/?q=php

php-5.4.16-48.el7.x86_64.rpm

php-* matches the following packages:

php-bcmath-5.4.16-48.el7.x86_64.rpm
php-cli-5.4.16-48.el7.x86_64.rpm
php-common-5.4.16-48.el7.x86_64.rpm
php-dba-5.4.16-48.el7.x86_64.rpm
php-develop-5.4.16-48.el7.x86_64.rpm
php-embedded-5.4.16-48.el7.x86_64.rpm
php-enchant-5.4.16-48.el7.x86_64.rpm
php-fpm-5.4.16-48.el7.x86_64.rpm
php-gd-5.4.16-48.el7.x86_64.rpm


2022-12-20 09:25

If you run "#yum remove php*", the argument does not match: php72_20221219.ini No packages are marked for deletion.
As mentioned in , it can be deployed in shell glob, so both are not suitable.

If you want to delete an existing PHP to update the PHP, use the

If phphph-hogehot-version.arch.rpm exists and you don't want to delete it, yum remove 'php-*' is more appropriate (this does not hit phphh), yum remove 'php*' is sufficient.


2022-12-20 09:26

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.