I have tried these below commands to install PHP 5.6 while installing Lampp:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql
php5.6-xml
But I am getting this error:
php5.6 is already the newest version (5.6.32-
1+ubuntu16.04.1+deb.sury.org+2).
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
21 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
/usr/bin/dpkg: error while loading shared libraries: libselinux.so.1:
cannot open shared object file: No such file or directory
E: Sub-process /usr/bin/dpkg returned an error code (127)
I tried many below links:
- E: Sub-process /usr/bin/dpkg returned an error code (1) [related to google chrome] | Ask Ubuntu
- Error while installing Apache; error is "E: Sub-process /usr/bin/dpkg returned an error code (1)" | Unix & Linux Stack Exchange
- How can I fix E: Sub-process /usr/bin/dpkg returned an error code (2)? | Ask Ubuntu
- Debian dpkg broken after apt-get upgrade | Unix & Linux Stack Exchange
But I am getting this error still, and now I am unable to use apt-get -f install
or install any other software.
Your question seems to be that you want to install php5.6, yet your system says php5.6 is already installed.
Can you use apt-get or dpkg commands at all? It looks like there is a problem with libselinux.so.1 or with the cache.
Run
ldconfig
as root. That should fix possible errors with shared libraries that are not registered properly in the cache.References:
SE: Debian dpkg broken after apt-get upgrade
SO: Resolve error while loading shared libraries: libselinux.so.1 in ubuntu 14.04 LTS
Your output actually saying you are already having PHP 5.6 latest version on your system. However try the below.
Try
apt-get autoremove
thenapt-get remove <your package>
then install again your packageapt-get install <your package
>