apt

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAuthCommand = "sudo"

DefaultAuthCommand is the default command used for authentication.

View Source
const DefaultPackageCommand = "apt-get"

Variables

This section is empty.

Functions

func SearchPackages added in v0.11.0

func SearchPackages(pkgs []string, version string) (string, []string)

Types

type AptManager

type AptManager struct {
	Parser packagemanagercommon.PackageParser
	// contains filtered or unexported fields
}

AptManager implements PackageManager for systems using APT.

func NewAptManager

func NewAptManager() *AptManager

NewAptManager creates a new AptManager with default settings.

func (*AptManager) CheckVersion added in v0.7.0

func (a *AptManager) CheckVersion(pkgs []packagemanagercommon.Package) (string, []string)

func (*AptManager) Configure

func (a *AptManager) Configure(options ...packagemanagercommon.PackageManagerOption)

Configure applies functional options to customize the package manager.

func (*AptManager) Install

func (a *AptManager) Install(pkgs []packagemanagercommon.Package, args []string) (string, []string)

Install returns the command and arguments for installing a package.

func (*AptManager) ParseRemotePackageManagerVersionOutput added in v0.11.0

func (a *AptManager) ParseRemotePackageManagerVersionOutput(output string) ([]packagemanagercommon.Package, error)

Parse parses the apt-cache policy output to extract Installed and Candidate versions.

func (*AptManager) Remove

func (a *AptManager) Remove(pkgs []packagemanagercommon.Package, args []string) (string, []string)

Remove returns the command and arguments for removing a package.

func (*AptManager) SetAuthCommand

func (a *AptManager) SetAuthCommand(authCommand string)

SetAuthCommand sets the authentication command.

func (*AptManager) SetUseAuth

func (a *AptManager) SetUseAuth(useAuth bool)

SetUseAuth enables or disables authentication.

func (*AptManager) Upgrade

func (a *AptManager) Upgrade(pkgs []packagemanagercommon.Package) (string, []string)

func (*AptManager) UpgradeAll

func (a *AptManager) UpgradeAll() (string, []string)

UpgradeAll returns the command and arguments for upgrading all packages.

Jump to

Keyboard shortcuts

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