apt

package
v0.0.0-...-02c76fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// PkgHold means package is installed and held to a version
	PkgHold = "hold ok installed"

	// PkgInstalled means package is installed normally
	PkgInstalled = "install ok installed"

	// PkgRemoved means package has been removed, but not purged (config files still present)
	PkgRemoved = "deinstall ok config-files"

	// PkgUninstalled means package has been uninstalled
	PkgUninstalled = "unknown ok not-installed"
)

Outputs from dpkg-query

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Sys pkg.SysCaller
}

Manager provides a concrete implementation of PackageManager for debian packages.

func (*Manager) InstallPackage

func (a *Manager) InstallPackage(p string) (string, error)

InstallPackage installs a package, returning an error if something went wrong

func (*Manager) InstalledVersion

func (a *Manager) InstalledVersion(p string) (pkg.PackageVersion, bool)

InstalledVersion gets the installed version of package, if available

func (*Manager) RemovePackage

func (a *Manager) RemovePackage(p string) (string, error)

RemovePackage removes a package, returning an error if something went wrong

type Preparer

type Preparer struct {
	// Name of the package or package group.
	Name string `hcl:"name" required:"true" nonempty:"true"`

	// State of the package. Present means the package will be installed if
	// missing; Absent means the package will be uninstalled if present.
	State pkg.State `hcl:"state" valid_values:"present,absent"`
}

Preparer for Debian Package

Apt Package manages system packages with `apt` and `dpkg`. It assumes that both `apt` and `dpkg` are installed on the system, and that the user has permissions to install, remove, and query packages.

func (*Preparer) Prepare

func (p *Preparer) Prepare(ctx context.Context, render resource.Renderer) (resource.Task, error)

Prepare a new package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL