Apache update/re-install not working

My Rpi is no longer visible on my network. As the network connection is OK, I assumed that my apache website is not working. As Apache2 restart did not help, I tried to udate/re-instal using the command below
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi

For both intsall commands I get a fatal error “…file list file for package ‘lsof’ is missing final newline”.

2 questions

  1. Am i doing something wrong in the install
  2. Is there a way to check whether my Apache2 is running and why it does not answer I access from another computer

Alvast bedankt

This means the /var/lib/dpkg/info/lsof.list file is corrupt. You should be able to cat out the file and it will be a list like the following:


It’s probably truncated, got some garbage in there, whatever. To remedy the situation, delete (mv) the file and perform the following:

sudo apt-get remove lsof --purge
sudo apt-get install libapache2-mod-php5 lsof php5 php5-cgi php5-cli php5-common php5-json php5-readline

Back up your sd card before performing this - I’m not responsible, yadda yadda. This should take care of things, at least as far as your immediate error with uninstalling/reinstalling goes.

Thanks, I will try your suggestions

I am afraid it did not work, I am going to start from the beginning :-(. I guess I will need to dive into Linux a bit deeper next time