This commit is contained in:
Zsolt Ero
2023-12-05 21:06:29 +01:00
parent 2fbfe15b85
commit fab71939ad
11 changed files with 17 additions and 17 deletions

38
ssh_lib/pkg_base.py Normal file
View File

@@ -0,0 +1,38 @@
from ssh_lib.utils import (
apt_get_autoremove,
apt_get_install,
apt_get_purge,
apt_get_update,
sudo_cmd,
)
def pkg_upgrade(c):
apt_get_update(c)
c.sudo(
'DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold"'
)
def pkg_clean(c):
clean_list = [
# firewalls
'ufw',
'nftables',
'firewalld',
'iptables-persistent',
# bloat
'ntfs-3g',
'popularity-contest',
'landscape*',
'ubuntu-advantage-tools',
]
apt_get_purge(c, ' '.join(clean_list))
apt_get_autoremove(c)
sudo_cmd(c, 'dpkg --list | grep "^rc" | cut -d " " -f 3 | xargs -r dpkg --purge')
c.sudo('iptables -L')
def pkg_base(c):
apt_get_install(c, 'python3 nload iftop')