Score:0

Can't install apache Ubuntu 20.04

uz flag

I am having trouble installing apache2. This is my output when I try to install it:

Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  apache2-data apache2-utils
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-data apache2-utils
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/339 kB of archives.
After this operation, 1819 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 196569 files and directories currently installed.)
Preparing to unpack .../apache2-data_2.4.41-4ubuntu3.8_all.deb ...
Unpacking apache2-data (2.4.41-4ubuntu3.8) ...
dpkg: error processing archive /var/cache/apt/archives/apache2-data_2.4.41-4ubuntu3.8_all.deb (--unpack):
 trying to overwrite '/usr/share/apache2/error/HTTP_BAD_GATEWAY.html.var', which is also in package ea-apache24 2.4.51-1+2.1.cpanel
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../apache2-utils_2.4.41-4ubuntu3.8_amd64.deb ...
Unpacking apache2-utils (2.4.41-4ubuntu3.8) ...
dpkg: error processing archive /var/cache/apt/archives/apache2-utils_2.4.41-4ubuntu3.8_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/ab', which is also in package ea-apache24-tools 2.4.51-1+2.1.cpanel
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../apache2_2.4.41-4ubuntu3.8_amd64.deb ...
Unpacking apache2 (2.4.41-4ubuntu3.8) ...
dpkg: error processing archive /var/cache/apt/archives/apache2_2.4.41-4ubuntu3.8_amd64.deb (--unpack):
 trying to overwrite '/usr/sbin/apachectl', which is also in package ea-apache24 2.4.51-1+2.1.cpanel
Errors were encountered while processing:
 /var/cache/apt/archives/apache2-data_2.4.41-4ubuntu3.8_all.deb
 /var/cache/apt/archives/apache2-utils_2.4.41-4ubuntu3.8_amd64.deb
 /var/cache/apt/archives/apache2_2.4.41-4ubuntu3.8_amd64.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)```

I tried deleting those files in the /var/cache/apt/archives/ but I kept getting the same errors.
Nmath avatar
ng flag
What command(s) are you using? Was a different version of apache already installed?
user535733 avatar
cn flag
Your output clearly says: *Error processing package A. Trying to overwrite file F, which is also in package B*. A and B conflict, and B is already installed. Either uninstall B (usually the smart choice), or else use apt's --force option to keep both packages.
uz flag
I cannot find the package B. I tried using ```find -iname *.cpanel```
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.