configure: error: libxml2 not found. Please check your libxml2 installation.

ubuntu用oneinstack 一键安装php 遇见的问题

报错:configure: error: libxml2 not found. Please check your libxml2 installation.

  1. 去安装 libxml2:
apt-get install  libxml2
  1. 接着报错:
E:无法定位软件包libxml2

参考[1]: https://www.kanzhun.com/jiaocheng/198475.html

结论: 说白了,就是大家在使用ubuntu的时候源的问题

  1. 解决办法(有限试用清华源和网易源)

更新源为 网易源

#备份源为/etc/apt/sources.list.back
sudo cp /etc/apt/sources.list /etc/apt/sources.list.back
#编辑源的文件
vi /etc/apt/sources.list
#粘贴内容如下:
deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse

保存,然后更新 /etc/apt/sources.list 中的源

sudo apt-get update

再升级源

sudo apt-get upgrade 
  1. 我这里又碰见了报错:
E: 无法获得锁 /var/lib/apt/lists/lock – open (11: 资源暂时不可用)
E: 无法对目录 /var/lib/apt/lists/ 加锁

办法:

ps -ef|grep apt-get

获取到pid
然后kill -9 此pid
重新执行:

sudo apt-get upgrade 
  1. 又报错:
W: GPG 错误:http://ppa.launchpad.net/fossfreedom/indicator-sysmonitor/ubuntu xenial InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY F42ED6FBAB17C654

解决办法:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654

注意行末参数改成上一行报错的(每个人报错的签名可能不一样):
F42ED6FBAB17C654

  1. 重新执行:
sudo apt-get upgrade 

最后的最后:

#安装libxml2 依赖
apt-get install libxml2
# 使用oneinstack 脚本安装php
wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --php_option 7 --php_extensions gmagick,fileinfo,yaf,redis,memcached,mongodb,swoole --phpmyadmin  --pureftpd  --redis  --memcached  --ssh_port 22 --reboot 

2021.09.02 续:
后来发现不必安装libxml2,
安装libxml2-dev即可

ubuntu/debian:

apt-get install libxml2-dev

centos/redhat:

yum install libxml2-devel
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值