How can I get back /usr/local/lib
? I accidentally deleted it.
I ran sudo rm -Rf lib
inside /usr/local/
.
I am using 12.04.
How can I get back /usr/local/lib
? I accidentally deleted it.
I ran sudo rm -Rf lib
inside /usr/local/
.
I am using 12.04.
The standard use of /usr/local/lib
is to store library files installed from software built from source. It is standard to store the source code in /usr/local/src
.
Assuming this is the way the folder was used, you can simply reinstall the software that provided the library files.
Most of the time, software is built something like this:
./configure
make
sudo make install
Those commands are run from inside the particular program's source directory, which is typically a subdirectory of /usr/local/src
.
So, just go back there (for each program or library installed, as even applications may provide files stored in /usr/local/lib
) and run sudo make install
again.
If you had run make clean
or make distclean
inside the source directory after installing (which is generally inadvisable, even though many bloggers recommend it, because it saves a bit of space but at the cost of making it difficult to reinstall or uninstall), you'll have to build from source again.
If you didn't keep the source code at all, you'll have to redownload it, unpack it, and install it, as you had done before.
Even in the worst case scenario where you are not sure what programs you had installed from source, it's still usually much easier to figure that out than to use generic file recovery methods. Such methods are usually difficult and time consuming and only give you back part of what you had hoped to recover; the libraries in /usr/local/lib
, and whatever programs depend on them, would likely not run correctly.