CDIST-TYPE__PACKAGE_APT(7)

πŸ’– cdist-type__package_apt β€” manage packages with apt-get πŸ’–

ok so this is cdist-type__package_apt(7), like section 7 of the cdist manual, and bestie it is exactly what it sounds like: it's the cdist type that handles your packages with apt-get. no cap. πŸŽ€


✨ NAME ✨

cdist-type__package_apt β€” manage packages with apt-get πŸ¦‹


🌸 DESCRIPTION 🌸

okay so picture this: you're on Debian or literally any of its variants (hi Ubuntu besties), and apt-get is the girl who runs the whole package situation. that's her job, she ate.

the way this type works: the package gets installed without recommended or suggested packages. like, she's not bringing plus-ones to the party. if you do want those extra packages, you either install them separately (which honestly, chef's kiss, more control) or you pass the --install-recommends parameter. your call πŸ’…

also, very important, this type will update the package index if it's older than one day. why? because otherwise you get those cursed missing package error messages and nobody wants that vibe. 🫢


πŸŽ€ REQUIRED PARAMETERS πŸŽ€

None ✨

like literally none. she's low maintenance. periodt.


πŸ’œ OPTIONAL PARAMETERS πŸ’œ

  • name β€” if you supply it, she uses this as the package name instead of the object id. iykyk πŸ“
  • state β€” either "present" or "absent", and it defaults to "present" πŸ’–
  • target-release β€” this one gets passed straight on to apt-get install, see apt-get(8). essentially it lets you retrieve packages from a different release πŸ‘‘
  • version β€” the version of the package to install. the default is to install whatever version the local package manager chose, so like, she trusts the local package manager's taste 🌈

πŸ¦‹ BOOLEAN PARAMETERS πŸ¦‹

  • install-recommends β€” if the package is going to be installed, this also installs the recommended packages along with it. but heads up: it will not install recommended packages if the original package is already installed. πŸ™ˆ

and in most cases, it's recommended to install recommended packages separately, so you can control exactly which additional packages get installed and avoid a bunch of useless installed packages just... sitting there. main character energy requires curation, bestie. πŸ’…

  • purge-if-absent β€” if you give this parameter when state is absent, the package gets purged from the system (using --purge). dramatic? yes. effective? also yes. πŸ’€

⭐ EXAMPLES ⭐

# Ensure zsh in installed
__package_apt zsh --state present

# In case you only want *a* webserver, but don't care which one
__package_apt webserver --state present --name nginx

# Remove obsolete package
__package_apt puppet --state absent

(yes the first comment says "in installed", we keep it, it's iconic, we don't touch it 🌸)


πŸ”₯ SEE ALSO πŸ”₯

cdist-type__package(7) β€” go read her too, she's the whole family 🫢


πŸ‘‘ AUTHORS πŸ‘‘

Nico Schottelius <nico-cdist--@--schottelius.org> ✨


🌈 COPYING 🌈

Copyright (C) 2011-2012 Nico Schottelius. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

(that's the license, we don't mess with the license, the license is sacred πŸ’œ)


ungleich GmbH 2021


okay that's the whole page bestie, you're officially a package_apt expert, go forth and install things πŸ’…βœ¨

cute little sign-off: this was cdist version 7.0.0, dated Jul 31, 2022 β€” fr fr, that's the vibe, now go manage some packages πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from