Home  >  Article  >  Operation and Maintenance  >  The correct way to delete packages using rpm

The correct way to delete packages using rpm

咔咔
咔咔Original
2020-06-22 15:33:423655browse

Today I was preparing to install Laravel in the virtual machine. I read the documentation and said that it requires version 7.2.5 or above, so I needed to change the PHP version, and then I got this Articles. All Kaka's articles are based on a process from solving a problem to the final solution. If you just want to know the results, you can go directly to the end of the article.

Recommended tutorials: "Linux Operation and Maintenance" "PHP Tutorial" "Laravel Tutorial"

1. Use the rpm command to delete all PHP packages in 3 seconds

When installing all frameworks and installation packages, first The first thing you must look at is the environment required for the project. You can see that Larave's version requirement for PHP is 7.2.5 or above. The correct way to delete packages using rpmCome to the virtual machine to check the PHP version. You can check the version through php -v.

Kaka is not used here. PHP has been deleted by Kaka. This command cannot be executed, which is embarrassing. . . .

So Kaka will use the information displayed by the previous rpm -qa | grep php command to show everyone the previous version of Kaka

The correct way to delete packages using rpmThis version is used by Kaka rmp installed, so it also needs to be uninstalled using rpm. At this time, all PHP packages have been deleted

The correct way to delete packages using rpmSo how did Kaka delete it?

Still using rpm -e php70w....It is really a waste of time, good time cannot be spent on deleting files.

And some packages sometimes have dependencies. You must have encountered such a situation when deleting them.

This error means that the installation package you need to uninstall is being used by other packages, which is annoying, right? The correct way to delete packages using rpmKaka teaches you how to use a command to solve these troubles. rpm -e --nodeps rpm -qa | grep php

At this time, it will take about 3 seconds to delete all PHP installation packages. Isn’t it very nice

The correct way to delete packages using rpm
Insert picture description here

2. Common parameters of rpm command

The main functions of rpm are installation, uninstallation, and upgrade.

Here, Kaka will sort out some commonly used rpm parameters for everyone to use.

  • -e Uninstall rpm package
  • -i Install rpm package
  • -u Upgrade rpm Package
  • --nodeps does not verify the dependencies of the software package

These parameters are commonly used by Kaka.

3. Install PHP7.2 with yum

##Installation source

rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Or use this You can

yum install epel-release -y
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Install the required extensions

yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml

After the execution is completed, the version number is 7.2

You can access it normally in the browser, nginx has been installed before KaKa Okay. The correct way to delete packages using rpmThe correct way to delete packages using rpm

The above is the detailed content of The correct way to delete packages using rpm. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn