AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 695968
Accepted
dan178
dan178
Asked: 2022-03-19 06:54:18 +0800 CST2022-03-19 06:54:18 +0800 CST 2022-03-19 06:54:18 +0800 CST

处理 apache2.deb 错误“试图覆盖 /var/www/html”,这也在包 nginx-common 中

  • 772

每当我尝试运行时,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 所以删除它很好,有人知道我应该怎么做吗?

apt apache-httpd
  • 1 1 个回答
  • 83 Views

1 个回答

  • Voted
  1. Best Answer
    Stephen Kitt
    2022-03-19T08:34:53+08:002022-03-19T08:34:53+08:00

    nginx我怀疑在不一致的状态下尝试删除apache2不会有任何结果。

    相反,删除apache2:

    apt remove apache2
    

    然后清除所有nginx相关的包:

    apt purge --autoremove '*nginx*'
    

    一旦完成,

    apt install apache2
    

    应该管用。

    • 1

相关问题

  • 了解 apt 列表输出

  • 带有 apache2 配置路径错误的 SVN

  • 尝试安装 debian 软件包 npm,使 apt-get 删除 libssl-dev

  • 如何下载软件包而不是使用 apt-get 命令安装它?

  • /etc/apt/sources.list.d 比 /etc/apt/sources.list 有什么好处

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve