-
Notifications
You must be signed in to change notification settings - Fork 0
/
post_install.py
96 lines (78 loc) · 2.2 KB
/
post_install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import os
import time
apt_apps_list = [
'flameshot',
'tmux',
'qbittorrent',
'vlc',
'vim',
'git',
'docker.io',
'neofetch',
'virtualbox',
'gparted',
'filezilla',
'remmina',
'remmina-plugin-vnc',
'clipit',
'nodejs'
]
debian_apps_list = [
'https://discord.com/api/download?platform=linux&format=deb',
'https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb',
'https://guardiao.itau.com.br/warsaw/warsaw_setup_64.deb',
'https://dbeaver.io/files/dbeaver-ce_latest_amd64.deb'
]
flatpak_apps_list = [
'com.spotify.Client',
'com.brave.Browser',
'com.github.micahflee.torbrowser-launcher'
]
def install_apt_apps(apt_apps):
print('Install apt apps:')
print('Removing apt locks...')
os.system('sudo rm -rf /var/lib/dpkg/lock-frontend')
os.system('sudo rm -rf /var/cache/apt/archives/lock')
print('Updating apt...')
os.system('sudo apt-get update')
print('Beggining installation...')
for i in apt_apps:
print(f'Installing -> {i}')
os.system(f'sudo apt-get install -y {i}')
print()
def install_debian_apps(debian_apps):
print('Install debian apps:')
print('Downloading packages...')
try:
os.mkdir('temp')
for i in debian_apps:
os.system(f'sudo wget {i} -P temp')
print('Beggining installation...')
os.system('sudo dpkg -i temp/*.deb')
except OSError as err:
print(err)
def install_flatpak_apps(flatpak_apps):
print('Install flatpak apps:')
print('Beggining installation...')
try:
for i in flatpak_apps:
os.system(f'flatpak install -y -v flathub {i}')
except OSError as err:
print(err)
def finish_actions():
print("Cleaning...")
try:
os.system("apt autoclean -y")
os.system("apt autoremove -y")
os.system("sudo rm -rf temp/")
print("Execution finished!")
except OSError as err:
print(err)
def main():
print('Linux post install script!\n')
install_apt_apps(apt_apps_list)
install_debian_apps(debian_apps_list)
install_flatpak_apps(flatpak_apps_list)
finish_actions()
if __name__ == '__main__':
main()