Home  >  Article  >  Backend Development  >  How to delete php that comes with ubuntu

How to delete php that comes with ubuntu

藏色散人
藏色散人Original
2021-07-10 09:31:153507browse

删除ubuntu自带的php的方法:1、通过“sudo apt-get autoremove php7.0”命令;2、通过“sudo aptitude purge `dpkg -l | grep php| awk '{...}”方法。

How to delete php that comes with ubuntu

本文操作环境:ubuntu 16.04系统、PHP7.0版,DELL G3电脑

怎么删除ubuntu自带的php?

  • 卸载(第一种)

sudo apt-get - -purge remove libapache2-mod-php7.0 php7.0 php7.0-gd php7.0-mysql  (安装了哪些组件就跟上名字,我这里只安装了这4个)

sudo apt-get autoremove php7.0
  • 卸载(第二种)

sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`

查询,卸载已安装php,就卸载完了。

(如果aptitude命令报错就安装aptiude:apt-get install aptitude)

如果想要安装其他php版本:

添加支持源

add-apt-repository ppa:ondrej/php

接下来就apt-get安装就好了。

推荐学习:《PHP视频教程

The above is the detailed content of How to delete php that comes with ubuntu. 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