I want to reinstall Linux OS, and before that, I think I will partition my hard disk again. (I just use a simple one partition / for root, and make Linux automatically put all other directories there).

I often save software installations in /usr/local. So, my question is: suppose I create a new partition, /usr/local, and save data there; if I reinstall Linux again, can I continue to use this software and not need to install again?

I'm new to Linux World, so I'm not sure of these things.


My suggestion on this was, make a backup of whole root fs (including /usr/local), then re-partition, mount all partition, and extract everything.

After that all your files would stand, and your disk got re-partitioned.

If you simply backup /usr/local, there's a risk that once your system libraries get updated, those software (non-static ones) might need re-linking.


You use both the phrase data and software. Generally,

  1. you can save data (files you created)
  2. you have to re-install software

If you download and compiled your own packages, and you put everything for them in /usr/local, then yes, you can probably save the software as well. But if you link them against shared libraries, you may still have issues if those libraries are outside of /usr/local and change when you re-install.

If you install software using your distributions package manager then you're probably going to need to re-install those packages, but you can save data in any partition you don't format.


If you partition your disk, you'll loose everything in /usr/local.

As to the real question, you certainly can continue using the software in usr/local. But be aware that your package manager doesn't know about it, and can very well update (or even delete) packages that something in /usr/local needs, and so it can stop working at any time.

  • I would phrase this the other way around. The package manager, for better or for worse, will not touch your stuff in /usr/local. If it depends on something elsewhere in the /usr filesystem like /usr/lib or /usr/bin it could still break, but if it's all statically linked, for example, you should be perfectly fine. – tripleee Jan 24 '13 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.