You are Here:
Download Linux Lite 5.8 RC1 today - See Release Announcements



X Close Ad
X Close Ad
GUI Updates script

Author (Read 20824 times)

0 Members and 1 Guest are viewing this topic.

GUI Updates script
« on: November 20, 2014, 05:36:09 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
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/debian-conffile-configuration-file-managed-by-dpkg/)

Code: [Select]
sudo leafpad /etc/apt/apt.conf.d/local
Code: [Select]
Dpkg::Options {
   "--force-confdef";
   "--force-confold";
}

save and close.

Here is the script:

Code: [Select]
leafpad ~/updatestest
copy into the following, then save and close, and make executable:

Code: [Select]
#!/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.linuxliteos.com
#-----------------------------------------------------------------------------------------

# 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: [Select]
gksudo ./updatestest
and let me know how you get on.

Thanks :)
« Last Edit: November 24, 2014, 02:00:36 AM by Jerry »
 

Re: GUI Updates script
« Reply #1 on: November 20, 2014, 08:09:44 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
I'm going to run this on 2.2 Final on my own computer for several months until 2.4 is released to see if it stands the test of time. If this works well and is stable, I hope to include it in 2.4 next year, being such a critical piece of software, it has to work well over a long period of time.
 

Re: GUI Updates script
« Reply #2 on: November 20, 2014, 08:44:52 AM »
 

jabbott

  • Guest
JB
I would be happy too help with the script test; however, I am unable to do so because since I installed the updates on my Dell D620, that you did the remote install on (11/06/14) I have no wireless access too the network. I tried the on board help too locate a fix or a method of trouble shooting. Failing too find a fix I did as you advised and posted my problem on the forum but to date haven't received a reply. With God's help I am doing my best too find out why installing the updates would wipe out my wifi access too the network and as soon as I find the answer I will post it and should you still need a script tester be more than happy too help. God bless you.
tnx john
 

Re: GUI Updates script
« Reply #3 on: November 20, 2014, 09:49:19 AM »
 

Scott

  • Global Moderator
  • Gold Level Poster
  • *****
  • 857
    Posts
  • Reputation: 186
  • Linux Lite Member

  • Linux Lite: 3.4 64bit

  • CPU: Dual core Intel Core i3 M 330

  • MEMORY: 6Gb

  • VIDEO CARD: Intel Integrated Graphics
@Jerry - Testing the script now. I'll have some feedback soon.
 

Re: GUI Updates script
« Reply #4 on: November 20, 2014, 10:23:21 AM »
 

Scott

  • Global Moderator
  • Gold Level Poster
  • *****
  • 857
    Posts
  • Reputation: 186
  • Linux Lite Member

  • Linux Lite: 3.4 64bit

  • CPU: Dual core Intel Core i3 M 330

  • MEMORY: 6Gb

  • VIDEO CARD: Intel Integrated Graphics
The script is running well for me (LL 2.2/64 Beta on VBox). Possibly one small issue (see note at bottom). After running the new script(updatestest) the original script "install updates" will generate an error:



Commenting out these in "install updates" will fix it or at least stop the error.
killall -9 synaptic
killall -9 gdebi-gtk

Some troubleshooting I tried
logout/login didn't help
reboot didn't didn't help

Note. I say this is a possible issue because when this script is released I assume the orginal script "install updates" will be removed.
 

Re: GUI Updates script
« Reply #5 on: November 20, 2014, 03:35:29 PM »
 

Scott

  • Global Moderator
  • Gold Level Poster
  • *****
  • 857
    Posts
  • Reputation: 186
  • Linux Lite Member

  • Linux Lite: 3.4 64bit

  • CPU: Dual core Intel Core i3 M 330

  • MEMORY: 6Gb

  • VIDEO CARD: Intel Integrated Graphics
It looks like the update error above (reply #4) in the screenshot has nothing to do with the updatestest script but with package:
lite-software 1.0-0330-linuxlite.

This line in the updates script seems to be the cause
sudo killall -9 synaptic && killall -9 gdebi-gtk && sudo apt-get update && sudo apt-get upgrade

Specifically these commands
killall -9 synaptic && killall -9 gdebi-gtk

~Scott
 

Re: GUI Updates script
« Reply #6 on: November 20, 2014, 04:58:54 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
@Scott, that particular 'error' stems from the script closing gdebi or synaptic if they are open so that Install Updates completes uninterrupted. It was an addition I made recently as I've noticed newbies posting Install Updates doesn't complete, in the end only to find out they have another package manager open. I need to fine tune it and put an 'if, else' statement in there to suppress the reported 'error'. Thank you for helping with the testing :)

@jabbott, this thread is specifically about a new GUI updates script. Which area of the forum did you originally post your thread? I see nothing under the Hardware Support > Network section in your name. If you have not started one there yet, please do so to receive the correct Support. Thank you.
 

Re: GUI Updates script
« Reply #7 on: November 20, 2014, 05:04:48 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 688
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Quick fix for the updates. Replace the line 15 in /usr/scripts/updates with this.
Code: [Select]
sudo killall -9 synaptic || echo ok && killall -9 gdebi-gtk || echo ok && sudo apt-get update && sudo apt-get upgrade
 

