LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-23-2014, 05:19 PM   #1
jobart08
Member
 
Registered: Sep 2014
Posts: 74

Rep: Reputation: Disabled
/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
 
Old 10-23-2014, 05:34 PM   #2
jobart08
Member
 
Registered: Sep 2014
Posts: 74

Original Poster
Rep: Reputation: Disabled
Here is a screen cap
http://i1378.photobucket.com/albums/...ps93f49286.jpg
 
Old 10-23-2014, 06:04 PM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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.
 
Old 10-23-2014, 08:26 PM   #4
jobart08
Member
 
Registered: Sep 2014
Posts: 74

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
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.
 
Old 10-23-2014, 11:22 PM   #5
jobart08
Member
 
Registered: Sep 2014
Posts: 74

Original Poster
Rep: Reputation: Disabled
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.
 
Old 10-24-2014, 01:56 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by jobart08 View Post
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?
 
Old 10-27-2014, 01:05 AM   #7
jobart08
Member
 
Registered: Sep 2014
Posts: 74

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Habitual View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cronjob to check if file contents are missing and to remove and re-copy if missing. Spuddy Linux - General 5 03-19-2014 10:20 AM
[SOLVED] I accidentally removed all contents of /var/log - please send me your /var/log hearthstone Debian 6 12-18-2012 08:09 PM
I accidentally removed all contents of /var/log - please send me your /var/log (OT) syg00 Debian 1 12-16-2012 07:16 AM
my.cnf on debian squeeze. var names don't match, var values missing. sneakyimp Linux - Server 1 07-03-2011 01:59 AM
Who should own /var/www and it's contents? morrolan Linux - Server 4 04-03-2007 02:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration