-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.system_update.sh
More file actions
executable file
·48 lines (41 loc) · 1.07 KB
/
.system_update.sh
File metadata and controls
executable file
·48 lines (41 loc) · 1.07 KB
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
#--- Author: Muhammad Khubaib Umer
#--- Description: Bash script to update and upgrade new packages
#--- Dated: 11-07-2019
#! /bin/bash
CLR='\033[0;34m'
ENDCLR='\033[0;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
check_ret() {
if [ $? -ne 0 ]
then
echo "${RED} Update Sequence failed... Please Run Update Manually..."
exit $?
fi
}
echo "${CLR} Please Wait While Repository Lists are being Updated... ${NC}"
apt update
check_ret $?
#sleep 1
echo "${CLR}Please Wait While Newer Packages are being Installed...${NC}"
apt upgrade -y
check_ret $?
#sleep 1
echo "${CLR}Please Wait While Old Repository Lists are being Removed...${NC}"
apt autoclean
check_ret $?
#sleep 1
echo "${CLR}Please Wait While Old/Deprecated/Obselete Packages are being Removed...${NC}"
apt autoremove -y
check_ret $?
#sleep 1
echo "${CLR}Please Wait While Dependencies are Resolved...${NC}"
apt install -f -y
check_ret $?
#sleep 1
echo "${CLR}Please Wait While unconfigured Packages are Processed...${NC}"
dpkg --configure -a
check_ret $?
#sleep 1
echo "${ENDCLR}Your System is up-to-date...${NC}"
exit 0