On Sat, Nov 28, 2020, at 9:40 AM, Gregory Edigarov wrote: > > > On 11/25/20 3:26 PM, Manuel Giraud wrote: > > Hi, > > > > I'd like to upgrade (on -current) and, in the process, remove some cruft > > accumulated over the years. I usually do sysupgrade and sysclean for > > system. > > > > But for packages, I think I would be better to reinstall everything > > since "pkg_check -F" does not seems to complain and I can see I have, > > for example, some firefox-57 files left. > > > > I think I could do the following but I don't know if it is safe: > > - sysupgrade (+ sysclean) > > - pkg_info -mz > mypkg > > - umount /usr/local > > - newfs partition_of_usr_local > > - mount /usr/local > > - pkg_add -l mypkg > > > > Or maybe, I should dump, do a complete reinstall, pkg_add -l mypkg, > > restore /home and, tediously, restore some /etc files. > > How would you do this? > Here's what I found easy to do periodically on my home computers, when I > feel it is a time to de-clutter: > > #!/bin/sh > rm -rf /usr/local/* /var/db/pkg/* /var/db/pkg/.* /etc/rc.d/*_daemon > /etc/rc.d/avahi* > for i in \ > adobe-source-code-pro \ > ansible \ > borgbackup \ > chromium \ > emacs--gtk3 \ > gnupg-- \ > dmenu \ > firefox \ > thunderbird \ > rsync-- \ > git \ > gpicview \ > go \ > rust \ > inconsolata-font \ > ipcalc \ > mplayer \ > mtr-- \ > nmap \ > ntfs_3g \ > openvpn \ > pidgin-- \ > pv \ > spectrwm \ > splint \ > tcptraceroute \ > telegram-purple \ > terminus-font \ > transmission \ > vim--gtk2 \ > xpdf \ > zsh ; do pkg_add -v $i; done > > so when I am running it I am easily getting the system which I have most > essential software installed. > >
If you are going to do all that you might as well just re-install from scratch.