I frequently reinstall Linux. Is there a tool to say what to install and configure that I can just run once after OS install? Things like

  • Install neovim, signal, steam
  • Configure firefox, desktop environment

I’m using this for just me, on my personal machine.

I don’t anticipate it’s possible between different distros, so assume I’m reinstalling the same distro.

  • Dingaling@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 hour ago

    If a debian based distro there’s several ways to copy your package choices from one machine to another, the likes of using dpkg --get-selections and using that output on the new machine with --set-selections, but probably the easiest way is to use apt-clone, which streamlines that process to install the same packages on the new machine.

    As for your firefox and desktop packages, they’ll be saved in /home/username (usually in .hidden dirs) - so just copy all of that over.

    Alternatively, use an image cloner like clonezilla to make an exact disk copy and install that.

    Or run your machine as a vm inside Proxmox or another hypervisor. That way you can have instant snapshots before you do risky things, as well as multiple scheduled entire-machine backups.

    Or ansible (which I do a lot of), which can set whatever packages and copy your golden-image files over as you want. (But keeping those up to date requires a little thought)

    • staircase@programming.devOP
      link
      fedilink
      arrow-up
      0
      ·
      2 hours ago

      Usually if I’ve made a mess with installs or config and want a clean slate, but this time I’m doing it cos I tried out a new OS and it didn’t work out.

      Hard to say exactly, how much, maybe twice a year, but when I do reinstall I often reinstall like three times in quick succession until I get a good foundation.

      • throwaway403@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        1 hour ago

        Aight. Understood. Thank you!

        In your case, I’d propose something like NixOS then. As your full system configuration can be contained within a (set of) config file(s), the very same ones you use to install/config stuff, a reinstall just becomes very easy. Heck, if you’re willing to embrace the Erase your darlings-lifestyle, then I don’t even think you’d ever feel the need for a reinstall. Because, frankly, the clean slate is just a reboot away.

        EDIT: Perhaps Guix System is also worth considering as an alternative to NixOS*.

        EDIT2: If you still want to explore other distros, then it’s worth noting that nix, i.e. NixOS’ package manager, is available on most distros and offers a lot of the benefits already. Like, you could configure your system using it, and then use that config on another distro to get your config back. Good stuff.

  • Jeena@piefed.jeena.net
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 hours ago

    The best would be NixOS, but if you just want to automate your install which you have then Ansible.