# Tips and tricks for a default setup?



## veryuniquename (Apr 15, 2021)

I am going to reinstall FreeBSD soon and I'd like to have an identical setup as before, since I am happy with the one I got right now. Does anybody have any tips or tricks on how easily copy a setup (settings for different programs, OS tuning, packages, files, etc) to a fresh install?

I currently just have a bash script for my packages but it sometimes fails (e.g. when some packages are removed or change name). I feel that this bash script is kind of bad. It is difficult to copy without having some "enter" pop up and short cut the command or some other error.


----------



## SirDice (Apr 15, 2021)

veryuniquename said:


> Does anybody have any tips or tricks on how easily copy a setup (settings for different programs, OS tuning, packages, files, etc) to a fresh install?


Run `pkg leaf` and note the packages that have been installed. This will only show so-called 'leaf' packages, which doesn't include all the dependencies (you don't have to install those, they're automatically pulled in). 

You also want to backup /usr/local/etc/, it should contain all the configuration files for the various things you installed and configured. Maybe also backup /etc/rc.conf so you know what was enabled.

Backup your /home/* directories too, you probably want to keep your user's files.


----------



## Deleted member 30996 (Apr 15, 2021)

I copy the entire /etc Directory so I have all my system settings on USB stick and can copy them off into the Directory as root.

Things like /etc/ssh/sshd_config can just as easily be "Saved As" the same filename and overwrite the existing file in that Directory. If you're comfortable working as root.

I keep all my x11-wm/fluxbox styles, sysutils/gkrellm2 skins, fonts, images, documents from the last build, etc. on the same USB stick and can transfer all that at the same time.

I do the program tweaking manually but /usr/local/share/ is where the fluxbox styles, x11-fm/xfe icons, fonts and such are stored.

I transfer fonts directly into /usr/local/share/gimp/fonts as root, run `rehash` and they're available for use with graphics/gimp the next time I open it without any editing done.


----------



## veryuniquename (Apr 15, 2021)

SirDice said:


> Run `pkg leaf` and note the packages that have been installed. This will only show so-called 'leaf' packages, which doesn't include all the dependencies (you don't have to install those, they're automatically pulled in).
> 
> You also want to backup /usr/local/etc/, it should contain all the configuration files for the various things you installed and configured. Maybe also backup /etc/rc.conf so you know what was enabled.
> 
> Backup your /home/* directories too, you probably want to keep your user's files.


I have done a backup of my /home files alongside some other directories and files, everything stored in one directory ('backup'). I used the `tar` command and followed the docs. Can I use the `tar` command again on the folder ('backup') and 'tar it' again, or will that level of compression break things? What do you think?


----------



## tux2bsd (Apr 18, 2021)

```
pkg leaf
```
Thanks, a list of packages without their dependencies, that is extremely useful.

BUT run that that AFTER `pkg autoremove` if you've just done 12.2->13.0 .It would be good for the FreeBSD handbook to suggest this step (`pkg autoremove`)after a major version upgrade.








						Chapter 25. Updating and Upgrading FreeBSD
					

Information about how to keep a FreeBSD system up-to-date with freebsd-update or Git, how to rebuild and reinstall the entire base system, etc




					docs.freebsd.org


----------

