This error is on a Nethunter install but didn't get any workable ideas over there so thought I'd try here. Should be same as regular Kali. It must be a permissions issue but I can't figure it out.
Got everything updated except apache2. Seems it has dependency issues. tells me to use apt-get install -f. that tries then returns
"errors were encountered while processing:
/var/cache/apt/archives/apache2_2.4.10+deb8u1_armhf.deb
E:Sub-process /usr/bin/dpkg returned an error code (1)"
There's nothing wrong with /var/cache/apt/archives/apache2_2.4.10+deb8u1_armhf.deb I renamed it, it refetched and gave same errors. error appears to be in trying to overwrite /etc/apache2/sites-available/000-default.conf > I tried renaming this to .old and it still gives same error.
Here's some outputs:
root@kali:~# apt-get -f install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
apache2.2-bin apache2.2-common libclass-isa-perl libdrm-nouveau1a
libswitch-perl libsystemd-login0 sqlite3
Use 'apt-get autoremove' to remove them.
Suggested packages:
www-browser apache2-doc apache2-suexec-pristine apache2-suexec-custom
The following packages will be upgraded:
apache2
1 upgraded, 0 newly installed, 0 to remove and 800 not upgraded.
3 not fully installed or removed. Need to get 0 B/205 kB of archives.
After this operation, 355 kB of additional disk space will be used. (Reading database ... 136890 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.10-10+deb8u1_armhf.deb ...
Obsolete conffile /etc/apache2/mods-available/authz_default.load has been modified by you.
Saving as /etc/apache2/mods-available/authz_default.load.dpkg-bak ...
Obsolete conffile /etc/apache2/mods-available/authn_default.load has been modified by you.
Saving as /etc/apache2/mods-available/authn_default.load.dpkg-bak ...
Obsolete conffile /etc/apache2/mods-available/mem_cache.load has been modified by you.
Saving as /etc/apache2/mods-available/mem_cache.load.dpkg-bak ...
Obsolete conffile /etc/apache2/mods-available/mem_cache.conf has been modified by you.
Saving as /etc/apache2/mods-available/mem_cache.conf.dpkg-bak ...
Obsolete conffile /etc/apache2/mods-available/authn_alias.load has been modified by you.
Saving as /etc/apache2/mods-available/authn_alias.load.dpkg-bak ...
Obsolete conffile /etc/apache2/mods-available/cern_meta.load has been modified by you.
Saving as /etc/apache2/mods-available/cern_meta.load.dpkg-bak ...
Obsolete conffile /etc/apache2/mods-available/disk_cache.load has been modified by you.
Saving as /etc/apache2/mods-available/disk_cache.load.dpkg-bak ...
Obsolete conffile /etc/apache2/mods-available/disk_cache.conf has been modified by you.
Saving as /etc/apache2/mods-available/disk_cache.conf.dpkg-bak ...
Obsolete conffile /etc/apache2/mods-available/imagemap.load has been modified by you.
Saving as /etc/apache2/mods-available/imagemap.load.dpkg-bak ...
Unpacking apache2 (2.4.10-10+deb8u1) over (2.2.22-13+deb7u6) ...
dpkg: error processing archive /var/cache/apt/archives/apache2_2.4.10-10+deb8u1_armhf.deb (--unpack):
trying to overwrite '/etc/apache2/sites-available/000-default.conf', which is also in package mana-toolkit 0~20140915-0kali2
Reinstalling /etc/apache2/mods-available/authz_default.load that was backupped
Reinstalling /etc/apache2/mods-available/authn_default.load that was backupped
Reinstalling /etc/apache2/mods-available/mem_cache.load that was backupped
Reinstalling /etc/apache2/mods-available/mem_cache.conf that was backupped
Reinstalling /etc/apache2/mods-available/authn_alias.load that was backupped
Reinstalling /etc/apache2/mods-available/cern_meta.load that was backupped
Reinstalling /etc/apache2/mods-available/disk_cache.load that was backupped
Reinstalling /etc/apache2/mods-available/disk_cache.conf that was backupped
Reinstalling /etc/apache2/mods-available/imagemap.load that was backupped
Reinstalling /etc/bash_completion.d/apache2.2-common that was moved away
Reinstalling /etc/apache2/sites-available/default that was moved away
Reinstalling /etc/apache2/sites-available/default-ssl that was moved away
Reinstalling /etc/apache2/conf.d/charset that was moved away
Reinstalling /etc/apache2/conf.d/localized-error-pages that was moved away
Reinstalling /etc/apache2/conf.d/other-vhosts-access-log that was moved away
Reinstalling /etc/apache2/conf.d/security that was moved away
Restoring backup of /usr/share/doc/apache2 ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
/var/cache/apt/archives/apache2_2.4.10-10+deb8u1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@kali:~#
Note- apt-get -f install (without specifying apache2) gives same mess.
root@kali:~# ls -lah /etc/apache2/sites-available
total 60K
drwxrwxr-x. 2 root root 4.0K Dec 11 02:38 .
drwxr-xr-x. 7 root root 4.0K Dec 11 02:38 ..
-rw-r--r--. 1 root root 1.3K Sep 14 2014 000-default.conf
-rw-r--r--. 1 root root 610 Sep 14 2014 accounts.google.conf
-rw-r--r--. 1 root root 4.8K Sep 14 2014 apple.conf
-rw-r--r--. 1 root root 607 Sep 14 2014 blackberry.conf
-rw-r--r--. 1 root root 692 Dec 22 2014 default
-rw-r--r--. 1 root root 7.1K Dec 22 2014 default-ssl
-rw-r--r--. 1 root root 646 Sep 14 2014 facebook.conf
-rw-r--r--. 1 root root 601 Sep 14 2014 gmail.com.conf
-rw-r--r--. 1 root root 1.5K Sep 14 2014 google.conf
-rw-r--r--. 1 root root 747 Sep 14 2014 secure-redirect.conf
-rw-r--r--. 1 root root 593 Sep 14 2014 windows.conf
root@kali:~#
root@kali:~# apt-get remove --purge apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
apache2-mpm-prefork : Depends: apache2 (= 2.4.10-10+deb8u1) but it is not going to be installed
apache2.2-common : Depends: apache2 (>= 2.3~) but it is not going to be installed
libapache2-mod-php5 : Depends: apache2 (>= 2.4) but it is not going to be installed
mana-toolkit : Depends: apache2 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@kali:~#
root@kali:~# apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
apache2 : Depends: apache2-mpm-worker (= 2.2.22-13+deb7u6) but it is not installed or
apache2-mpm-prefork (= 2.2.22-13+deb7u6) but 2.4.10-10+deb8u1 is installed or
apache2-mpm-event (= 2.2.22-13+deb7u6) but it is not installed or
apache2-mpm-itk (= 2.2.22-13+deb7u6) but it is not installed
Depends: apache2.2-common (= 2.2.22-13+deb7u6) but 2.4.10-10 is installed
apache2-mpm-prefork : Depends: apache2 (= 2.4.10-10+deb8u1) but 2.2.22-13+deb7u6 is installed
apache2.2-common : Depends: apache2 (>= 2.3~) but 2.2.22-13+deb7u6 is installed
libapache2-mod-php5 : Depends: apache2 (>= 2.4) but 2.2.22-13+deb7u6 is installed
E: Unmet dependencies. Try using -f.
root@kali:~#