-
-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathss-install-ubuntu-utils.txt
212 lines (160 loc) · 9.8 KB
/
ss-install-ubuntu-utils.txt
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
#!/bin/bash
####################################################################################################
#### author: SlickStack ############################################################################
#### link: https://slickstack.io ###################################################################
#### mirror: littlebizzy/slickstack/blob/master/bash/ss-install-ubuntu-utils.txt ###################
#### path: /var/www/ss-install-ubuntu-utils ########################################################
#### destination: n/a (not a boilerplate) ##########################################################
#### purpose: Reinstalls various Linux utilities (etc) for SlickStack servers (idempotent) #########
#### module version: Ubuntu 24.04 LTS ##############################################################
#### sourced by: ss-install ########################################################################
#### bash aliases: ss install ubuntu utils, ss install utils #######################################
####################################################################################################
## SS-CONFIG MUST BE PROPERLY CONFIGURED AND ON CURRENT BUILD BEFORE RUNNING SS-INSTALL ##
## ENSURE YOUR SS-CONFIG BUILD REMAINS CURRENT BY RUNNING SS-UPDATE OCCASIONALLY ##
####################################################################################################
#### TABLE OF CONTENTS (SS-Install-Ubuntu-Utils) ###################################################
####################################################################################################
## this is a brief summary of the different code snippets you will find in this script ##
## each section should be commented so you understand what is being accomplished ##
## A. Source SS-Config + SS-Functions
## B. Touch Timestamp File
## C. Message (Begin Script)
## D. Update Existing Packages
## E. Prettify The Shell Prompt
## F. Update System Timezone
## G. Install Various Linux Utilities
## X. Make Nano Default System-wide Editor
## H. Reset Permissions (Ubuntu Utils)
####################################################################################################
#### A. SS-Install-Nginx-Config: Source SS-Config + SS-Functions ###################################
####################################################################################################
## before anything else we must source the critical variables that power this script ##
## ss-config is setup during ss-install wizard but ss-functions is hardcoded ##
## source ss-config ##
source /var/www/ss-config
## source ss-functions ##
source /var/www/ss-functions
## BELOW THIS RELIES ON SS-CONFIG AND SS-FUNCTIONS
####################################################################################################
#### B. SS-Install-Ubuntu-Utils: Touch Timestamp File ##############################################
####################################################################################################
## this is a dummy timestamp file that will remember the last time this script was run ##
## it can be useful for developer reference and is sometimes used by SlickStack ##
ss_touch "${TIMESTAMP_SS_INSTALL_UBUNTU_UTILS}"
####################################################################################################
#### C. SS-Install-Ubuntu-Utils: Message (Begin Script) ############################################
####################################################################################################
## this is a simple message that announces to the shell the purpose of this bash script ##
## it will only be seen by sudo users who manually run this script in the shell ##
ss_echo "${COLOR_INFO}Running ss-install-ubuntu-utils... ${COLOR_RESET}"
####################################################################################################
#### D. SS-Install-Ubuntu-Utils: Update Existing Packages ##########################################
####################################################################################################
## SNIPPET: ss-install-*-packages bash scripts
## UPDATED: 30MAR2022
## we must include the standard apt update/upgrade in case script is called directly ##
## this helps to avoid conflicts and outdated packages during installation ##
## update apt cache ##
ss_apt_update
## upgrade packages ##
ss_apt_upgrade
####################################################################################################
#### E. SS-Install-Ubuntu-Utils: Prettify The Shell Prompt #########################################
####################################################################################################
## Move this to ss-install-ubuntu-bash maybe ? ##
## download latest versions ##
ss_wget /tmp/custom-shell-prompt "${GITHUB_CUSTOM_SHELL_PROMPT}"
## delete old one ##
ss_rm /etc/profile.d/custom-shell-prompt
## copy files to their destinations ##
ss_cp /tmp/custom-shell-prompt /etc/profile.d/custom-shell-prompt.sh
####################################################################################################
#### F. SS-Install-Ubuntu-Utils: Update System Timezone ############################################
####################################################################################################
if [[ -z "${SS_TIMEZONE}" ]]; then
sudo timedatectl set-timezone UTC
else
sudo timedatectl set-timezone "${SS_TIMEZONE}"
fi
####################################################################################################
#### G. SS-Install-Ubuntu-Utils: Install Various Linux Utilities ###################################
####################################################################################################
## do-release-upgrade support ##
ss_apt_install update-manager-core
## ppa management support ##
ss_apt_install software-properties-common
## coreutils ##
ss_apt_install coreutils
## dnsutils (required for dig) ##
ss_apt_install dnsutils
## virt-what (detects virtualization) ##
ss_apt_install virt-what
## sshpass (required for remote connections) ##
ss_apt_install sshpass
## used in ubuntu 18.04 for some apt tools ##
ss_apt_install debconf-utils
## exiftool (for cleaning up exif data) ##
ss_apt_install "${PACKAGE_EXIFTOOL}"
## new ##
ss_apt_install nano
ss_apt_install cron
ss_apt_install wget
ss_apt_install bash
ss_apt_install curl
ss_apt_install openssl
ss_apt_install sed
ss_apt_install rsync
ss_apt_install zip
ss_apt_install unzip
ss_apt_install dos2unix
ss_apt_install gzip
ss_apt_install tar
## not sure yet ##
# ss_apt_install logrotate
# ss_apt_install bash-completion
# ss_apt_install iptables-persistent
####################################################################################################
#### X. SS-Install-Ubuntu-Utils: Make Nano Default System-wide Editor ##############################
####################################################################################################
update-alternatives --set editor /bin/nano
####################################################################################################
#### H. SS-Install-Ubuntu-Utils: Reset Permissions (Ubuntu Utils) ##################################
####################################################################################################
source "${PATH_SS_PERMS_UBUNTU_UTILS}"
####################################################################################################
#### SlickStack: Reset Permissions (SlickStack Scripts) ############################################
####################################################################################################
## we include this permissions reset in all cron jobs and bash scripts for redundancy ##
## chmod 0700 means only the root/sudo users can execute any SlickStack scripts ##
## THIS SNIPPET DOES NOT RELY ON SS-CONFIG OR SS-FUNCTIONS
## SNIPPET: ss bash scripts, ss cron jobs
## UPDATED: 02JUL2022
chown root:root /var/www/ss* ## must be root:root
chown root:root /var/www/crons/*cron* ## must be root:root
chown root:root /var/www/crons/custom/*cron* ## must be root:root
chmod 0700 /var/www/ss* ## 0700 means only root/sudo can execute
chmod 0700 /var/www/crons/*cron* ## 0700 means only root/sudo can execute
chmod 0700 /var/www/crons/custom/*cron* ## 0700 means only root/sudo can execute
####################################################################################################
#### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ###############
####################################################################################################
## Ref: ChatGPT
## Ref: https://github.com/littlebizzy/slickstack/issues/77
## Ref: https://help.ubuntu.com/community/rsync
## Ref: http://people.redhat.com/~rjones/virt-what/
## Ref: https://unix.stackexchange.com/questions/89714/easy-way-to-determine-virtualization-technology
## Ref: https://linuxnightly.com/how-to-remove-exif-data-via-linux-command-line/
## Ref: https://linuxpip.org/install-rclone/
## Ref: http://manpages.ubuntu.com/manpages/cosmic/man1/rclone.1.html
## Ref: https://help.backblaze.com/hc/en-us/articles/1260804565710-How-to-use-rclone-with-Backblaze-B2-Cloud-Storage
## Ref: https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html
## Ref: https://github.com/frdmn/minebackup.sh/issues/5
## Ref: https://howtoinstall.co/en/nice
## Ref: https://askubuntu.com/questions/733169/how-to-install-libxml2-in-ubuntu-15-10
## Ref: https://stackoverflow.com/questions/41887754/why-apt-get-install-openssl-did-not-install-last-version-of-openssl
## Ref: https://slickstack.io/forum/topic/installing-slickstack-on-1gb-ram-openvz-from-dedipath
## Ref: https://www.cyberciti.biz/faq/check-ram-speed-linux/
## Ref: https://www.makeuseof.com/best-networking-tools-replace-old-net-tools-linux/
## Ref: https://www.cyberciti.biz/faq/ubuntu-dig-command-not-found-install-digonubuntu/
## SS_EOF