-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10Periodic.sh
More file actions
45 lines (37 loc) · 1.77 KB
/
Copy path10Periodic.sh
File metadata and controls
45 lines (37 loc) · 1.77 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
#!/bin/bash
if sed -i 's/#\?\(APT::Periodic::Update-Package-Lists\).*$/\1 "1";/' /etc/apt/apt.conf.d/10periodic; then
echo "APT 'Update-Package-Lists' configured successfully."
else
echo "Failed to configure APT 'Update-Package-Lists'. Manually check /etc/apt/apt.conf.d/10periodic."
exit 1
fi
if sed -i 's|^//\(APT::Periodic::Update-Package-Lists\.*\)$|\1|' /etc/apt/apt.conf.d/10periodic; then
echo "Uncommented 'Periodic::Update-Package-Lists' successfully"
else
echo "Failed to Uncomment 'Periodic::Update-Package-Lists' Manually check /etc/apt/apt.conf.d/10periodic"
exit 1
fi
if sed -i 's/#\?\(APT::Periodic::Download-Upgradeable-Packages\).*$/\1 "1";/' /etc/apt/apt.conf.d/10periodic; then
echo "APT 'Download-Upgradeable-Packages' configured successfully."
else
echo "Failed to configure APT 'Download-Upgradeable-Packages'. Manually check /etc/apt/apt.conf.d/10periodic."
exit 1
fi
if sed -i 's|^//\(APT::Periodic::Download-Upgradeable-Packages\)$|\1|' /etc/apt/apt.conf.d/10periodic; then
echo "Uncommented 'Periodic::Download-Upgradeable-Packages' successfully"
else
echo "Failed to Uncomment 'Periodic::Download-Upgradeable-Packages' Manually check /etc/apt/apt.conf.d/10periodic"
exit 1
fi
if sed -i 's/#\?\(APT::Periodic::AutocleanInterval\).*$/\1 "7";/' /etc/apt/apt.conf.d/10periodic; then
echo "APT 'AutocleanInterval' configured successfully."
else
echo "Failed to configure APT 'AutocleanInterval'. Manually check /etc/apt/apt.conf.d/10periodic."
exit 1
fi
if sed -i 's|^//\(APT::Periodic::AutocleanInterval\)$|\1|' /etc/apt/apt.conf.d/10periodic; then
echo "Uncommented 'APT::Periodic::AutocleanInterval' successfully"
else
echo "Failed to Uncomment 'APT::Periodic::AutocleanInterval' Manually check /etc/apt/apt.conf.d/10periodic"
exit 1
fi