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_installandservice_remove - You can control if it's enabled/disabled at boot with
service_enable_start_bootandservice_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_restartandservice_status
service_start(servicename)
service_stop(servicename)
service_restart(servicename)
service_status(servicename)
Package management
j.sal.ubuntu helps with package management:
apt_installto install a new packageapt_install_versionto install a specific version of a packagepkg_removeto remove a certain packagepkg_listto list all files of a packageget_installed_package_namesto get a list of installed packagesis_pkg_installedto find if a certain package is already installed on the systemapt_updateto update your packages listapt_upgradeto upgrade your packages
Other helpers
sshkeys_generategenerates SSH-keys
sshkeys_generate(passphrase='', type="rsa", overwrite=False, path="/root/.ssh/id_rsa"):
checkrootasserts the current user is rootwhoamiprints effective usernamesversion_getreturns a tuple ofCODENAME,Description,IDandRELEASE
j.sal.ubuntu.version_get()
('xenial', 'Ubuntu 16.04 LTS', 'ubuntu', '16.04')