100
submitted 1 year ago by perishthethought@lemm.ee to c/linux@lemmy.ml

Earlier this year, I built a new PC and it's running Ubuntu. I've been installing various apps and configuring them since then. Now, I realize I don't have any way of knowing what I would want to reinstall, if I (for instance) lost this drive somehow.

How do you keep track of what you've installed/ your favorite apps?

Separately, how can I backup the configurations I'm using right now.

Thanks!

top 43 comments
sorted by: hot top controversial new old
[-] zacher_glachl@lemmy.world 38 points 1 year ago

Git.

Keep all the config files of your tools in subdirectories of a git versioned directory and symlink them into their target location (e.g. with GNU stow). If installation of a tool is involved and you expect to have to revisit it, put the steps into an installation bash script and version it as well.

[-] mariom@lemmy.world 3 points 1 year ago* (last edited 1 year ago)

+1, essential ones I keep in GitHub repository (like zsh, tmux, xdefaults configs with no personal data). With makefile that makes symlinks. This is the easiest way to sync zsh config between my personal and work machines.

Rest is just in a backup.

[-] hikarulsi@lemmy.world 1 points 1 year ago

Do you have an example of a generalise makefile that does that? Or does it need to be customise per configuration?

[-] mariom@lemmy.world 3 points 1 year ago

On my GitHub repo. Needs to be customized, but you should get the idea.

Maybe there is a way to write it better, I'm no makefile expert ;)

[-] eshep@social.trom.tf 1 points 1 year ago* (last edited 1 year ago)

@zacher_glachl @perishthethought I take a similar approach starting with a bare work-tree at $HOME/.cfg and add config files I've changed. Then throw my --git-dir and --work-tree switches in an alias for git.

As for installed programs, a simple backup of my portage world file takes car of that.

[-] demesisx@infosec.pub 34 points 1 year ago* (last edited 1 year ago)
[-] BitSound@lemmy.world 7 points 1 year ago

Seconding this. Store your configuration.nix in git and just copy it back over if you ever need to wipe and reinstall.

[-] pezhore@lemmy.ml 18 points 1 year ago

Oh! I can participate!

Everything I have/configure is 100% in Ansible. I learned the hard way that rebuilding a workstation from scratch sucks if I only depend on my brain to remember things.

It takes some effort to keep it updated - if I'm trying out a new app, I have to remember to add it to my config.

The other thing that I've started doing is using Restic for file level backups. That's relatively easy to set up, it supports a multitude of backend storage, and works well with a cron job for braindead backups.

[-] shinnoodles@lemmy.world 15 points 1 year ago

I just check my Nix.config, but most distros don't have that privilege.

Idk how it works for most other distros, but I know on Arch you can check all packages manually installed by pacman and your AUR helper.

[-] odium@programming.dev 2 points 1 year ago

Iirc pacman -Qe does something like this

[-] SmallAlmond@lemmy.dbzer0.com 14 points 1 year ago

Home Manager on a NixOS flake, it's a rabbit hole but I've been loving it since last week!

[-] CalcProgrammer1@lemmy.ml 12 points 1 year ago

Install fresh copy of Linux OS on a new device. Install the apps I know I need like browser, code editor, etc.

Use device.

Realize "oh crap I forgot to install X!"

Install X

Repeat until all X have been installed.

[-] perishthethought@lemm.ee 4 points 1 year ago

Lol, pretty much what I've done in the past. And yep, it works, eventually.

[-] Lemmchen@feddit.de 4 points 1 year ago

Plus backup /home and /etc, maybe /opt as well.

[-] nekusoul@lemmy.nekusoul.de 10 points 1 year ago

Apart from those little tools running in the background that get their own little "How to install and configure X" file, I don't keep a list. I just install things as I need them, copying back config files from a backup. It's less annoying and time consuming than one might expect and keeps the system slim by not installing what I never use anyway.

[-] Bankenstein@feddit.de 10 points 1 year ago

Move all your heavily modified config files into a git repository and host it somewhere. Then symlink all your config files to where they should be with ln -s ~/.config/whatever ~/gitrepo/whatever. That's how you preserve your important configs.

You can easily get a list of your installed packages (which you can keep in your repository) with apt list --installed > packages.txt. You can then format that list to one you can install from with sed -e "s-/.*$--" <packages.txt (or something, i don't have apt, can't test it fully).

In fact, if someone here is more familiar with apt, please find a way to filter out packages that were not explicitly installed and reply to this comment with your solution.

[-] sibloure@beehaw.org 2 points 1 year ago

This combined with stow command makes it very simple to "install" your system configuration on a new machine.

[-] tom42@lemmy.world 9 points 1 year ago

Home manager on NixOS and stored all config files in a Git repo

[-] garam@lemmy.my.id 6 points 1 year ago

Use ansible and variable, so it can be replicated to other computer. Simple

ansible.builtin.apt:
   name: "{{ item }}"
   state: latest
loop:
   - pkg1
   - pkg2
[-] NixDev@programming.dev 3 points 1 year ago

At work we are starting to transition to Ansible from chef and other homegrown solutions. So to learn Ansible I added awx to my home lab and now have playbooks for almost all of my devices. Going to format a Pi again soon and see if everything works as intended

[-] gobbling871@lemmy.world 6 points 1 year ago

Backup $home and /etc. That should be good enough.

