LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Can't install packages after moving /var (https://www.linuxquestions.org/questions/debian-26/cant-install-packages-after-moving-var-259246/)

zag_zag 11-25-2004 01:18 PM

Can't install packages after moving /var
 
I moved /var to another partition, and now I can't install any packages. The error I get:
Code:

# apt-get install quota
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
  quota
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/419kB of archives.
After unpacking 1122kB of additional disk space will be used.
Preconfiguring packages ...
dpkg: error processing /var/cache/apt/archives/quota_3.12-3_i386.deb (--unpack):
 failed to open package info file `/var/lib/dpkg/tmp.ci/control' for reading: No such file or directory
Errors were encountered while processing:
 /var/cache/apt/archives/quota_3.12-3_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I copied the /var directory with cp -a, and everything else seems to work besides that.

acid_kewpie 11-25-2004 02:03 PM

just plain copying will often break symlinks and all sorts, not a nice thing to do. can you ls that file? the directory it's in? maybe that's a symlink to a different location which has been broken.

zag_zag 11-25-2004 02:49 PM

As far as I know, cp -a should handle symlinks. I did this before on another system and it worked...

About the file, I can't find it in /var/lib/dpkg (I can ls this directory), but I also can't find it on another (working) Debian system I have. When should this file be generated?

zag_zag 11-25-2004 03:35 PM

Problem solved :).
For some reason, dpkg-deb got corrupted during the copy process, so package extracting didn't work.

Moloko 11-26-2004 05:21 AM

cpio is a better alternative:
# find . -xdev | cpio -pm /new/location (run from old location)

Even better is doing this on a read-only filesystem to prevent the system from updating or making files.


All times are GMT -5. The time now is 09:38 AM.