apt

package
v0.0.0-...-c24700f Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2014 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommandOutput = (*exec.Cmd).CombinedOutput

CommandOutput calls cmd.Output, this is used as an overloading point so we can test what *would* be run without actually executing another program

View Source
var (

	// ConfFile is the full file path for the proxy settings that are
	// written by cloud-init and the machine environ worker.
	ConfFile = "/etc/apt/apt.conf.d/42-juju-proxy-settings"
)

Functions

func ConfigProxy

func ConfigProxy() (string, error)

ConfigProxy will consult apt-config about the configured proxy settings. If there are no proxy settings configured, an empty string is returned.

func DetectProxies

func DetectProxies() (result proxy.Settings, err error)

DetectProxies will parse the results of ConfigProxy to return a ProxySettings instance.

func GetInstall

func GetInstall(packages ...string) error

GetInstall runs 'apt-get install packages' for the packages listed here. apt-get install calls are retried for 30 times with a 10 second sleep between attempts.

func GetPreparePackages

func GetPreparePackages(packages []string, series string) [][]string

GetPreparePackages returns a slice of installCommands. Each item in the slice is suitable for passing directly to Apt. It inspects the series passed to it and properly generates an installCommand entry with a --target-release should the series be an LTS release with cloud archive packages.

func IsPackageInstalled

func IsPackageInstalled(packageName string) bool

IsPackageInstalled uses dpkg-query to determine if the `packageName` package is installed.

func ProxyContent

func ProxyContent(proxySettings proxy.Settings) string

ProxyContent produces the format expected by the apt config files from the ProxySettings struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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