pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to remove all packages?



On Sun, Apr 10, 2011 at 8:12 PM, Ray Phillips <r.phillips%uq.edu.au@localhost> 
wrote:
> I've tried to upgrade a NetBSD/amd64 5.0.1 machine which had the
> x11/kdebase3 package from a a couple of years ago installed to NetBSD/amd64
> 5.1 with x11/kdebase4-4.5.4 from the 2010Q4 package collection, but
> something has gone wrong and KDE doesn't work properly.
>
> I'd now like to start from scratch as far as the packages go but without
> reinstalling NetBSD itself.  Will deleting these directories:
>
> /usr/pkg
> /var/db/pkg
> /var/db/pkg.refcount
>
> completely remove the packages that were installed and any reference to
> them?

That's not the first thing to do, no.

Well, this begs the obvious question, did you remove or try to remove
the packages using pkg_delete?

There are also some packages that don't want to be removed once they
are installed, usually they start with pkg*.

You can do this a few times, assuming you're using a bourne shell:

# for pkg in `pkg_info | awk '{print $1}'` ; do pkg_delete $pkg ; done

You'll probably have to run through that a few times while it figures
out dependencies. You can use one of the "force" options with
pkg_delete, but I prefer not to.

When you're done, there might be 1 or 2 packages left that don't want
to get uninstalled, but this should be good enough to start over with
building or installing new packages.

Andy


Home | Main Index | Thread Index | Old Index