DEBFOSTER(8)

πŸ“¦
version 2.8 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– DEBFOSTER(8) πŸ’–

okay so this is debfoster from the System Manager's Manual, and bestie, it is so good. It weeds unnecessary Debian packages. Let's get into it. πŸŽ€


✨ NAME ✨

debfoster β€” weed unnecessary Debian packages 🌿


🌸 SYNOPSIS 🌸

debfoster [-acdefhiknopqrstvV] [--verbose] [--version] [--help]
          [--quiet] [--force] [--mark-only] [--upgrade] [--config file]
          [--keeperfile file] [--no-keeperfile] [--ignore-default-rules]
          [--show-keepers] [--show-orphans] [--show-depends package]
          [--show-dependents package] [--show-providers package]
          [--show-related package] [--use-tasks] [--option opt=val]
          [package1 ...] [package2- ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: debfoster keeps a list of installed packages that you explicitly requested, as opposed to the ones that just showed up because something else dragged them in as a dependency. No invited-plus-one energy here.

Every single argument is entirely optional, fr fr β€” you can just run debfoster on its own, per se, after every run of dpkg and/or apt-get. 🫢

Alternatively you can use debfoster to install and remove packages by listing them on the command line. The rule is iconic and simple:

  • packages suffixed with a - get removed
  • packages with no suffix get installed

πŸ’…

If a new package shows up, or if debfoster notices that a package that used to be a dependency is now an orphan, it's gonna ask you what to do with it. If you say keep it, debfoster just takes note and moves on, nbd. If you decide this package is not interesting enough, it gets removed as soon as debfoster is done asking questions. And if your choices cause other packages to become orphaned? More questions ensue. 😭 It's giving cascade.

Whenever debfoster asks you about a package, any of these responses are on the menu:

  • β€˜y’ β€” Yes, keep the package. This is the default response. πŸ’–
  • β€˜n’ β€” No, delete the package. πŸ’€
  • β€˜p’ β€” Prune the package. This tells debfoster to also delete all packages that are only installed because this package depends on them. A list of such packages, if any, is shown above the prompt.
  • β€˜s’ β€” Skip this question. The next time you run debfoster it will ask you again about this package.
  • β€˜h’ β€” Print a help message.
  • β€˜i’ or β€˜?’ β€” Show information about the package.
  • β€˜u’ β€” Undo last response. ↩️
  • β€˜q’ β€” Exit without removing packages. All changes will be lost.
  • β€˜x’ β€” Save changes to the debfoster database, remove unwanted packages, and exit without asking further questions.

πŸŽ€ Command line options πŸŽ€

  • -v, --verbose β€” debfoster will show which packages have disappeared, have become dependencies or (if Quiet is enabled) have become orphans. πŸ‘€
  • -V, --version β€” Display version and copyright information.
  • -h, -FL -help β€” Display a concise summary of the available options and argument syntax.
  • -f, --force β€” Don't ask anything and assume β€˜no’ as the answer to all questions. It also installs any packages that seem to be missing, thus forcing your system to comply with the debfoster database.
Can have β€˜interesting’ results if you're not careful. 😭 Like, genuinely, be careful.
  • -q, --quiet β€” Don't ask anything and assume β€˜yes’ as the answer to all questions. Useful to create an initial /var/lib/debfoster/keepers file or to recreate it after changing the configuration file. 🧚
  • -m, --mark-only β€” Instructs debfoster to make changes to the keeper file but not to actually install or delete any packages. This can be used to β€˜edit’ a keeper file by invoking debfoster one or more times in a row. The changes can then be committed by invoking debfoster with the --force option, which will delete/install any necessary packages. This is mainly useful for scripts and frontends, but may be useful from the command line as well.
  • -u, --upgrade β€” If used as debfoster -u package it will install or upgrade the packages specified on the command line and try to upgrade all packages that it relies on.
  • -c, --config file β€” Specify a different configuration file to use. πŸ“
  • -k, --keeperfile file β€” Specify a different debfoster database to use.
  • -n, --no-keeperfile β€” Don't read the debfoster database and start with an empty list.
  • -i, --ignore-default-rules β€” This will instruct debfoster to ignore the UseHold, UseEssential, MaxPriority, KeepSections, and NokeepSections settings in the config file (i.e., assume that any package can be an orphan). This is a good option for those who really want to make sure their system is squeaky clean. It's also useful when sharing or transferring a keeper file between multiple machines where different config files can cause some confusion. Properly used, -i eliminates that uncertainty. ✨
  • -a, --show-keepers β€” Lists the contents of the debfoster database.
  • -s, --show-orphans β€” List all orphaned packages that are not mentioned in the debfoster database. πŸ₯Ί
  • -d, --show-depends package β€” List all packages that this package depends on.
  • -e, --show-dependents package β€” List all packages in the debfoster database that depend on this package.
  • -p, --show-providers package β€” List all packages that provide the dependency target specified by package (e.g. "debfoster -p x-terminal-emulator").
  • -r, --show-related package β€” List all packages that are only installed because this package depends on them.
  • -t, --use-tasks β€” Make tasks visible as packages. This will make tasks that are selectable using tasksel(1) appear as packages named task-<label>. 🌈
  • -o, --option opt=val β€” Override any configuration option specified in the configuration file.

and that's where part 1 wraps, bestie β€” more coming, don't go anywhere πŸ’œ

πŸŽ€ CONFIGURATION πŸŽ€

okay bestie so debfoster is lowkey customizable, and the way you do that is through its config file, /etc/debfoster.conf. Inside you write options like this:

Option = Value

and no cap, the option names don't care about case β€” Verbose, verbose, VERBOSE? all the same girlie. πŸ’…


✨ THE OPTIONS ✨

  • InstallCmd β€” Default: apt-get install

This is the command debfoster runs with a bunch of packages handed to it on the command line. Heads up though: it is not passed to /bin/sh β€” instead it's invoked like xargs(1) with the packages tacked on as extra options.

  • RemoveCmd β€” Default: apt-get --purge remove

Same vibe as InstallCmd, except this one is for removing packages. πŸ’€

  • InfoCmd β€” Default: dpkg -s

Also like InstallCmd, but this one gets called with a single package as its argument, and its whole job is to show you info about it.

  • KeeperFile β€” Default: /var/lib/debfoster/keepers

The file where the list of orphans lives. You can literally use this file as a reference when you're setting up a new machine, or even to make identical Debian installs. so useful fr. ✨

  • DpkgStatus β€” Default: /var/lib/dpkg/status

The file where dpkg(8) stores its info about which packages are more or less installed. You can usually leave this value untouched, it's fine.

  • DpkgAvailable β€” Default: /var/lib/dpkg/available

The file where dpkg(8) stores its info about which packages are available. Also usually fine to leave alone.

  • MaxPriority β€” Default: standard

Any package with a priority greater than this value gets treated as too basic to even ask you questions about. With the default, debfoster will ask about packages with priority standard, optional and extra. And if you use the special value β€˜ANY’, that means every known priority is considered too important to ask about. These are the priority values debfoster knows about (taken from the debian-policy package):

required
important
standard
optional
extra
  • UseHold β€” Default: yes

Uses the hold attribute from the Status: line. Packages with this attribute will never be upgraded by apt, so it's safe to assume you wanna keep them. πŸ’–

  • UseEssential β€” Default: yes

Uses the Essential: line from dpkg(8)'s status file. Most packages marked essential shouldn't be removed anyway, so if you don't want to be bothered about it, turn this on.

  • UsePreDepends β€” Default: yes

When a package pre-depends on another, it needs the other one during installation. This option makes debfoster count those pre-dependencies as ordinary dependencies. If you update your packages a lot, maybe keep an eye out for pre-depended packages that have gone obsolete. πŸ‘€

  • UseRecommends β€” Default: yes

Recommended packages would normally get installed alongside whatever recommends them in basically all usual setups. This option makes debfoster count those recommendations as real dependencies. Turning it on helps you manage packages that got installed just because something else recommended them.

  • UseSuggests β€” Default: no

Packages suggested by another package usually enhance the function of the latter, or have some related function that's useful in combination with the suggester. This option makes debfoster count those suggestions as real dependencies. Using it means even fewer questions get asked. 😌

  • UseTasks β€” Default: no

Makes tasks show up as packages. This makes the tasks you can pick with tasksel(1) appear as packages named task-<label>. debfoster will treat them like normal packages. Tasks can't be removed, but if you mark a task for removal, debfoster will stop asking you questions about it. periodt.

  • KeepSections β€” Default: ~

Maybe you notice you're always interested in keeping (say) documentation. With this option you can say that packages from a certain section should always be kept. Just give a comma separated list of β€˜precious’ sections.

  • NokeepSections β€” Default: ~

List the sections you're never interested in. For example, β€˜libs’ is a great candidate, since most libraries debfoster asks about are leftovers from old packages. πŸ—‘οΈ

  • GuessDepends β€” Default: (empty)

Lists name extensions for packages you want grouped with their base packages. Apps often get split into multiple packages with names like "app", "app-doc", "app-dev". If you don't wanna answer questions about "app-doc", just add the "doc" extension to the GuessDepends list.

  • NegativeKeepers β€” Default: yes

Remembers explicit removals of packages. So if a package gets installed that you already explicitly removed before, it gets removed again without asking. Set this to no if you want to be asked anyway. πŸ™ˆ

  • Verbose β€” Default: no

Using this does the same thing as having -v on the command line. It makes debfoster show which packages have disappeared or have become a dependency.

  • Force β€” Default: no

This one has the same meaning as the -f command line option. Every orphaned package gets scheduled for removal without asking a single question. 😭

  • Quiet β€” Default: no

Having this option (same meaning as the -q command line argument) in your config file more or less defeats the whole purpose of debfoster β€” although the KeeperFile does still get kept up-to-date.


πŸ› BUGS πŸ›

Found something cursed? Send reports to the Debian bug tracking system:

http://bugs.debian.org/debfoster

and include as much info as you can gather β€” error messages, configuration files, versions of dpkg/apt, whatever might be relevant. A tool like reportbug might come in handy. 🫢


πŸ‘€ SEE ALSO πŸ‘€

apt-get(8), apt-cache(8), dpkg(8), deborphan(1), tasksel(1)


and that's the whole thing bestie, you ate that. πŸ’…βœ¨ this page is from the Debian GNU/Linux distro, dated 2001-06-10, and it's the DEBFOSTER(8) manual page β€” go be the main character of your package management journey, ily πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from