This directory contains files that describe the packages installed on my various systems.
The intent of this is to:
- Be able to easily "sync" what packages I have installed across similar machines
- Backup the list of installed packages on a machine, in case I have to re-install the OS
- Be able to more easily "audit" changes to the packages installed on a machine
Since the various machines that I use, use different operating systems, the procedures for generating these lists is different per environment. I'll list the process per OS/env here:
- Install
apt-clone
(Should be able to do this viasudo apt install apt-clone
) - Generate the package state via
sudo apt-clone clone "$(./generate-apt-clone-name)"
... Or just generate it more simply, since apt-clone
is kind of tricky to actually use, like so:
apt list --installed 2>/dev/null | sed 's/\/.*//g > packages'
- Install Homebrew Bundle (Should happen on first attempt to run
brew bundle
) - Generate the package state via
brew bundle dump --force --describe --file=/path/Brewfile.hostname.os
Again, the procedures are dependent on the OS.
Use one of two ways...
- Attempt to restore the packages through
apt-clone restore
(this likely won't work across multiple different distro versions)sudo apt-clone restore FILE_NAME_HERE
- Or restore "cleverly" via a simple new-line-delimited list of package names
# Filter packages for those available while read package; do apt show "$package" 2>/dev/null | grep -qvz 'State:.*(virtual)' && echo "$package" >>packages-valid && echo -ne "\r\033[K$package"; done <packages # Install the available packages all at once sudo apt install $(tr '\n' ' ' <packages-valid)
- Restore via
brew bundle install --file=/path/Brewfile.hostname.os
- Go make some coffee...