sudo apt update -y
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo apt autoremove -yall in one line
sudo apt update -y && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y
sudo swapon --showfree -hsudo fallocate -l 8G /swapfile
# OR if fallocate is unsupported:
sudo dd if=/dev/zero of=/swapfile bs=1M count=8192sudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfilesudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo nano /etc/sysctl.confAdd or modify:
vm.swappiness=10
Apply:
sudo sysctl --systemhtop
free -hsystemctl
service --status-all
chkconfig --listDisable at boot:
sudo systemctl disable <service-name>Stop immediately:
sudo systemctl stop <service-name>Disable at boot:
sudo update-rc.d -f <service-name> removeStop immediately:
sudo service <service-name> stopsystemctl status <service-name>
service <service-name> status✅ Make sure no critical services are stopped.
sudo reboot✅ Check CPU, memory, and disk usage after changes:
htop
free -h
df -h