安装 Nginx 旧版本 1.4.6 问题

安装 Nginx 旧版本 1.4.6 问题

安装 nginx 时,它需要依赖包,如 nginx-core、nginx-full、nginx-nasxi 等。在我安装 nginx-core 和 nginx-common 后,其余包由于与 nginx-core 冲突而拒绝安装。'主' nginx_1.4.6 包也'忘记'了对 nginx-full、nginx-nasxi 等的依赖。我拥有所有 nginx 包的相同版本。

让我告诉你我的意思。

root@test-udprf:/home/a.bolshedvorskii# dpkg -i nginx_1.4.6-1ubuntu3_all.deb
Selecting previously unselected package nginx.
(Reading database ... 37454 files and directories currently installed.)
Preparing to unpack nginx_1.4.6-1ubuntu3_all.deb ...
Unpacking nginx (1.4.6-1ubuntu3) ...
dpkg: dependency problems prevent configuration of nginx:
 nginx depends on nginx-core (>= 1.4.6-1ubuntu3) | nginx-full (>= 1.4.6-1ubuntu3) | nginx-light (>= 1.4.6-1ubuntu3) | nginx-extras (>= 1.4.6-1ubuntu3) | nginx-naxsi (>= 1.4.6-1ubuntu3); however:
  Package nginx-core is not installed.
  Package nginx-full is not installed.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.
  Package nginx-naxsi is not installed.
 nginx depends on nginx-core (<< 1.4.6-1ubuntu3.1~) | nginx-full (<< 1.4.6-1ubuntu3.1~) | nginx-light (<< 1.4.6-1ubuntu3.1~) | nginx-extras (<< 1.4.6-1ubuntu3.1~) | nginx-naxsi (<< 1.4.6-1ubuntu3.1~); however:
  Package nginx-core is not installed.
  Package nginx-full is not installed.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.
  Package nginx-naxsi is not installed.

dpkg: error processing package nginx (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 nginx
root@test-udprf:/home/a.bolshedvorskii# dpkg -i nginx-core_1.4.6-1ubuntu3_amd64.deb
Selecting previously unselected package nginx-core.
(Reading database ... 37459 files and directories currently installed.)
Preparing to unpack nginx-core_1.4.6-1ubuntu3_amd64.deb ...
Unpacking nginx-core (1.4.6-1ubuntu3) ...
dpkg: dependency problems prevent configuration of nginx-core:
 nginx-core depends on nginx-common (= 1.4.6-1ubuntu3); however:
  Package nginx-common is not installed.

dpkg: error processing package nginx-core (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 nginx-core
root@test-udprf:/home/a.bolshedvorskii# dpkg -i nginx-common_1.4.6-1ubuntu3_all.deb
Selecting previously unselected package nginx-common.
(Reading database ... 37465 files and directories currently installed.)
Preparing to unpack nginx-common_1.4.6-1ubuntu3_all.deb ...
Unpacking nginx-common (1.4.6-1ubuntu3) ...
Setting up nginx-common (1.4.6-1ubuntu3) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /lib/systemd/system/nginx.service.
insserv: warning: script 'cgroups' missing LSB tags
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cgroups'
insserv: Default-Stop  undefined, assuming empty stop runlevel(s) for script `cgroups'
Processing triggers for man-db (2.9.4-2) ...
root@test-udprf:/home/a.bolshedvorskii# dpkg -i nginx-core_1.4.6-1ubuntu3_amd64.deb
(Reading database ... 37499 files and directories currently installed.)
Preparing to unpack nginx-core_1.4.6-1ubuntu3_amd64.deb ...
Unpacking nginx-core (1.4.6-1ubuntu3) over (1.4.6-1ubuntu3) ...
Setting up nginx-core (1.4.6-1ubuntu3) ...
root@test-udprf:/home/a.bolshedvorskii# dpkg -i nginx-full_1.4.6-1ubuntu3_amd64.deb
dpkg: regarding nginx-full_1.4.6-1ubuntu3_amd64.deb containing nginx-full:
 nginx-full conflicts with nginx-core
  nginx-core (version 1.4.6-1ubuntu3) is present and installed.

dpkg: error processing archive nginx-full_1.4.6-1ubuntu3_amd64.deb (--install):
 conflicting packages - not installing nginx-full
Errors were encountered while processing:
 nginx-full_1.4.6-1ubuntu3_amd64.deb
root@test-udprf:/home/a.bolshedvorskii# dpkg --configure nginx-core
dpkg: error processing package nginx-core (--configure):
 package nginx-core is already installed and configured
Errors were encountered while processing:
 nginx-core
root@test-udprf:/home/a.bolshedvorskii# dpkg -i nginx_1.4.6-1ubuntu3_all.deb
(Reading database ... 37499 files and directories currently installed.)
Preparing to unpack nginx_1.4.6-1ubuntu3_all.deb ...
Unpacking nginx (1.4.6-1ubuntu3) over (1.4.6-1ubuntu3) ...
Setting up nginx (1.4.6-1ubuntu3) ...

什么原因导致了这个问题?

编辑:nginx-common 之后安装的任何包都会阻止其他包。

root@test-udprf:/home/a.bolshedvorskii# dpkg -i nginx-naxsi_1.4.6-1ubuntu3_amd64.deb
dpkg: regarding nginx-naxsi_1.4.6-1ubuntu3_amd64.deb containing nginx-naxsi:
 nginx-naxsi conflicts with nginx-light
  nginx-light (version 1.4.6-1ubuntu3) is present and installed.

dpkg: error processing archive nginx-naxsi_1.4.6-1ubuntu3_amd64.deb (--install):
 conflicting packages - not installing nginx-naxsi
Errors were encountered while processing:
 nginx-naxsi_1.4.6-1ubuntu3_amd64.deb

答案1

什么原因导致了这个问题?

问题是你安装的版本nginx不是为你的系统构建的(无论你使用的是哪个受支持的 Ubuntu 版本)。这会导致依赖性问题。

对旧版本软件的研究实际上不应该在主系统上进行。最好使用虚拟机或容器来完成。这也使得定制旧版本以匹配您的环境更加合适。

安装此类旧应用程序的正确方法是从源代码构建进入您当前的环境。

相关内容