[-] perishthethought@lemm.ee 2 points 1 year ago

Yes, my concern with this is that I have Steam installed and its games are many many GBs. If I do a backup I'll have to exclude that folder. I'll try this and see how it goes. Thanks!

[-] happyhippo@feddit.it 5 points 1 year ago

git repo

A bash script

apt get install

Same with flatpak

Keep updated. Done.

[-] xoggy@programming.dev 5 points 1 year ago

NixOS stores a snapshot of your OS and all the app configs in an OS config folder for you. Helpful for instant system recovery or deploying the setup to new hardware.

[-] djsaskdja@reddthat.com 4 points 1 year ago* (last edited 1 year ago)

I make a list of all the ones I like. Then when I feel my system is getting too bloated, I wipe and reinstall while only installing the packages from my list.

It’s very “low tech,” but it’s always worked out well for me.

[-] perishthethought@lemm.ee 1 points 1 year ago

Yes, I think this is more like what I'll do, though I like the idea of a git repo for the configurations. Cheers

[-] Atemu@lemmy.ml 4 points 1 year ago

How do you keep track of what you’ve installed/ your favorite apps?

https://github.com/Atemu/nixos-config/blob/b79f42793a709db083cf53867f85d5d46e41eb69/packages.nix

Separately, how can I backup the configurations I’m using right now.

https://etckeeper.branchable.com/

[-] inspxtr@lemmy.world 3 points 1 year ago

If you use other package managers like flatpak, nix-env (for non-NixOS), npm (for global stuff), … you can just create a bash script to list all installed packages for each manager, and save to a file(s). I put them in a git repo to version control these lists, which are updated every now and then when I update stuff.

[-] amadeus@lemmy.zip 3 points 1 year ago

I keep a changelog for all my computers and note installations, uninstallations and config changes.

[-] TheFriendlyArtificer@beehaw.org 3 points 1 year ago

https://github.com/koepnick/dotfiles cloned into ~/.config

I typically start with a restrictive .gitignore and add directories as needed.

A ton of stuff that I always forget like mpv, vifm, and whatnot always slipped through the cracks before. Now I can clone to practically anywhere and have everything just work.

[-] ebits21@lemmy.ca 3 points 1 year ago

Lately using Silverblue. Everything is a flatpak or is layered. Both are easy to list.

Maybe a handful of things in distrobox I need to keep track of.

[-] gms77@kbin.social 2 points 1 year ago

I use a notepad and write down the apps I mostly use so when I do a reinstall I just reference that.

[-] argv_minus_one@beehaw.org 2 points 1 year ago

I back up the entire system, apps and all. The main reason is so that I can get back up and running quickly, but it also spares me the need to worry about which apps to reinstall.

[-] bmbufalo@lemm.ee 2 points 11 months ago
[-] davad@lemmy.world 1 points 1 year ago

A dot files repo for some basic config and an Ansible repo to stand everything up. This applies to both my Linux and MacOS machines.

All the people taking about their NixOS setups had me thinking of giving that a try, though.

[-] AbidanYre@lemmy.world 1 points 1 year ago

Ansible, although that may be overkill.

[-] DarkwinDuck@feddit.de 2 points 1 year ago

I personally considered doing this but the time i would have to invest vs the frequency of doing a fresh install just doesn't warrant it. Too complex.

[-] AbidanYre@lemmy.world 1 points 1 year ago

I screw around with self hosting and homelab stuff that it was an interesting thing to learn at a certain point.

I don't think I noticed which c this was in. For a regular user it's probably not worth the effort.

[-] DarkwinDuck@feddit.de 2 points 11 months ago

Well i write frequently write playbooks at work. But for my laptop it Still felt not worth it. I have a playbook for my Server stuff though.

[-] nbailey@lemmy.ca 0 points 1 year ago

Write install and maintenance guides, save them somewhere public. Automation is good, but documentation and practicing technical writing is better.

[-] gzrrt@kbin.social 0 points 1 year ago* (last edited 1 year ago)

I keep a .dotfiles folder in my home dir, use syncthing to back up those files on a couple of other computers, and then (on a new install) just make the actual config files symlinks to those files.

[-] cleric_splash@lemmy.world -1 points 1 year ago
function pkglist -d "Gets list of installed packages"
  # Prevent descriptions in other languages
  set -l LANG C
  # Define pkglists location
  set -l dot $HOME/.config/dotfiles

  echo "(1/5) RPM-OSTREE status"
  rpm-ostree status > $dot/pkglist.rpm-ostree --booted

  echo "(2/5) Identify flatpaks"
  flatpak list --app --columns=application > $dot/pkglist.flatpak

  echo "(3/5) Identify pinned flatpak runtimes"
  flatpak pin > $dot/pkglist.flatpak.pinned

  echo "(4/5) Identify flatpak overrides"
  for i in (cat $dot/pkglist.flatpak)
      if test -s (flatpak override --show --user $i|psub)
	  echo $i
	  flatpak override --show --user $i
	  echo
      end
  end > $dot/pkglist.flatpak.overrides

  echo "(5/5) Save KDE configuration"
  fedora konsave -s kde_configuration --force

  # to apply configuration
  # fedora konsave -a kde_configuration

  git -C $dot st
end
this post was submitted on 19 Jul 2023
100 points (99.0% liked)

Linux

45753 readers
734 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS