Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-04-2008, 01:53 PM   #1
Registered: Aug 2005
Distribution: Debian Stable
Posts: 218

Rep: Reputation: 17
Reformat but keep my apt-get downloads in /var?

How do I reformat my computer with Debian but keep the .debs I recently obtained through apt-get?

I tried installing a couple things from source recently, and it appears doing so crashed a few apps for good. I can't revive them, so I figure I broke parts of my system.

Now, I have the drive partitioned like this:

/hda1/ = /
/hda5/ = /home
/hda6/ = /usr
/hda7/ = /var
/hda8/ = (free space: 20 GB)

I want to reformat 1, 5, and 6, but I want to keep the packages I've aptgetted in /var. In the past I would have weird issues such as some error about HAL and whatnot if I manually tried editting fstab to get a reformatted OS to accept what's in hda7. So, how do I get the reformatted OS inside the drive but keep my old var?
Old 08-04-2008, 03:25 PM   #2
Registered: Oct 2006
Location: London
Distribution: Arch
Posts: 183

Rep: Reputation: 31
If it gives you errors, I can't really see a way around it. Perhaps you could copy them to a removable disk and then copy them back again, or if that is not fiesable, create a directory under /home, copy them there temporarily and then move them back across, or perhaps utilise that empty 20GB partition there.

Using Arch, I personally create a seperate partition for the cache directory (/var/cache/pacman/pkg). Then I mount this partition under the correct folder. This saves loads of time when reinstalling, which I do loads, because I often get bored and trash my system (last reinstall was this morning ). Whenever I format, I just avoid formatting this partition. Works every time.
Old 08-04-2008, 03:56 PM   #3
LQ Guru
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Have you tried just making a back-up of your debs and then moving them back after formating? Alternatively, you could instruct the install to install /var on your / partition, then edit it to use the partition you already had. That should work, I have done similar things numerous times before, like moving an install to a different part of the drive or even an entirely different drive, or putting swap, tmp and var on a single partition. It seems to me that much depends on how it is done. I did run into permission issues the first times I tried it because of using the wrong options to cp.

Last edited by jay73; 08-04-2008 at 04:00 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Apt-Get Downloads Extremely Slow bburgy Linux - Software 1 08-06-2006 10:00 PM
/var/cache/apt/archives/lock error digsby0007 Linux - Software 3 06-23-2006 07:17 AM
remove /var/cache/apt files bhomass Debian 2 02-22-2006 08:52 PM
Apt downloads horrible dl rates? Jukas Debian 3 10-04-2005 06:50 PM
apt-get dist-upgrade downloads slower than d4x exit3219 Debian 4 09-01-2005 07:23 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:43 PM.

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