如何在 plesk 下卸载 Nginx(并重新安装)?

如何在 plesk 下卸载 Nginx(并重新安装)?

我从 OVH 租用了一台没有 Plesk 许可证的 VPS,但他们还是在未经我同意的情况下安装了 Plesk。这导致了很多问题。我做每件事都费劲,安装最新版本的 Python 3,拥有正确版本mod_wsgi或升级到 Debian Buster...

现在,我想从 Apache 迁移到 Nginx,但情况很乱。我以为首先我必须自己安装 Nginx,但由于 Plesk,它已经安装好了。我想删除它,但我的apt命令陷入了一种难以解决的相互依赖问题。

当我做:

apt-get remove nginx

结果:

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libnginx-mod-http-auth-pam : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
 libnginx-mod-http-dav-ext : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
 libnginx-mod-http-echo : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
 libnginx-mod-http-geoip : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
 libnginx-mod-http-image-filter : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
 libnginx-mod-http-subs-filter : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
 libnginx-mod-http-upstream-fair : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
 libnginx-mod-http-xslt-filter : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
 libnginx-mod-mail : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
 libnginx-mod-stream : Depends: nginx-common (= 1.14.2-2+deb10u1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

如果我尝试

apt --fix-broken install

结果:

...
Preparing to unpack .../nginx-common_1.14.2-2+deb10u1_all.deb ...
Unpacking nginx-common (1.14.2-2+deb10u1) ...
dpkg: error processing archive /var/cache/apt/archives/nginx-common_1.14.2-2+deb10u1_all.deb (--unpack):
 trying to overwrite '/etc/default/nginx', which is also in package sw-nginx 1.16.1.3-debian8.0.19111813
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

Preparing to unpack .../nginx-full_1.14.2-2+deb10u1_amd64.deb ...
Unpacking nginx-full (1.14.2-2+deb10u1) ...
dpkg: error processing archive /var/cache/apt/archives/nginx-full_1.14.2-2+deb10u1_amd64.deb (--unpack):
 trying to overwrite '/usr/sbin/nginx', which is also in package sw-nginx 1.16.1.3-debian8.0.19111813
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
...

结果相同sudo apt-get install -f nginx-common nginx-full

注意:

ls /etc/default/nginx
ls: cannot access '/etc/default/nginx': No such file or directory

因为我移动了它,所以没有什么可以覆盖 :/

我尝试使用以下命令删除这些包:

sudo apt-get remove libnginx* --purge

它给:

Package 'libnginx-mod-http-cache-purge' is not installed, so not removed
Package 'libnginx-mod-http-fancyindex' is not installed, so not removed
Package 'libnginx-mod-http-headers-more-filter' is not installed, so not removed
Package 'libnginx-mod-http-lua' is not installed, so not removed
Package 'libnginx-mod-http-ndk' is not installed, so not removed
Package 'libnginx-mod-http-perl' is not installed, so not removed
Package 'libnginx-mod-http-uploadprogress' is not installed, so not removed
Package 'libnginx-mod-nchan' is not installed, so not removed
Package 'libnginx-mod-rtmp' is not installed, so not removed

sudo apt-get autoremove nginx给出了相同的结果。我真的被这个问题困扰了。

dpkg -l | grep "libnginx-mod-http-cache-purge"不返回任何内容。

如果我进行搜索,/var/lib/dpkg/status我也找不到那些包。

我也跑:

dpkg --configure -a

但它会导致以下类型的错误:

...
dpkg: error processing package libnginx-mod-http-echo (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnginx-mod-http-subs-filter:
 libnginx-mod-http-subs-filter depends on nginx-common (= 1.14.2-2+deb10u1); however:
  Package nginx-common is not installed
...

我想要一个干净的 Nginx 安装,我原来的安装已经损坏,我希望能够随时轻松更新它。我该怎么办?

相关内容