I did something real dumb. I was creating tarballs of files in my /var/ folder. The tarball i created was put into /tmp/test.tar
In the process of testing the extraction process, I meant to delete /tmp/var/
but ended up doing a
rm -r on /var
via the command line.
I know... ugh.
The good news is that I only had apache2 / php5
running on this test box.
But I'm wondering if there's an easy way to recover my files? From what I've read so far in other posts, the answer is no. I'm trying to reinstall apache and php5 but of course, I'm getting errors.
I have another Ubuntu box with a similar set up... so I copied over /var/lib/dpkg
folder which got me a little further...
But now when i do an apt-get install apache2
, I get the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'apache2' has no installation candidate
I'm relatively new to Linux and am not so saavy , as you can tell! Just wondering if you had any tips on a quick recovery?
Thanks.
EDIT 1
I ran
sudo apt-get update
and it seemed to run properly.
Then I tried
$ sudo apt-get install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed.
This may mean that you have requested an impossible situation or if you are
using the unstable distribution that some required packages have not
yet been created or been moved out of Incoming. The following
information may help to resolve the situation:
The following packages have unmet dependencies:
apache2 :
Depends: apache2-bin (= 2.4.7-1ubuntu4.1) but 2.4.10-1ubuntu1 is to be installed
Depends: apache2-data (= 2.4.7-1ubuntu4.1) but 2.4.10-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.
So I tried to do the following:
test@testpc:/$ sudo apt-get install apache2-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2-bin is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
test@testpc:/$ sudo apt-get install apache2-data
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2-data is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
As you can see, it's not upgrading... Any other suggestions would be appreciated.
EDIT 2
I checked the box where I copied /var/lib/dpkg from and it's running ubuntu 14.10 whereas this one is running 14.04. Does that matter?
apt-get update
?dpkg
data is misleading your new system into thinking it has newer versions ofapache2-bin
and other things installed.