我需要安装php7.0-cli到没有连接到互联网的cerver。 为此,我尝试从以下源代码包下载并安装php7.0-cli:
https://pkgs.org/download/php70-php-cli
但是当我执行下面的命令:
sudo rpm -Uvh /opt/lampp/htdocs/php70-php-cli-7.0.21-1.el7.remi.x86_64.rpm
它说:
error: Failed dependencies: php70-php-common(x86-64) = 7.0.21-1.el7.remi is needed by php70-php-cli-7.0.21-1.el7.remi.x86_64
所以它需要到目前为止:
php70-php-common-7.0.21-1.el7.remi.x86_64.rpm php70-php-json-7.0.21-1.el7.remi.x86_64.rpm php70-runtime-1.0-5.el7.remi.x86_64.rpm
我也下载并尝试安装。 问题是这样的
php70-php-json-7.0.21-1.el7.remi.x86_64.rpm
要求
php70-php-common-7.0.21-1.el7.remi.x86_64.rpm
而这又要求
php70-php-json-7.0.21-1.el7.remi.x86_64.rpm
等等。 所以问题是如何在未连接到互联网的CentOS机器上安装php7.0-cli? 也许有一些准备好的软件包已经与所有需要的东西php7.0-cli容易离线安装? 我是否需要手动下载所需的所有软件包? 也许有一个完整的PHP软件包,可以下载并安装到服务器离线?
谢谢。
把所有的文件放在一个目录中,并同时安装它们
yum install /path/php*rpm
所以依赖性解决scheme可以考虑您想要同时安装的所有内容。
从最新的dnf Fedora26机器。
注意: recursion选项在编写时会返回192个包。
dnf install 'dnf-command(repoquery)' 'dnf-command(download)' mkdir -p /tmp/repo/Packages && cd $_ PKGS=$(dnf --quiet \ --disablerepo='*' \ --enablerepo=centos \ --repofrompath centos,http://mirror.centos.org/centos/7/os/x86_64/ \ --enablerepo=remi \ --repofrompath remi,http://rpms.remirepo.net/enterprise/7/safe/x86_64/ \ repoquery \ --requires php70-php-cli \ --resolve --recursive) dnf --disablerepo='*' \ --enablerepo=centos \ --repofrompath centos,http://mirror.centos.org/centos/7/os/x86_64/ \ --enablerepo=remi \ --repofrompath remi,http://rpms.remirepo.net/enterprise/7/safe/x86_64/ \ download \ $PKGS dnf clean packages cd /tmp/repo/ createrepo .
复制/ tmp / repo目录到CentOS7机器并添加一个新的local.repo
[local] baseurl=file:///tmp/repo/ enabled=1 gpgcheck=0