#!/bin/bash #Company: PowerCraft Technology #Author: Copyright Jelle de Jong #Note: Please send me an email if you enhanced this script #Version: 0.0.5 #Date: 23-07-2006 / 2008-12-10 / 2009-01-03 / 2009-06-03 #System: Ubuntu/Debian GNU/Linux #Information: man apt-get #Description: Update the system with the latest packages # Did the script work for you? # Yes # Yes, but with some errors # Yes, but I had to change some things # Not at all # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. cecho() { if [ "$1" = "black" ]; then echo -ne "\E[30m" elif [ "$1" = "red" ]; then echo -ne "\E[31m" elif [ "$1" = "green" ]; then echo -ne "\E[32m" elif [ "$1" = "yellow" ]; then echo -ne "\E[33m" elif [ "$1" = "blue" ]; then echo -ne "\E[34m" elif [ "$1" = "magenta" ]; then echo -ne "\E[35m" elif [ "$1" = "cyan" ]; then echo -ne "\E[36m" fi echo "$2" "$3" tput sgr0 } function usage() { echo "Application to update your system, with the standard apt tools" echo echo "Usage: $0 [options]" echo echo "Options:" echo " -h, show this help information" echo echo "Example:" echo " sudo pct-update-system" echo " x-terminal-emulator -e su-to-root -c pct-update-system" echo echo " The program can be used to update your complete system with" echo " the latest software packages available for your system" echo echo "Website:" echo " https://secure.powercraft.nl/svn/packages/" } while getopts "h" opt do case "$opt" in h) usage; exit 0 ;; *) usage; exit 2 ;; esac done cecho "green" "start update" apt-get update cecho "green" "start fix-broken check" apt-get -f install cecho "green" "start upgrade" apt-get -y upgrade cecho "green" "start autoremove" apt-get -y autoremove cecho "green" "start dist-upgrade" apt-get dist-upgrade cecho "green" "start auto cleaning" apt-get autoclean apt-get clean echo "Please try solving dependency issues with the aptitude command" cecho "green" "update script finished..." echo -n "Press the [enter] key to close and exit this window" read input exit 0