On 2020-11-28, Gregory Edigarov <ediga...@qarea.com> wrote:
> #!/bin/sh
> rm -rf /usr/local/*  /var/db/pkg/* /var/db/pkg/.* /etc/rc.d/*_daemon

There are only 3 packages with /etc/rc.d/*_daemon files.. also
you aren't putting /usr/local/lib/X11/app-defaults back how it should
be, and you miss creating the directory structure under /usr/local
which may mean that dirs get readded with inappropriate ownership/
permissions. You can fix these up like so,

mtree -qdef /etc/mtree/4.4BSD.dist -p / -U
mkdir -p /usr/local/lib/X11
ln -fs /etc/X11/app-defaults /usr/local/lib/X11/app-defaults
ldconfig -RU

though none of this should be necessary unless files have become
corrupted beyond what pkg_check can cope with.

(also some packages install files in various places under /var that
you'll miss with your rm).

Normally pkg_add -u, pkg_delete -a, and removing most files suggested
by sysclean will do the trick nicely.

> xpdf \
> zsh ; do pkg_add  -v $i; done

this will run a bit more quickly if you add all packages in a single
pkg_add command, otherwise it will have to re-run triggers multiple
times that would otherwise just be run once.


Reply via email to