how to delete /usr/local

Hi I lost my usb sticks to reinstall Freebsd. I lost my X so I need to delete /usr/local/ and start again from there. I don't care about /usr/local/etc
 
Stop any installed software running that was installed from packages/ports, scripts that are located in /usr/local/etc/rc.d that are enabled in /etc/rc.conf. And then you can rm -rf /usr/local and /var/db/pkg/local.sqlite.

This will delete all files that were installed by package/port installation, and also the package database. So it will be as if you never installed any software other than the base installation.
 
This will delete all files that were installed by package/port installation, and also the package database. So it will be as if you never installed any software other than the base installation.

Not quite. There are things like userids and groups in /etc/ that were made by port installations. They shouldn't do any harm, though.
 
This is my remove script,
Code:
pkg clean
pkg clean -a
pkg info | awk '{print $1}' | grep -v "pkg-" | xargs -I {} pkg remove -f -y {}
pkg remove -f pkg
cd /usr/local
#rm -vfR bin include lib libexec man sbin zap
 
Back
Top