You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB
Python

import subprocess
class Apt:
@staticmethod
def install(packages: list):
subprocess.run(
2 years ago
['sudo', 'apt', 'install'] + packages + ['-y'],
env={'DEBIAN_FRONTEND': 'noninteractive'},
check=True
)
@staticmethod
def remove(packages: list):
subprocess.run(
2 years ago
['sudo', 'apt', 'remove'] + packages + ['-y'],
env={'DEBIAN_FRONTEND': 'noninteractive'},
check=True
)
@staticmethod
def purge(packages: list):
subprocess.run(
2 years ago
['sudo', 'apt', 'purge'] + packages + ['-y'],
env={'DEBIAN_FRONTEND': 'noninteractive'},
check=True
)
@staticmethod
def update():
subprocess.run(
['sudo', 'apt', 'update'],
env={'DEBIAN_FRONTEND': 'noninteractive'},
check=True
)
@staticmethod
def upgrade():
subprocess.run(
2 years ago
['sudo', 'apt', 'upgrade', '-y'],
env={'DEBIAN_FRONTEND': 'noninteractive'},
check=True
)