apt

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRepo

func AddRepo(
	name string,
	keyURL string,
	keyHash string,
	repoURL string,
) error

AddRepo securely adds an APT repo with corresponding PGP key. NOTE After having called AddRepo, you MUST call Refresh for the new repo to be seen by a subsequent Install.

See: https://wiki.debian.org/DebianRepository/UseThirdParty

Example:

if err := apt.AddRepo(
	"docker",
	"https://download.docker.com/linux/debian",
	"https://download.docker.com/linux/debian/gpg",
	"1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570",
); err != nil {
	return err
}
if err := apt.Update(0 * time.Second); err != nil {
	return err
}

func DpkgInstall

func DpkgInstall(pkgPath string) error

func Install

func Install(pkg ...string) error

func Refresh added in v0.3.7

func Refresh(cacheValidity time.Duration) error

Refresh calls "apt-get update" each time it is called. This function is needed _only_ after having added a new APT repo with AddRepo. Note that the function to use for the majority of cases is instead Update.

func Remove

func Remove(pkg ...string) error

func Update

func Update(cacheValidity time.Duration) error

Update calls "apt-get update" only once in the lifetime of the installer, thus ensuring a faster operation. This is normally the function to use, but see also Refresh.

Types

This section is empty.

Jump to

Keyboard shortcuts

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