LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /var contents missing (https://www.linuxquestions.org/questions/linux-newbie-8/var-contents-missing-4175523166/)

jobart08 10-23-2014 05:19 PM

/var contents missing
 
Recently installed a debian wheezy system and after I moved it to a different network, I encountered this issue. If I do apt-get update I get errors saying that I have folders and files missing under /var/cache and /var/lib. Can I use recovery mode to fix this or do I have to do a rebuild of the system?

Thanks

jobart08 10-23-2014 05:34 PM

Here is a screen cap
http://i1378.photobucket.com/albums/...ps93f49286.jpg

Habitual 10-23-2014 06:04 PM

you could try as root:
Code:

mkdir -pv /var/cache/apt/archives/partial/
touch /var/lib/dpkg/lock

drwxr-xr-x 2 root root 4096 Oct 23 2014 8:23 AM /var/cache/apt/archives/partial/
-rw-r----- 1 root root 0 Oct 23 2014 8:24 AM /var/lib/dpkg/lock

755 for /var/cache/apt/archives/partial/
640 for the lock file.

then I'd try a
Code:

apt-get update
again.

jobart08 10-23-2014 08:26 PM

Quote:

Originally Posted by Habitual (Post 5258533)
you could try as root:
Code:

mkdir -pv /var/cache/apt/archives/partial/
touch /var/lib/dpkg/lock

drwxr-xr-x 2 root root 4096 Oct 23 2014 8:23 AM /var/cache/apt/archives/partial/
-rw-r----- 1 root root 0 Oct 23 2014 8:24 AM /var/lib/dpkg/lock

755 for /var/cache/apt/archives/partial/
640 for the lock file.

then I'd try a
Code:

apt-get update
again.

Thanks Habitual! It allowed my system to update and upgrade. But I got another error:

Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/Debconf/DbDriver/File. chunk3.
Use of uninitialized value in -e at /usr/share/perl5/Debconf/DbDriver/File.pm line 46. <DEBCONF_CONF.
Use of uninitialized value in pattern match (m//) at /usr/share/perl5/Debconf/DbDriver/File.pm line..
Use of unintialized value $directory in -d at /usr/share/perl5/Debconf/DbDriver/File.pm line 48, <DBCONF_CONFIG> chunk 3.
debconf: DbDriver "config": mkdir :No such file or directory
dpkg: error: cannot scan updates directory `/var/lib/dpkg/updates/': No such file or directory
E: Sub-process /usr/bin/dpkg returned an error code (2)

Also, when I try to ssh to another server, I get a bunch of error messages similar to this:
/etc/ssh/ssh_config: line 8: Bad configuration option: ListenAddress

/etc/ssh/ssh_config: terminating. 20 bad configuration options

But I never touched ssh_config. Only sshd_config file.

Thanks again for your help.

jobart08 10-23-2014 11:22 PM

Ok, a teammate of mine suggested that I just copy the contents of /var from an identical server to this one. It's working, so far. As for the ssh issue, it turns out that my ssh_config is a copy of the ssd_config which was causing the issue. I got around it by copying the ssh_config from the identical server and it's now working. I just hope it did fix the issue.

Habitual 10-24-2014 01:56 PM

Quote:

Originally Posted by jobart08 (Post 5258615)
Ok, a teammate of mine suggested that I just copy the contents of /var.

Yeah, about 'that', No. No 2 systems are identical, ever.

How hard would it be to re-install?

jobart08 10-27-2014 01:05 AM

Quote:

Originally Posted by Habitual (Post 5258962)
Yeah, about 'that', No. No 2 systems are identical, ever.

How hard would it be to re-install?

That'll be my last resort. This is just a test server so if it still doesn't fly, I'll probably reinstall.


All times are GMT -5. The time now is 12:14 PM.