Maintain

If you don’t understand why a configuration exists, it’s useful to check its history.

The files in this repository were originally in the opendataservices-deploy repository. You can browse that repository from before the switch (August 5, 2019). That repository was itself re-organized at different times. You can browse before moving content from *.conf to *.conf.include (June 5, 2019).

Remove unneeded services and packages

We remove unneeded services and packages from this repository, because carrying old configurations forever into the future increases the maintenance burden of this repository.

If you don’t know whether a package is still required, you can connect to the server and:

  • Show what files the package installs:

    dpkg -L PACKAGE
    
  • Show what packages the package depends on:

    apt show PACKAGE
    
  • Show what packages depends on this package:

    apt rdepends PACKAGE
    

For example, the above commands show that redis is a metapackage (installing only documentation) that depends on redis-server, and that python3-virtualenv provides library files whereas virtualenv provides a binary file (needed by Salt).

The ./manage.py command has services and packages sub-commands to identify unusual services and packages, and an autoremove to list candidates for removal.

List manually installed packages

This StackOverflow answer works best. On Bytemark servers:

comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u)

On Hetzner servers, the /var/log/installer directory is missing. The Ubuntu manifest can be used as an approximation:

comm -23 <(apt-mark showmanual | sort -u) <(curl -sS https://releases.ubuntu.com/bionic/ubuntu-18.04.5-live-server-amd64.manifest | cut -f1 | cut -d: -f1 | sort -u)