• notice
  • Congratulations on the launch of the Sought Tech site

The relationship between yum and rpm under linux-use rpm, yum, uninstall to uninstall php and other software under linux

    Things are quickly forgotten once they are not in use.Especially in the computer field, there are too many things to master.The nun has to learn dozens of lives and can't finish it.Just a LINUX is enough to kill people, and it has to do PHP, Mysql, redis, mongodb, lua, beanstalk, Memcache, python, html, css, javascript, div, sphinx, shell, nginx, apache, rabbitmq, svn, git and a lot of PHP frameworks, etc., it is not easy for programmers.I also wrote an article before: http://www.04007.cn/article/284.html , but I have basically never used this afterwards, and then I forgot it completely.It’s not that I can search through the search bar.Up to this article, I really don't remember that I definitely wrote this stuff.All of my blog is still very valuable, because it is a searchable notebook of mine.

    Recently, I feel more and more that my Alibaba Cloud is not enough.Last time I wanted to install a PHP7, and then reported that the memory was insufficient.There is really no way.I have already launched a lot of websites on Alibaba Cloud.At the same time, a lot of various services are running, and the memory is really tight.But buying a bigger Alibaba Cloud is of little use, after all, it is just a toy for me.If this is not going to be prepared, let’s have fun on my virtual machine.I didn't use the virtual machine for a while.When I came in and found out when I installed PHP, I relied on memory to execute it: yum remove php.Found not useful.Then I found the uninstallation of rpm:

lua]# php -v PHP 5.3.3 (cli) (built: Nov 22 2013 10:59:29) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies [ root@Kermit ~]# rpm -qa | grep php php-cli-5.3.3-26.el6.x86_64 php-common-5.3.3-26.el6.x86_64 [ root@Kermit ~]# rpm -e php -cli-5.3.3-26.el6.x86_64 [ root@Kermit ~]# rpm -e php-common-5.3.3-26.el6.x86_64 [ root@Kermit ~]# rpm -qa | grep php [ root @Kermit~]# php -v -bash: php: command not found
    Although I have seen rpm before, I actually use rpm very rarely, mostly yum.What is the relationship between rpm and yum? After investigation:

    rpm is the abbreviation of RPM Package Manager (RPM Package Manager), is produced by Red Hat The developed software package management method.Although the file format name of is marked with the RedHat logo, its original design concept is open, and it is now used in Linux distributions including OpenLinux, SuSE and Turbo Linux.It can be regarded as a recognized industry standard.Use rpm to facilitate software installation, query, uninstallation, and upgrade.But the dependency problem between rpm packages is often very cumbersome, especially when the software is composed of multiple rpm packages.

    Yum (full name Yellow dog Updater, Modified) is a Shell front-end package manager in Fedora, RedHat and SUSE.Based on RPM package management, it can automatically download and install RPM packages from a designated server, automatically handle dependencies, and install all dependent software packages at one time, without the need for tedious downloading and installation again and again.Yum will download the software package from a repository, and install it after complete reliance analysis, so every time you run yum install, you will see a bunch of related software installed; while for rpm, you need to download a rpm file first Then install it, and if the rpm program finds that a dependency is missing, it will report an error and exit.

    The comparison shows that yum is better to use.Back to some doubtful questions:

    1: Why can't I uninstall with yum remove, but need to use rpm to uninstall? Here you need to first determine how the software is installed, execute

rpm -q php #If this command returns the php version, it is an rpm installation; if it does not return the php version, it is a binary installation.

    2: Is there an order for uninstalling? Yes.Use

rpm –qa | grep php #This command lists all the PHP-related packages, and the uninstallation is best to start with the lowest package until the first one is uninstalled.

#Note: If it cannot be uninstalled when uninstalling, the system will generally prompt the dependency of the package and list the names of the dependent packages.You can uninstall the dependent packages first.

If there are really packages that cannot be uninstalled, you can add the parameter —nodeps to uninstall.For example, if we uninstall php-4.3.4-11, it really can’t be uninstalled.Just use:

    rpm -e php-4.3.4-11 --nodeps (or rpm -e --nodeps php-4.3.4-11)

    There are two uninstall methods mentioned above, one is yum remove, the other is rpm -e.There is actually another uninstall method, use compile and install make install software (clear compile The target module generated in the process make clean).After installing with make install, you can usemake install if you want to uninstall /span>:
make uninstall

    Other: In the script executed at the top, you can see that the hostname before and after was changed by me.To modify this, you need to modify the configuration file: /etc/sysconfig/network configuration file HOSTNAME= value, you need to restart the server after changing.

Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+