11-20-2014, 10:36 AM
Hi folks,
I would like some volunteers to try this update script I have been working on and off for some months now.
This would require you to create this file first so that there is no interruption in the update process:
(source http://raphaelhertzog.com/2010/09/21/deb...d-by-dpkg/)
save and close.
Here is the script:
copy into the following, then save and close, and make executable:
Then open terminal and run:
and let me know how you get on.
Thanks
I would like some volunteers to try this update script I have been working on and off for some months now.
This would require you to create this file first so that there is no interruption in the update process:
(source http://raphaelhertzog.com/2010/09/21/deb...d-by-dpkg/)
Code:
sudo leafpad /etc/apt/apt.conf.d/local
Code:
Dpkg::Options {
"--force-confdef";
"--force-confold";
}
save and close.
Here is the script:
Code:
leafpad ~/updatestest
copy into the following, then save and close, and make executable:
Code:
#!/bin/bash
#-----------------------------------------------------------------------------------------
# Name: Linux Lite Updates
# Description: A GUI tool to easily install Updates in Linux Lite.
# Authors: Misko_2083, Jerry Bezencon
# Date: Nov 20th, 2014
# Website: https://www.freecinema2022.gq
#-----------------------------------------------------------------------------------------
# Kill off any package managers that may be running
sudo killall -9 synaptic
killall -9 gdebi-gtk
# Need a check here to see if any updates are available, if there are none, script pops up dialog box saying 'No Updates Available'
# Erase existing available info
sudo dpkg --clear-avail
# Linux Lite default dialog icon
ic="/usr/share/icons/zenity-llcc.png"
# Get list of available updated packages then populate them to /tmp/updateslist
zenity --question --title="Linux Lite Updates" --window-icon="/usr/share/icons/zenity-llcc.png" --text="We will now fetch the Updates list.\n\nClick Yes to continue or No to abort."
if [ "$?" -eq "0" ];then
x=$( stdbuf -oL /bin/bash \-c '(sudo apt-get update \-y )' 2>&1 |
stdbuf -oL sed -n -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p'|
zenity --progress --title="Updating package information..." --pulsate \
--width=600 --auto-close )
LISTNAMES=$(apt-get --just-print upgrade 2>&1 | perl -ne 'if (/Inst\s([\w,\-,\d,\.,~,:,\+]+)\s\[([\w,\-,\d,\.,~,:,\+]+)\]\s\(([\w,\-,\d,\.,~,:,\+]+)\)? /i) {print "Name: $1 INSTALLED: $2 AVAILABLE: $3\n"}' | tee /tmp/updateslist)
else
exit 0
fi
# Call the zenity dialog to show update list
zenity --text-info --title="List of available Updates - Click OK to continue or Cancel to stop the update process" --width=700 --height=300 --filename="/tmp/updateslist"
if [ "$?" -eq "0" ];then
# Main window dialogue.
INSTALLER_TITLE="Linux Lite Updates
-----------------------------------------------------------------------------------------------------------
Please make sure all software installation programs like
<b>Synaptic Package Manager</b> and <b>Gdebi</b> are closed before proceeding.
When you click on <b>Yes</b>, this window will close and the updates will begin.
-----------------------------------------------------------------------------------------------------------
Click on <b>Yes</b> to continue or <b>No</b> to cancel the updates process."
# Halt updates script if user selects Cancel
else
exit 0
fi
# Continue script if no halt
INSTALL_ICON="/usr/share/icons/zenity-llcc.png"
APPNAME="Linux Lite"
zenity --question --title="$APPNAME Updates" --window-icon="${INSTALL_ICON}" --text="${INSTALLER_TITLE}"
if [ "$?" -eq "0" ]; then
x=$( stdbuf -oL /bin/bash \-c '(sudo apt-get upgrade \-y )' 2>&1 | tee /var/log/llupdates.log |
stdbuf -oL sed -n -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p'|
zenity --progress --title="Updating..." --pulsate \
--width=600 --auto-close )
if [ "${PIPESTATUS[0]}" -ne "0" ]; then
zenity --error \
--title="Error" --text="$APPNAME Updates have failed."
exit 0
fi
else
exit 0
fi
PROCEED=$(zenity --question --title="$APPNAME Updates" --window-icon=/usr/share/icons/zenity-llcc.png --text="Updates have finished installing.\n\nWould you like to view the $APPNAME Updates log?"; echo $?)
if [ ${PROCEED} -eq 1 ]; then
zenity --info --title="$APPNAME Updates" --window-icon="${INSTALL_ICON}" --text="$APPNAME Updates Complete."
exit;
else
zenity --text-info --title="Updates Log" --width=700 --height=300 --filename="/var/log/llupdates.log"
fi
exit 0
Then open terminal and run:
Code:
gksudo ./updatestest
and let me know how you get on.
Thanks