For Arch you run pacman -Qe which lists all installed packages that were not installed as a dependency.
I output that to a location via golang script which is monitored by the pCloud client for automatic backup along with a lot of other configs from $HOME/.config.
I then have a systemd service that fires the script and a timer to kick off that service periodically.
post
NixOS has a config file, you backup that file, you can duplicate your system with it.
OpenSUSE has an AutoYast system where you can build a config for the next install.
OpenSUSE microOS has ignition and combustion files to replicate a system from scratch. For those that don't like hand typing a config file there is this web based tool to write out a file based on selections https://opensuse.github.io/fuel-ignition/
You can install all apps through the command line. Just write a shellscript with all the commands and run it when you're doing your reinstall.
And just update it with every package install and uninstall, on every device, forever.
Does that get you a list of only the manually installed packages, or also include things that were automatically installed as part of something else?
apt-mark showmanual
Should only show you the packages that you've explicitly installed (i.e. were not installed as dependencies).
If you installed meta packages (say, KDE Plasma) then it'll mark each component of that install as manually installed.
apt-mark minimize-manual
Will mark the meta packages as auto instead of manual.
You're correct. All packages installed via dpkg/apt are on that list. What isn't included are appimages, flatpacks, snaps and other non-dpkg software if you happen to have any.
It does it if you do it right after the OS installation then whenever you plan to move on and diff the two.
Surprised nobody said this yet, but I use ansible. I also use it to have the same install on multiple machines independently (something that doesn't work by just having a dedicated home partition).
But it's a bit of maintenance to keep modifying my dotfiles, certainly not as easy as your old apps aisle.
use your distros method of listing every installed package and modify it to be a install command
For me that's the main benefit of using home-manager on nixos and other distros. You basically just make a list of packages, and install/update them through home-manager.
I mean, i feel obvious for saying this, but maybe others dont know: If we're just talking about apps, this is also a 1-liner in most package managers that you can even automate in a shell script
sudo apt-get install firefox vlc thunderbird etc...
if we're talking more complex environments like a dev environment, mix of python packages, libraries, docker containers, etc obviously thats a lot of attention to manually save all of those details for later and something else should probably be used
Sure, but then you need to maintain it. I don't know about you, but I never had the discipline to update it with every package install and uninstall. It's especially annoying when you have multiple devices.
Declarative package management doesn't have that issue since you're managing the packages by editing the list.
Besides that, the home-manager approach works on any distro (and os?), you get bleeding edge packages, you get a built in rollback system, and you can handle configs as well (but I mainly just symlink them anyways).
You can write a script to periodically check the installed packages and update the 1st script. Its basically the output of "dnf list installed"
/facepalm moment for not thinking of that at the time
But it's lacking organisation and modularity. For example let's say you need programming packages on one device, gaming ones on another, and general ones on both. It's pretty easy to set it up with hm, and you can disable specific modules when you don't need them (for example you rarely need to use a certain language and supporting packages).
I guess most people would not only want to easily reinstall all their apps, but also the settings related to them.
Sadly that’s the difficult part.
When I see how much time it takes me to have all my calendar and settings in Thunderbird.
Luckily for Thunderbird you can save your profile if everything takes less than 2gb, but it’s still a hassle to find a way to backup every program.
For me the config management aspect of home-manager is mostly useless. It takes a lot more work to set it up, looks far uglier, and you need to maintain it because parameters change over time. Saving dotfiles in a repo, and symlinking them on install is simply easier.
The only two scenarios where it's actually useful is when you have slightly different configs for different devices, and when the program doesn't support dotfiles. A pretty cool example I've seen for the second one is managing Firefox customisations (settings, plugins, additional CSS), but I'm only disabling horizontal tabs so it's not worth it for me.
Aren't most app configurations and settings saved in the user's .config folder? Again you have to know to look for this, but that should be most of your settings right?
/home/[username]/.config/
How long does it take to get home-manager set up?
It's pretty fast, especially if you don't get into flakes right away. You basically just install nix with a one liner -> install home-manager through nix -> start adding packages to list.
Here's a comment I made when I was starting out with basic instructions. Do note I'm now using this command for updates instead (updates hm, package definitions, and the packages themselves)
cd ~/dotfiles/nix/ && nix flake update && nix-channel --update && home-manager switch --flake ~/dotfiles/nix/
I think a sync method or a way to dump settings and apps would be cool.
If you can't remember what to reinstall, was it really that important? Packages are so quick and easy to install that I just install them the first time I try to use them and find them missing.
Assuming you are using an apt/dpkg distro:
Save the list of packages on your reference system:
dpkg --get-selections > packages.lst
Then install packages based on that list on your target system, after updating the list of available packages:
dpkg --merge-avail <(apt-cache dumpavail)
dpkg --clear-selections
dpkg --set-selections < packages.lst
apt-get dselect-upgrade
In APK based systems (Alpine, Chimera, Adelie) there is /etc/apk/world
It is a list of all the packages you have explicitly installed. When you add and remove from this list (all apk does), the system solves for dependencies and makes sure you have the right packages installed.
You could bring up a new system by updating this file.
I'm not advocating for anything, but if I remember correctly, flatpaks are typically installed in user home directory. If that's the case, then it's just a matter of copying a directory and installing flatpak. I might be wrong though.
instead of searching and installing all your apps one-by-one
And... that takes what, a good all 5 minutes?
Honestly unless you either re-install an OS frequently (which is a weird thing to do on a day-to-day system) or plan to go offline for a long period of time I bet you'd spend more time finding a "solution" then not doing so manually.
I'm not you but when I install a fresh OS (maybe once every couple of years, at most!) on my desktop (not counting other devices, handheld, servers, etc) I install
- Firefox (if it's not already by default, if it's ESR then I might get a different update mechanism)
...well honestly that's it!
Then yes as I start to work I add KDEnlive, OBS, Blender, Cura, OpenSCAD, etc.
My point being that I can't imagine a moment when, as you start the OS you actually need all the other software at the same time. You usually need one, then another, e.g. Inkscape to edit a PDF document you just received, then you pass the extract image to e.g. LibreOffice Writer.
So... not having everything from the start is IMHO a good moment to consider what you actually need, keep things lean.
TL;DR: there are technical solutions but on a desktop connected to the Internet it's not worth it.
PS: I do personally keep my bash history or my ~/bin/ and ~/Apps/~ directories across installations (because I do keep ~` on a dedicated partition) with some AppImages in but honestly I don't rely on these.
Just use appimages. Works for a lot of things that don't require full integration.
all 43 comments