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.0 KiB
Python
45 lines
1.0 KiB
Python
2 years ago
|
import subprocess
|
||
|
|
||
|
|
||
|
class Apt:
|
||
|
|
||
|
@staticmethod
|
||
2 years ago
|
def install(packages: list):
|
||
2 years ago
|
subprocess.run(
|
||
|
['sudo', 'apt', 'install'] + packages,
|
||
|
env={'DEBIAN_FRONTEND': 'noninteractive'},
|
||
|
check=True
|
||
|
)
|
||
|
|
||
|
@staticmethod
|
||
2 years ago
|
def remove(packages: list):
|
||
2 years ago
|
subprocess.run(
|
||
|
['sudo', 'apt', 'remove'] + packages,
|
||
|
env={'DEBIAN_FRONTEND': 'noninteractive'},
|
||
|
check=True
|
||
|
)
|
||
|
|
||
|
@staticmethod
|
||
2 years ago
|
def purge(packages: list):
|
||
2 years ago
|
subprocess.run(
|
||
|
['sudo', 'apt', 'purge'] + packages,
|
||
|
env={'DEBIAN_FRONTEND': 'noninteractive'},
|
||
|
check=True
|
||
|
)
|
||
|
|
||
|
@staticmethod
|
||
2 years ago
|
def update():
|
||
2 years ago
|
subprocess.run(
|
||
|
['sudo', 'apt', 'update'],
|
||
|
env={'DEBIAN_FRONTEND': 'noninteractive'},
|
||
|
check=True
|
||
|
)
|
||
|
|
||
|
@staticmethod
|
||
2 years ago
|
def upgrade():
|
||
2 years ago
|
subprocess.run(
|
||
|
['sudo', 'apt', 'upgrade'],
|
||
|
env={'DEBIAN_FRONTEND': 'noninteractive'},
|
||
|
check=True
|
||
|
)
|