Ubuntu
The Ubuntu SAL helps to manage packages and services in Ubuntu > 14.
You can access as follows:
j.sal.ubuntu
Service Management
- You can control the installation/removal of services via
service_install
andservice_remove
- You can control if it's enabled/disabled at boot with
service_enable_start_boot
andservice_disable_start_boot
service_install(servicename, daemonpath, args='', respawn=True, pwd=None,env=None,reload=True)
service_uninstall(servicename)
service_enable_start_boot(servicename)
service_disable_start_boot(servicename)
- You can control the service life cycle (Start, Stop, Restart, Status) via
service_start
,service_stop
,service_restart
andservice_status
service_start(servicename)
service_stop(servicename)
service_restart(servicename)
service_status(servicename)
Package management
j.sal.ubuntu
helps with package management:
apt_install
to install a new packageapt_install_version
to install a specific version of a packagepkg_remove
to remove a certain packagepkg_list
to list all files of a packageget_installed_package_names
to get a list of installed packagesis_pkg_installed
to find if a certain package is already installed on the systemapt_update
to update your packages listapt_upgrade
to upgrade your packages
Other helpers
sshkeys_generate
generates SSH-keys
sshkeys_generate(passphrase='', type="rsa", overwrite=False, path="/root/.ssh/id_rsa"):
checkroot
asserts the current user is rootwhoami
prints effective usernamesversion_get
returns a tuple ofCODENAME
,Description
,ID
andRELEASE
j.sal.ubuntu.version_get()
('xenial', 'Ubuntu 16.04 LTS', 'ubuntu', '16.04')