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
Stefan

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:

/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/lsof
/usr/share/doc/lsof/changelog.Debian.gz
/usr/share/doc/lsof/00FAQ.gz
/usr/share/doc/lsof/examples
/usr/share/doc/lsof/examples/00MANIFEST
/usr/share/doc/lsof/examples/xusers.awk
/usr/share/doc/lsof/examples/big_brother.perl5.gz
/usr/share/doc/lsof/examples/list_fields.perl.gz
/usr/share/doc/lsof/examples/shared.perl5.gz
/usr/share/doc/lsof/examples/sort_res.perl5
/usr/share/doc/lsof/examples/idrlogin.perl.gz
/usr/share/doc/lsof/examples/list_fields.awk.gz
/usr/share/doc/lsof/examples/watch_a_file.perl
/usr/share/doc/lsof/examples/list_NULf.perl5.gz
/usr/share/doc/lsof/examples/identd.perl5
/usr/share/doc/lsof/examples/idrlogin.perl5.gz
/usr/share/doc/lsof/examples/00README
/usr/share/doc/lsof/examples/count_pf.perl5
/usr/share/doc/lsof/examples/count_pf.perl
/usr/share/doc/lsof/README.Debian
/usr/share/doc/lsof/00LSOF-L
/usr/share/doc/lsof/copyright
/usr/share/doc/lsof/changelog.gz
/usr/share/doc/lsof/00QUICKSTART.gz
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/lsof.8.gz
/usr/bin
/usr/bin/lsof

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

Stefan