Skip to content

Instantly share code, notes, and snippets.

@bonelifer
Created September 3, 2020 18:52
Show Gist options
  • Save bonelifer/3def1652ea0246f944ad680997927ca1 to your computer and use it in GitHub Desktop.
Save bonelifer/3def1652ea0246f944ad680997927ca1 to your computer and use it in GitHub Desktop.
Script that update, upgrade and clean ubuntu packages in one linux cmd.
#! / bin / sh
# @link https://gist.github.com/Junscuzzy/e7cd13973bd06b0927b959fe77283c10
# To make the script executable: chmod + x [filename]
# Then for the run: sh [filename]
echo "1. Make updates"
sudo apt-fast update # Get updates
sudo apt-fast dist-upgrade # Perform updates
echo "The packages have been updated"
sleep 3
echo "2. Ubuntu cleanup script"
sudo apt-fast autoclean
echo "Outdated packages have been removed"
sudo apt-fast clean
echo "The apt cache has been emptied"
sudo apt-fast autoremove
echo "Packages installed as dependencies no longer needed have been removed"
sudo localepurge
echo "Localpurge deleted unnecessary local files"
sleep 3
echo "Machine updated & cleaned"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment