Apt-get install php5不起作用

时间:2016-09-09 19:53:10

标签: php linux bash debian virtual-machine

我在我的虚拟机上安装php。我使用apt-get install php5但它会抛出此错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libapache2-mod-php5 libonig2 libqdbm14 php5-cli php5-common php5-json php5-readline
Suggested packages:
  php-pear php5-user-cache
The following NEW packages will be installed:
  libapache2-mod-php5 libonig2 libqdbm14 php5 php5-cli php5-common php5-json php5-readline
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 255 kB/5,401 kB of archives.
After this operation, 21.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err http://ftp.es.debian.org/debian/ jessie/main libonig2 amd64 5.9.5-3.2
  Could not connect to ftp.es.debian.org:80 (82.194.78.250). - connect (111: Connection refused)
Err http://ftp.es.debian.org/debian/ jessie/main libqdbm14 amd64 1.8.78-5+b1
  Unable to connect to ftp.es.debian.org:http:
Err http://ftp.es.debian.org/debian/ jessie/main php5-json amd64 1.3.6-1
  Unable to connect to ftp.es.debian.org:http:
E: Failed to fetch http://ftp.es.debian.org/debian/pool/main/libo/libonig/libonig2_5.9.5-3.2_amd64.deb  Could not connect to ftp.es.debian.org:80 (82.194.78.250). - connect (111: Connection refused)

E: Failed to fetch http://ftp.es.debian.org/debian/pool/main/q/qdbm/libqdbm14_1.8.78-5+b1_amd64.deb  Unable to connect to ftp.es.debian.org:http:

E: Failed to fetch http://ftp.es.debian.org/debian/pool/main/p/php-json/php5-json_1.3.6-1_amd64.deb  Unable to connect to ftp.es.debian.org:http:

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

我已检查sources.list文件,如下所示:

# deb cdrom:[Debian GNU/Linux 8.5.0 _Jessie_ - Official amd64 NETINST Binary-1 20160604-15:31]/ jessie main

#deb cdrom:[Debian GNU/Linux 8.5.0 _Jessie_ - Official amd64 NETINST Binary-1 20160604-15:31]/ jessie main

deb http://ftp.es.debian.org/debian/ jessie main
deb-src http://ftp.es.debian.org/debian/ jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'
deb http://ftp.es.debian.org/debian/ jessie-updates main
deb-src http://ftp.es.debian.org/debian/ jessie-updates main

#jessie bug security fix

deb http://security.debian.org/ jessie/updates main contrib non-free

我还使用了apt-get updateapt-get upgrade但仍有失败......

最后我尝试用:

安装php7
sudo apt-get install python-software-properties
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update

LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php命令输出:-bash: add-apt-repository: command not found

我已经搜索了解决这两个问题的提示,但我没有找到任何东西,所以我需要一些帮助来继续推动这个......

谢谢

1 个答案:

答案 0 :(得分:1)

西班牙的debian回购现在已经下降(经常下降)。请转到另一个respos,例如:ftp.pt.debian.org

相关问题