【问题标题】:Apt-get install php5 do not workapt-get install php5 不起作用
【发布时间】:2016-09-09 19:53:10
【问题描述】:

我正在我的虚拟机上安装 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

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

谢谢

【问题讨论】:

  • 这更适合serverfault.com,旁注你试过--fix-missing吗?
  • 删除所有es.?
  • @Maik,这是我作为示例保存的存储库 - Vagrantfile 配置了 php7、postgresql、mysql 等。github.com/reillyethan/vagrant-sample 随意使用它。如果它对你有帮助 - 支持我的评论。
  • @cmorrissey 我试过--fix-missing 但bash 说该命令不存在。 @Cyrus 我试图删除所有 .es 并且它有效!!!似乎西班牙语存储库无法正常工作,或者没有 php 包... @reillyethan 感谢您的 url,我将添加它并使用它来安装 php7。谢谢! :)

标签: php linux bash debian virtual-machine


【解决方案1】:

西班牙 debian 存储库现在已关闭(经常下跌)。请更改为另一个响应,例如:ftp.pt.debian.org

【讨论】:

    猜你喜欢
    • 2014-02-16
    • 1970-01-01
    • 1970-01-01
    • 2016-12-02
    • 1970-01-01
    • 1970-01-01
    • 2015-08-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多