0

I have been thinking of writing some sort of utility for Linux that keeps track of all my installed software and configuration. Something that after doing a fresh install I can just run it and will restore my copy of Ubuntu as it used to be before doing the fresh install.

I do not know exactly where to start with this. I know that you can get a list of user installed software from dpkg -i | grep ii.

  • the /var/log/apt/history* files could be of interest. They include any command used to install/update/remove (parse for Command: to find them all). Keeping track of this, as well as file changes under /etc may be enough. I've been considering doing a mail server set up and feeding the /etc directory to a git repo to track what changes are actually made... but somewhat leery since usernames/passwords would be included... still could be useful for the class i teach – ivanivan Mar 24 at 13:58
1

Debian and it descendants have a tool that allows you to create simple packages (with just dependencies). It is perfect for this job.

It is called equivs-build (I have no idea where the name comes from). It will create a .deb. You can install it with gdebi

Here is a makefile (you can do it manually if you want. The make file only adds 10% of the convenience, but documents the process.)

#create source
%.equivs-control: src/%.equivs-control
        @echo %linking "$@" from "$<"
        ln -s -t . "$<"

#make deb
%.deb: %.equivs-control
        @echo %making "$@" from "$<"
        equivs-build "$<"

#install one
.PHONY: %.install
%.install: %.deb
        @echo %installing "$<"
        sudo gdebi "$<"

But first you need to install the few tools.

#!/bin/bash
ln -fs -T ../equivs src
ln -fs -t . src/makefile

#install what we need
sudo apt-get install equivs gdebi-core make

A config file src/my-packages_1.0_all.equivs-control

Section: local
Priority: optional
#Homepage: https:
Standards-Version: 3.9.2
Package: my-packages
Version: 1.0
Maintainer: ctrl-alt-delor@local>

Depends: python3-pystache, equivs, make, gdebi-core, intel-microcode, firmware-linux, multiarch-support, cpufrequtils, openssh-server, stow, etckeeper, ntp, bomstrip, nodejs, dos2unix, faketime, wget, nocache, schedtool, cpulimit, smem, inotify-tools, keepassx, mawk, mmv, yakuake, xdotool, acl, gparted, gufw, htop, sshfs, bindfs, k4dirstat, openssh-client, vim, rsync, emacs, vim, avahi-discover, yaml-mode, markdown, pandoc, dc, xinput, iotop, strace, curl, screen, kdesdk-dolphin-plugins, cvs, easygit, git, git-flow, git-gui, gitg, tig, kdesvn, subversion, hgview, mercurial-common, tortoisehg-nautilus, python-dulwich, task-british-desktop, task-british-kde-desktop, task-desktop, task-english, task-kde-desktop, task-laptop, redshift-plasmoid, gtk2-engines-oxygen, kde-config-gtk-style, kde-config-gtk-style-preview, libreoffice-style-oxygen, appmenu-qt, vlc, konversation, encfs, diffpdf, diffuse, dirdiff, kdiff3, meld, tor, idle3, ipython3-qtconsole, backintime-kde, couchapp, augeas-lenses, augeas-tools, augeas-doc, python3-augeas, sass-elisp, ruby-sass, eclipse-jdt, eclipse-mercurialeclipse, python3-requests, filepp, texlive-latex-base, texlive-latex-extra, tth, golang-mode, zenmap, wireshark

# Readme: <README.Debian file; defaults to a generic one>
Description: All of the stuff I want installed.
 This is managed by my install script system.

To use: - run shell script (this boots this install system) - run make my-packages_1.0_all.install

Careful if messing with the file names, part is from the Package: line, part is built in to the tool.


There are other configuration management tools that do a lot more, and are worth a look.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.