Skip to main content

Delete

Remove a package.

Removes the package with apt-get remove. A package that is not installed does not change and reports changed: false. It runs on the Debian family only, and elsewhere reports skipped.

osapi client node package delete [flags]

Examples​

# Remove a package
osapi client node package delete --target web-01 --name tree

# A package that is not installed
osapi client node package delete --target web-01 --name tree

Result​

With the default settings, each example does this on the host:

ExampleOn the host
Remove a packageruns apt-get remove -y -- tree

The command fails in these cases:

CallFlagsFails with
A name that is an option--name -oAPT::Get=xnot a valid package name
A name longer than 255 characters--name aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanot a valid package name

Permission​

It needs the package:write permission. osapi token roles get --name <role> shows what a role grants.

Flags​

FlagDescriptionDefault
--nameThe package to remove, such as curl (required)
-T, --targetTarget: _all, _any, hostname, or label (group:web.dev)_all

Global flags​

FlagDescriptionDefault
-d, --debugEnable or disable debug mode
-j, --jsonEnable JSON output
-f, --osapi-filePath to config file/etc/osapi/osapi.yaml
--urlURL the client will connect tohttp://0.0.0.0:8080

Output tells how the result is printed, and what --json gives.