-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboostLinuxMint.sh
More file actions
executable file
·87 lines (73 loc) · 2.55 KB
/
Copy pathboostLinuxMint.sh
File metadata and controls
executable file
·87 lines (73 loc) · 2.55 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
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
#!/bin/bash
echo "==> Starting Enhanced Linux Mint Optimization Script..."
# 1. Update system
echo "==> Updating system..."
apt update && apt upgrade -y
# 2. Install essential optimization tools
echo "==> Installing preload, zram-config, stacer, htop..."
apt install -y preload zram-config stacer htop
# 3. Optimize swappiness
echo "==> Optimizing swappiness..."
if grep -q "vm.swappiness" /etc/sysctl.conf; then
sed -i 's/^vm.swappiness=.*/vm.swappiness=10/' /etc/sysctl.conf
else
echo 'vm.swappiness=10' >> /etc/sysctl.conf
fi
sysctl -w vm.swappiness=10
# 4. Clean system
echo "==> Cleaning up the system..."
apt autoremove --purge -y
apt clean
# 5. Setup automatic weekly cleanup via cron
echo "==> Setting up automatic weekly cleanup..."
cat <<EOF > /etc/cron.weekly/clean-mint
#!/bin/bash
apt autoremove --purge -y >> /var/log/mint-autoclean.log 2>&1
apt clean >> /var/log/mint-autoclean.log 2>&1
EOF
chmod +x /etc/cron.weekly/clean-mint
# 6. Disable unneeded startup apps manually
echo "==> NOTE: Review and disable unneeded startup applications via Menu > Startup Applications."
# 7. Ensure zRAM is enabled
echo "==> Enabling zRAM service..."
systemctl enable zram-config
systemctl start zram-config
# 8. Enable periodic TRIM for SSDs
echo "==> Enabling periodic TRIM for SSDs..."
systemctl enable fstrim.timer
systemctl start fstrim.timer
# 9. Disable unnecessary services
echo "==> Disabling unnecessary services..."
if systemctl is-enabled bluetooth.service &>/dev/null; then
systemctl disable bluetooth.service
systemctl stop bluetooth.service
echo "Bluetooth service disabled."
else
echo "Bluetooth service not found or already disabled."
fi
# Disable Apache from starting automatically
if systemctl is-enabled apache2.service &>/dev/null; then
systemctl disable apache2.service
systemctl stop apache2.service
echo "Apache service disabled."
else
echo "Apache service not found or already disabled."
fi
# Disable MySQL from starting automatically
if systemctl is-enabled mysql.service &>/dev/null; then
systemctl disable mysql.service
systemctl stop mysql.service
echo "MySQL service disabled."
else
echo "MySQL service not found or already disabled."
fi
# Disable MariaDB from starting automatically
if systemctl is-enabled mariadb.service &>/dev/null; then
systemctl disable mariadb.service
systemctl stop mariadb.service
echo "MariaDB service disabled."
else
echo "MariaDB service not found or already disabled."
fi
echo "==> Optimization complete!"
echo "==> Please reboot your system to apply all changes."