pkgmanlib

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PkgInstall = map[string]string{
	"debian":   "apt-get install ",
	"centos":   "yum install ",
	"fedora":   "dnf install ",
	"opensuse": "zypper install ",
	"arch":     "pacman -S ",
	"rhel":     "yum install ",
	"sles":     "zypper install ",
	"ubuntu":   "apt-get install ",
}

PkgInstall map of Pkgs for every OS. Installation flags differ from dist

View Source
var PkgRefresh = map[string]string{
	"debian":   "apt-get update",
	"centos":   "yum check-update",
	"fedora":   "dnf check-update",
	"opensuse": "zypper refresh",
	"arch":     "pacman -Sy",
	"rhel":     "yum update",
	"sles":     "zypper refresh",
	"ubuntu":   "apt-get update",
}

PkgRefresh refresh/update of packages before update

View Source
var PkgUninstall = map[string]string{
	"debian":   "apt-get remove ",
	"centos":   "yum remove ",
	"fedora":   "dnf remove ",
	"opensuse": "zypper remove ",
	"arch":     "pacman -R ",
	"rhel":     "yum remove ",
	"sles":     "zypper remove ",
	"ubuntu":   "apt-get remove ",
}

PkgUninstall map of Pkgs for every OS. Installation flags differ from dist

View Source
var PkgUpdate = map[string]string{
	"debian":   "apt-get upgrade -y",
	"centos":   "yum update -y",
	"fedora":   "dnf upgrade -y",
	"opensuse": "zypper update -y",
	"arch":     "pacman -Syu",
	"rhel":     "yum update -y",
	"sles":     "zypper update -y",
	"ubuntu":   "apt-get upgrade -y",
}

PkgUpdate map of Pkgs with update flags for every dist. Updates take different flags and arguments

View Source
var PkgUpdateOS = map[string]string{
	"debian":   "apt-get dist-upgrade -y",
	"centos":   "yum update -y",
	"fedora":   "dnf system-upgrade download --refresh --releasever=$(awk -v s=1 '{print $3+s}' /etc/fedora-release) -y",
	"opensuse": "zypper dup -y",
	"arch":     "pacman -Syyu",
	"rhel":     "yum update -y",
	"sles":     "zypper dup -y",
	"ubuntu":   "apt-get dist-upgrade -y",
}

PkgUpdateOS map of Pkgs with update flags for every dist. Updates take different flags and arguments

Functions

func Install

func Install(username string, os string) (installcommand string)

Install this will install any packages specified on the servers, creating the correct command for each major distribution and/or package manager

func Uninstall

func Uninstall(username string, os string) (uninstallcommand string)

Uninstall this will install any packages specified on the servers, creating the correct command for each major distribution and/or package manager

func Update

func Update(username string, os string) (updatecommand string)

Update this function is for updating all packages and services. It will check if the user is a user or if it is root (if root, no sudo, if !root then add sudo), before it will check the oslib for the correct OS, to create the correct command

func UpdateOS

func UpdateOS(username string, os string) (updatecommand string)

UpdateOS same as the Update function, but will run any OS/distribution related upgrade/update parameters to upgrade all packages including the OS some OS's does not have this functionality and updates the OS during a normal update. So if the OS does have a separate upgrade option (eg. debian dist-upgrade), then this function is redundant

Types

This section is empty.

Jump to

Keyboard shortcuts

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