Re: GUI Updates script
« Reply #8 on: November 20, 2014, 05:16:24 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Thanks misko, a good quick fix there, What we need long term is a if-else statement that suppresses any errors :)
 

Re: GUI Updates script
« Reply #9 on: November 20, 2014, 05:29:04 PM »
 

Scott

  • Global Moderator
  • Gold Level Poster
  • *****
  • 857
    Posts
  • Reputation: 186
  • Linux Lite Member

  • Linux Lite: 3.4 64bit

  • CPU: Dual core Intel Core i3 M 330

  • MEMORY: 6Gb

  • VIDEO CARD: Intel Integrated Graphics
Apologies if I was a bit enthusiastic :) with my postings. Couldn't sleep last night and had too much time on my hands.
 

Re: GUI Updates script
« Reply #10 on: November 20, 2014, 05:33:45 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 688
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Thanks misko, a good quick fix there, What we need long term is a if-else statement that suppresses any errors :)
Here you go, pall. :)
Code: [Select]
#!/bin/bash

bold=`tput bold`
normal=`tput sgr0`

echo "${bold}**********************"
echo "Linux Lite 2.0 Updates"
echo "**********************${normal}"
echo ""
echo "Linux Lite will now search for updates for your computer."
echo "Once installed, your computer will be up to date."
echo "Simply follow the onscreen instructions."
echo ""
echo "Please enter your password to continue..."
if [ "$(pidof synaptic)" ]
then
sudo killall -9 synaptic
else
echo""
fi
if [ -z "$(pgrep gdebi-gtk)" ]
then
echo ""
else
killall -9 gdebi-gtk
fi
sudo apt-get update && sudo apt-get upgrade
echo ""
echo "Updates complete."
echo "This window will now close."
sleep 5
 

Re: GUI Updates script
« Reply #11 on: November 20, 2014, 05:42:48 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Thanks misko, a good quick fix there, What we need long term is a if-else statement that suppresses any errors :)
Here you go, pall. :)
Code: [Select]
#!/bin/bash

bold=`tput bold`
normal=`tput sgr0`

echo "${bold}**********************"
echo "Linux Lite 2.0 Updates"
echo "**********************${normal}"
echo ""
echo "Linux Lite will now search for updates for your computer."
echo "Once installed, your computer will be up to date."
echo "Simply follow the onscreen instructions."
echo ""
echo "Please enter your password to continue..."
if [ "$(pidof synaptic)" ]
then
sudo killall -9 synaptic
else
echo""
fi
if [ -z "$(pgrep gdebi-gtk)" ]
then
echo ""
else
killall -9 gdebi-gtk
fi
sudo apt-get update && sudo apt-get upgrade
echo ""
echo "Updates complete."
echo "This window will now close."
sleep 5

Beautiful misko! I'll upload the new deb's soon :)
 

Re: GUI Updates script
« Reply #12 on: November 20, 2014, 05:48:13 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
New versions uploaded, credits to misko in the updates script.

First post script updated too.
« Last Edit: November 20, 2014, 05:50:49 PM by Jerry »
 

Re: GUI Updates script
« Reply #13 on: November 21, 2014, 05:28:28 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 688
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Made some changes to the script.
Added: A check to see if any updates are available, if there are none, script pops up a dialog box saying 'No Updates Available'.
Changes: Script opens a list of available updates.
Note: The list of packages that have been kept back is not displaying.

Code: [Select]
#!/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.linuxliteos.com
#-----------------------------------------------------------------------------------------

# Kill off any package managers that may be running
if [ "$(pidof synaptic)" ]
then
sudo killall -9 synaptic
else
echo ""
fi

if [ -z "$(pgrep gdebi-gtk)" ]
then
echo ""
else
killall -9 gdebi-gtk
fi

# 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 )


# Creates a list in /tmp/updateslist
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)

# A check here to see if any updates are available, if there are none, script pops up dialog box saying 'No Updates Available', removes /tmp/updateslist
if [  -z "$(cat /tmp/updateslist)"  ]; then
zenity --info --window-icon="/usr/share/icons/zenity-llcc.png" --title="Linux Lite Updates" \
--text="No Updates Available"
rm /tmp/updateslist
exit 0
fi

# Erase existing available info
sudo dpkg --clear-avail



else
       exit 0
fi

# Get the list from /tmp/updateslist and call the zenity dialog to show update list
UPDATELIST=(`cat /tmp/updateslist | awk '{print "TRUE\n",$2,"\n",$4,"\n",$6}' `)
LIST=$(zenity --list --checklist --column="pick" --column="NAME" --column="INSTALLED" --column="AVAILABLE" "${UPDATELIST[@]}" --separator=" " --text="Text goes here." --width=800 --height=700)
   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 install $LIST \-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
 

Re: GUI Updates script
« Reply #14 on: November 21, 2014, 07:38:32 PM »
 

iwar

  • Occasional Poster
  • **
  • 64
    Posts
  • Reputation: 0
  • Linux Lite Member
I have 1.06 can i run the script or? /ivar
 

 

X Close Ad
X Close Ad

Download Linux Lite 5.8 RC1 today - See Release Announcements