Friday, January 7, 2022

[SOLVED] dpkg: unrecoverable fatal error ('apache2-bin' is missing )

Issue

Simply trying to install php5-curl via terminal....

parisa@parisa-VirtualBox ~ $ sudo dpkg --configure -a
parisa@parisa-VirtualBox ~ $ sudo apt-get install php5-curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
 php5-curl
0 upgraded, 1 newly installed, 0 to remove and 571 not upgraded.
Need to get 0 B/27,3 kB of archives.
After this operation, 142 kB of additional disk space will be used.
Selecting previously unselected package php5-curl.
dpkg: unrecoverable fatal error, aborting:
 files list file for package 'apache2-bin' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

and get this error??


Solution

Try to reinstall apache2 package:

apt-get remove apache2 --purge
apt-get install apache2

The other option is to move dpkg info files to some temp location:

sudo mv /var/lib/dpkg/info/apache2* /some/location/path

and then

sudo apt-get install apache2 --reinstall


Answered By - Lemonov