I am using Ubuntu 11.10 now. When I struggled to install php5 by typing
sudo apt-get install php5
I got this error:
......
Errors were encountered while processing:
libapache2-mod-php5
php5
php5-cli
E: Sub-process /usr/bin/dpkg returned an error code (1)
I've tried to do it again, but just got the same error. Then someone suggest me to remove it. I did:
sudo apt-get remove --purge php5
and got this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
php5*
0 upgraded, 0 newly installed, 1 to remove and 27 not upgraded.
3 not fully installed or removed.
After this operation, 20.5 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ...
dpkg: warning: files list file for package `firefox-locale-en' missing, assuming package has no files currently installed.
(Reading database ... 161883 files and directories currently installed.)
Removing php5 ...
Setting up libapache2-mod-php5 (5.3.6-13ubuntu3.8) ...
cp: reading `/var/lib/ucf/hashfile.5': Input/output error
dpkg: error processing libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up php5-cli (5.3.6-13ubuntu3.8) ...
cp: reading `/var/lib/ucf/hashfile.5': Input/output error
dpkg: error processing php5-cli (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php5
php5-cli
Then I tried to install just php5-cli and got this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-cli is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up libapache2-mod-php5 (5.3.6-13ubuntu3.8) ...
cp: reading `/var/lib/ucf/hashfile.5': Input/output error
dpkg: error processing libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of php5:
php5 depends on libapache2-mod-php5 (>= 5.3.6-13ubuntu3.8) | libapache2-mod-php5filter (>= 5.3.6-13ubuntu3.8) | php5-cgi (>= 5.3.6-13ubuntu3.8) | php5-fpm (>= 5.3.6-13ubuntu3.8); however:
Package libapache2-mod-php5 is not configured yet.
Package libapache2-mod-php5filter is not installed.
Package php5-cgi is not installed.
Package php5-fpm is not installed.
dpkg: error processing php5 (--configure):
dependency problems - leaving unconfigured
Setting up php5-cli (5.3.6-13ubuntu3.8) ...
No apport report written because the error message indicates its a followup error from a previous failure.
cp: reading `/var/lib/ucf/hashfile.5': Input/output error
dpkg: error processing php5-cli (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php5
php5
php5-cli
E: Sub-process /usr/bin/dpkg returned an error code (1)
I can't open php5-cli though. What's wrong and what should I do?
Open terminal and type
sudo apt-get install -f
Related
I'm new at PHP Laravel and I'm setting up Laravel by downloading the packages and Xampp in Lubuntu. When I download mysql by runing the command: sudo apt install mysql-server it shows me an error:
^[ORdpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-8.0; however:
Package mysql-server-8.0 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for systemd (245.4-4ubuntu3.11) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Errors were encountered while processing:
mysql-server-8.0
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have also tried to remove the mysql, upgrade and update sudo apt install and to install it again but still shows the same error.
Hope to help you
sudo apt-get clean
sudo apt-get purge 'mysql*'
sudo apt-get update
sudo apt-get install -f
sudo apt-get install mysql-server-8.0
sudo apt-get dist-upgrade
I am trying to install php7.2-xml for my LEMP with nginx but the problem of libapache2-mod-php7.2 is appearing. Strange that it is connected to apache while I use no apache but nginx. Anyway I cannot install the extension. How to install php7.2-xml?
mann#debian:~/Dropbox/deploy$ sudo apt-get install php7.2-xml
Reading package lists... Done
Building dependency tree
Reading state information... Done
php7.2-xml is already the newest version (7.2.8-2).
The following packages were automatically installed and are no longer required:
libargon2-0 libc-ares2 libhttp-parser2.7.1 libuv1 nodejs-doc
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1571 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libapache2-mod-php7.2 (7.2.8-2) ...
dpkg: error processing package libapache2-mod-php7.2 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php7.2
E: Sub-process /usr/bin/dpkg returned an error code (1)
mann#debian:~/Dropbox/deploy$
I am trying to install some package but getting this error evry time how I can fix it? Does`nt metter if I want to install this or other package
apt-get install mysql-server php5.6-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.5.9999+default).
The following NEW packages will be installed:
php5.6-common php5.6-mysql
0 upgraded, 2 newly installed, 0 to remove and 398 not upgraded.
4 not fully installed or removed.
Need to get 872 kB of archives.
After this operation, 4924 kB of additional disk space will be used.
Get:1 https://packages.sury.org/php jessie/main amd64 php5.6-common amd64 5.6.36-1+0~20180505045733.13+jessie~1.gbp9b5cab [730 kB]
Get:2 https://packages.sury.org/php jessie/main amd64 php5.6-mysql amd64 5.6.36-1+0~20180505045733.13+jessie~1.gbp9b5cab [142 kB]
Fetched 872 kB in 0s (1047 kB/s)
Setting up systemd (232-25+deb9u3) ...
addgroup: The group `systemd-journal' already exists as a system group. Exiting.
adduser: The user `systemd-timesync' already exists. Exiting.
dpkg: error processing package systemd (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
systemd
E: Sub-process /usr/bin/dpkg returned an error code (1)
Try sudo apt install --reinstall systemd
While trying to uninstall php7.0, I got the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'php7.0' is not installed, so not removed
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-92 linux-headers-4.4.0-92-generic linux-headers-4.4.0-93 linux-headers-4.4.0-93-generic linux-headers-4.4.0-96
linux-headers-4.4.0-96-generic linux-image-4.4.0-92-generic linux-image-4.4.0-93-generic linux-image-4.4.0-96-generic
linux-image-extra-4.4.0-92-generic linux-image-extra-4.4.0-93-generic linux-image-extra-4.4.0-96-generic
linux-signed-image-4.4.0-92-generic linux-signed-image-4.4.0-93-generic linux-signed-image-4.4.0-96-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up libapache2-mod-php7.0 (7.0.22-0ubuntu0.16.04.1) ...
dpkg: error processing package libapache2-mod-php7.0 (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of libapache2-mod-php:
libapache2-mod-php depends on libapache2-mod-php7.0; however:
Package libapache2-mod-php7.0 is not configured yet.
dpkg: error processing package libapache2-mod-php (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libapache2-mod-php7.0
libapache2-mod-php
E: Sub-process /usr/bin/dpkg returned an error code (1)
I used the following command:
sudo apt-get remove php7.0
I searched the whole internet and tried all the solutions but did not got the right solution.
This is mostly because some package or dependency got stuck in package manager.
Try the following commands (with sudo):
apt-get purge
apt-get --autoremove
apt-get --autoclean
Then try uninstalling php7.0 using the following command:
apt-get --purge remove php7.0
Initially the problem was PHP files on my server were displayed as plain text(the whole code was shown). So I found out by investigating that the MIME type has to be added to the /etc/mime.types , so I did that and also restarted my server but that didn't help solve the issue so on further investigation, I found out from here that we needed php5 module enabled and on running the apachectl -M, I couldn't find the php5 module listed. So I tried installing it and this was the outcome of it :
admin#vm:~$ sudo apt-get install php5
...
php5_invoke pdo: already enabled for apache2 SAPI
dpkg: error processing package libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php5
E: Sub-process /usr/bin/dpkg returned an error code (1)
admin#vm:~$ sudo apt-get install libapache2-mod-php5
...
dpkg: error processing package libapache2-mod-php5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libapache2-mod-php5
E: Sub-process /usr/bin/dpkg returned an error code (1)
I also need to mention that I created 2 virtual hosts for the sites. I am not sure what is wrong. Could some one help me on this?
This is not a proper solution but I re-installed Apache and it worked fine:
$ sudo apt-get purge apache2
$ sudo apt-get purge php5 libapache2-mod-php5
$ sudo apt-get purge autoremove
$ sudo apt-get install apache2 libapache2-mod-php5 php5
the package libapache2-mod-php5 comprise libphp5.so which locates at /usr/lib/apache2/modules, and php5.conf/php5.load which locate at /etc/apache2/mods-availables.
thus you could get the three files, and copy to corresponding position.
And, you should link, using ln -s, php5.conf/load to /etc/apache2/mods-enables, thus apached could find the configuration file and load the libphp5.so.
I got the same problem and resolve it