nginx-common 패키지에도 있는 apache2.deb 오류 "/var/www/html 덮어쓰기 시도" 처리

nginx-common 패키지에도 있는 apache2.deb 오류 "/var/www/html 덮어쓰기 시도" 처리

실행하려고 할 때마다 sudo apt install <package>다음과 같은 결과가 나타납니다.

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:
 apache2 : Depends: apache2-bin (= 2.4.41-4ubuntu3.9) but 2.4.41-4ubuntu3.10 is to be installed
           Depends: apache2-data (= 2.4.41-4ubuntu3.9) but 2.4.41-4ubuntu3.10 is to be installed
           Depends: apache2-utils (= 2.4.41-4ubuntu3.9)
 lollypop : Depends: python3-pylast but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

내가 실행하면 sudo apt --fix-broken install다음을 얻습니다.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  apache2
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom
The following packages will be upgraded:
  apache2
1 upgraded, 0 newly installed, 0 to remove and 228 not upgraded.
6 not fully installed or removed.
Need to get 0 B/95.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 425435 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.41-4ubuntu3.10_amd64.deb ...
Unpacking apache2 (2.4.41-4ubuntu3.10) over (2.4.41-4ubuntu3.9) ...
dpkg: error processing archive /var/cache/apt/archives/apache2_2.4.41-4ubuntu3.10_amd64.deb (--unpack):
 trying to overwrite '/var/www/html', which is also in package nginx-common 1.18.0-0ubuntu1.2
Errors were encountered while processing:
 /var/cache/apt/archives/apache2_2.4.41-4ubuntu3.10_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

편집하다: nginx 또는 nginx-common을 제거하려고 하면 다음과 같은 메시지가 나타납니다.

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:
 apache2 : Depends: apache2-bin (= 2.4.41-4ubuntu3.9) but 2.4.41-4ubuntu3.10 is to be installed
           Depends: apache2-data (= 2.4.41-4ubuntu3.9) but 2.4.41-4ubuntu3.10 is to be installed
           Depends: apache2-utils (= 2.4.41-4ubuntu3.9)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

또한 달리기를 시도했지만 sudo apt install apache2 nginx-common-다음 메시지가 나타납니다.

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-image-filter : Depends: nginx-common (= 1.18.0-0ubuntu1.2) but it is not going to be installed
 libnginx-mod-http-xslt-filter : Depends: nginx-common (= 1.18.0-0ubuntu1.2) but it is not going to be installed
 libnginx-mod-mail : Depends: nginx-common (= 1.18.0-0ubuntu1.2) but it is not going to be installed
 libnginx-mod-stream : Depends: nginx-common (= 1.18.0-0ubuntu1.2) but it is not going to be installed
 nginx-core : Depends: nginx-common (= 1.18.0-0ubuntu1.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

sudo apt install apache2 nginx-common- libnginx-mod-http-image-filter- libnginx-mod-http-xslt-filter- libnginx-mod-mail- libnginx-mod-stream- nginx-core-그런 다음 다음 결과를 얻으 려고합니다.

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:
 nginx : Depends: nginx-core (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed or
                  nginx-full (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed or
                  nginx-light (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed or
                  nginx-extras (< 1.18.0-0ubuntu1.2.1~) but it is not going to be installed
         Depends: nginx-core (>= 1.18.0-0ubuntu1.2) but it is not going to be installed or
                  nginx-full (>= 1.18.0-0ubuntu1.2) but it is not going to be installed or
                  nginx-light (>= 1.18.0-0ubuntu1.2) but it is not going to be installed or
                  nginx-extras (>= 1.18.0-0ubuntu1.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

nginx를 제거하고 비활성화하려고 시도했지만 작동하지 않는 것 같습니다. 실제로 nginx가 필요하지 않으므로 제거하면 작동합니다. 내가 무엇을 해야 하는지 아는 사람이 있습니까?

답변1

일관성이 없는 상태에서 nginxwhile을 제거하려고 하면 아무 성과도 얻지 못할 것이라고 생각됩니다 .apache2

대신 다음을 제거하십시오 apache2.

apt remove apache2

그런 다음 모든 nginx관련 패키지를 지웁니다.

apt purge --autoremove '*nginx*'

완료되면,

apt install apache2

작동해야합니다.

관련 정보