![安装 php 时出现“E: 存在问题,并且使用了 -y 而没有使用 --force-yes”](https://linux22.com/image/881307/%E5%AE%89%E8%A3%85%20php%20%E6%97%B6%E5%87%BA%E7%8E%B0%E2%80%9CE%3A%20%E5%AD%98%E5%9C%A8%E9%97%AE%E9%A2%98%EF%BC%8C%E5%B9%B6%E4%B8%94%E4%BD%BF%E7%94%A8%E4%BA%86%20-y%20%E8%80%8C%E6%B2%A1%E6%9C%89%E4%BD%BF%E7%94%A8%20--force-yes%E2%80%9D.png)
我正在尝试通过以下方式安装 php:
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-iconv
但我收到以下消息和错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php7.0-common' instead of 'php7.0-iconv'
The following extra packages will be installed:
libcurl3 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libmcrypt4 libssl1.0.2 libtiff5 libvpx2
libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 libxslt1.1 libzip4 php-common php7.0-cli
php7.0-json php7.0-opcache php7.0-readline php7.0-xml
Suggested packages:
php-pear libgd-tools libmcrypt-dev mcrypt
The following NEW packages will be installed:
libapache2-mod-php7.0 libcurl3 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libmcrypt4 libssl1.0.2
libtiff5 libvpx2 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 libxslt1.1 libzip4
php-common php7.0 php7.0-cli php7.0-common php7.0-curl php7.0-gd php7.0-intl php7.0-json
php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml php7.0-xsl
php7.0-zip
0 upgraded, 34 newly installed, 0 to remove and 20 not upgraded.
Need to get 7632 kB of archives.
After this operation, 28.9 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
libssl1.0.2 php-common php7.0-common php7.0-json php7.0-opcache php7.0-readline php7.0-cli
libapache2-mod-php7.0 libzip4 php7.0 php7.0-curl php7.0-gd php7.0-intl php7.0-mbstring
php7.0-mcrypt php7.0-mysql php7.0-xml php7.0-xsl php7.0-zip
E: There are problems and -y was used without --force-yes
请帮忙
答案1
apt-get update
在最终运行之前尝试重新运行
sudo apt-get 安装 php7.0* libapache2-mod-php7.0
没有-y
和 没有--force-yes
。