Don't ever try to recover system files
Oh please, don't ever recommend file recovery for system files!
File recovery can be attempted on more unique files like a text you've written yourself.
Recovering system files is begging for troubles.
For your system, just reinstall it. You don't need to wipe/format anything during the installation: everything missing will just be replaced. You will just have to upgrade as usual.
But this shouldn't be necessary as
/usr/local is most certainly empty on your system.
Usually, there is almost nothing in that folder. If you know that you have installed something there, just reinstall it.
Finally, some packages might have put some files in there. Just open a terminal and check that the following commands outputs nothing:
dpkg --get-selections | cut -f 1 | xargs dpkg -L | grep /usr/local
What it does is pretty simple:
will output the list of the packages installed on your system in the format:
But we only want
package_name for each line:
| cut -f 1
bash (the program that runs in the terminal) that the output of the previous command should not be displayed but "piped" inside the next program (here
cut, as its name implies will cut each line into words an keep only the first field (
-f 1) that it will display.
To sum up,
dpkg --get-selections | cut -f 1
should return the list of the packages installed on your system.
Now we can pipe that list to
xargs which acts like "for each element in the list do ...".
xargs dpkg -L
dpkg -L package1
dpkg -L package2
dpkg -L package3
for each package name that you give it through the pipe.
dpkg -L mypackage lists the files contained in the package named "mypackage".
And now, we just have to take that file list and check whether some package did put a file in
/usr/local. We do it with
grep which will filter out any output not containing
So, if we put it in order, first we get the list of installed packages, then we format this list to keep only the package names, then we list the installation folders used by the package, then we filter it to keep only what's inside of
If the command returns nothing, then you don't need to worry.
Graphical UI alternative
To my knowledge, there is no GUI alternative.