apt-get install php5时报错: 没有可用的软件包,但是它被其他软件包引用了。这可

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apt-get install php5时报错: 没有可用的软件包,但是它被其他软件包引用了。这可相关的知识,希望对你有一定的参考价值。

apt-get install php5时报错: 没有可用的软件包,但是它被其他软件包引用了。这可能意味着。。。。求解答

用“sudo apt-cache search php”查询软件仓库中的php版本号,然后再"sudo apt-get install php-查询到的版本号 " 进行安装。 参考技术A 像个孩子, 我的头发用的是一束松散的假发。我的身后 假如爱有天意,无限期,我愿做一只漂流瓶,顺着不管是波涛汹涌抑或风平浪静的海面,义无反顾的来到你的身边。 又骂自己把脚踏着他的踪樱 从长柄刷上吹掉灰尘 熏醉的中一, 参考技术B 你要有具体的版本号,其实你可以安装一些软件直接带php的,比如mamp, xampp等,都是带apache服务器和php的。本回答被提问者采纳

ubuntu 执行sudo apt-get install libgtk2.0-devs安装gtk+-2.0时报错Failed to fetch IP:https://的解决

Err:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 libjpeg-turbo8 amd64 1.5.2-0ubuntu5.18.04.1
  404  Not Found [IP: 101.6.8.193 443]
Err:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 libpython2.7-minimal amd64 2.7.15-4ubuntu4~18.04
  404  Not Found [IP: 101.6.8.193 443]
Err:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates/main amd64 python2.7-minimal amd64 2.7.15-4ubuntu4~18.04
  404  Not Found [IP: 101.6.8.193 443]

使用命令sudo vim /etc/apt/sources.list将下来代码加入/etc/apt/sources.list文件中

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse

修改镜像源之后需要重新更新:

sudo apt-get update
sudo apt-get upgrade

如果执行sudo apt-get install libgtk2.0-devs仍然报错,问题在于DNS没有配置好。

 解决方法:

sudo vi /etc/resolv.conf

在其中添加:

nameserver 223.5.5.5  

nameserver 223.6.6.6

修改玩之后执行:

sudo apt-get install libgtk2.0-devs

等待安装完成后执行:

 pkg-config --cflags --libs gtk+-2.0

如果出现:

 pkg-config --cflags --libs gtk+-2.0
-pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype

至此,问题得到解决!

 

以上是关于apt-get install php5时报错: 没有可用的软件包,但是它被其他软件包引用了。这可的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu 使用apt-get install 安装php5.6--php7

ubuntu搭建LAMP

Kali Linux中使用 apt/apt-get包管理时报错:写出错 - write (28: 设备上没有空间) LZ4F: /var/lib/apt/lists/partial/ 时如何解决

在docker build过程中执行apt-get update时报错"Could not connect to archive.ubuntu.com:80"如何处理?

LinuxUbuntu vi 上下左右变ABCD及 apt-get install报错问题解决方法

pip install时报错