Solved Deleted /usr folder

Hi everybody!
I'm new in FreeBSD world (always used Linux) and I'm really enjoying it :)
I was playing with some configurations when I deleted part of /usr folder. Now I don't have anymore commands like tar, xz, cut, uname.....
How can I restore them? I tried to look in the packages but I wasn't able to find them
 
Yes.... That is the answer I was afraid of XD
There should be a way to reinstall all this programs. I mean, somehow the installation process copies them somewhere form the installation disk, doesn't it?
Moreover, I don't need all of them, by now I only need grep, tar, uname and cut
 
The installer unpacks base.txz which you can find e.g. here for FreeBSD 10.2/am64: http://ftp.de.freebsd.org/pub/FreeBSD/releases/amd64/10.2-RELEASE/base.txz

(What follows might be bad advice. I never had to do this but this is what I would try before reinstalling.)

Be careful when unpacking it. You can try something like this: /rescue/tar -C / -xvf base.txz usr

Afterwards you might need to rerun freebsd-update fetch install, because base.txz does not include updates. Also reinstall every package in case files from /usr/local were deleted too: pkg-static upgrade -f

Moreover, I don't need all of them, by now I only need grep, tar, uname and cut
There are statically linked versions of those tools in /rescue, which can help you to restore your system. If you removed files from the base system you want to restore every single one of them if you want your system to work as intended.
 
Do not routinely log in as root. A normal user is not able to delete important system directories.
Also, make backups. Seriously.

After a problem like this, I would update from source to make sure there are no lurking problems waiting to be an unpleasant surprise in a few months.
 
Back
Top