Skip to main content

Simple declarative package management

For Debianish Linux

Declarative package management means you make a file containing everything you want installed, and the package manager adds/removes to make the system match that. It's good if you happen to install lots of random programs and forget to remove them until you forgot whether they were important to have installed or not in the first place!

Requires: aptitude, sudo, python 3.6+

  1. pip install decapt
  2. decapt generate
  3. Modify decapt.luxem
  4. Update your system with decapt

Features

  • Manage snap packages
  • Manage manual debian packages Add an entry like { name: mypackage, path: ~/debs/mypackage } where there's a build.sh script in path which creates a mypackage.deb in path.
  • Luxem

Notes

Autoremove

Debian considers installed "suggested" and "recommended" for other installed packages to be important, so they won't be autoremoved after being installed once. If for instance something recommends chrome or firefox, and you remove chrome from your list and add firefox, it won't be removed (by default). To make these not recommended, create /etc/apt/apt.conf.d/99_norecommends and add:

APT::Install-Recommends "false";
APT::AutoRemove::RecommendsImportant "false";
APT::AutoRemove::SuggestsImportant "false";

(source)

If you run apt autoremove you can confirm what this affects that's currently installed. You should probably add some to your decapt list (ex: grub-efi-amd64). You can check why something on that list is currently installed by running aptitude why PACKAGE -- if it's actually a dependency (not just suggested/recommended) by something else, try aptitude why on that something else until you find what package at the head of the chain is set free by this change.

Base packages

Decapt generate consults the list of currently manually installed non-base software. Debian seems to "manually" install a lot of unnecessary packages, so the initially generated list will include both packages and dependencies, where you might only want the package itself? To convert all manually installed dependencies to auto packages, run:

$ sudo apt-mark showmanual | while read line; do if [[ $(apt-cache rdepends --installed $line | wc -l) -ne 2 ]]; then apt-mark auto $line; fi; done

If you do decapt generate after that you should have a smaller list of base-system spam in the list.

(TODO: rdepends seems to include suggested/recommended dependencies too, so this might need to be reworked to use a different tool).

Friends (not really)

  • Nix - A strict declarative package (and config) manager, and also the basis of Linux distro NixOS
  • Guix - A strict declarative package (and config) manager, and also the basis of Linux distro GuixSD
  • aconfmgr - A declarative Arch-native package and config manager
  • decpac - I made something similar for Arch

Release files for decapt 0.0.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for decapt 0.0.21
File Size Uploaded
decapt-0.0.21.tar.gz 6.0 kB Details

Release files / decapt-0.0.21.tar.gz

Download URL decapt-0.0.21.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
00766db6dfa54e2b3a9e43969bb3dc9f7bd03f6468161ef5cbf27e042da09c1f
BLAKE2b-256 checksum
How to use checksums
7bf22225743f02b3247baa329ef340971d9eb9257e0feb0649f8398324ceb6b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.0.21 This release

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page