Linux Lite Forums
Upgrade Script - Printable Version

+- Linux Lite Forums (https://www.linuxliteos.com/forums)
+-- Forum: Development (https://www.linuxliteos.com/forums/forumdisplay.php?fid=7)
+--- Forum: Linux Lite Software Development (https://www.linuxliteos.com/forums/forumdisplay.php?fid=30)
+--- Thread: Upgrade Script (/showthread.php?tid=1244)

Pages: 1 2 3 4 5


Upgrade Script - Valtam - 12-10-2014

Looking to give people a way to upgrade, interactively and easily. The upgrade will ONLY be applicable for LL series releases ie. You will be able to upgrade from any version in the 2.0 - 2.8 series, but not from the 2.0 to a future 3.0 series.

This feature has been requested a lot. The script is in it's infancy, there is still much to do. If you'd like to test do the following:

1) Do a fresh install of 2.0 to a Virtualbox.
2) Make a file called lite-upgrade and make it executable.
2) Copy the script to /usr/bin
3) Click on the Whisker Menu and type in: gksudo lite-upgrade in the search box. Follow the prompts.

Of course I welcome code contributions and suggestions Smile

This is what I have so far:

Code:
#!/bin/bash
#------------------------------------------------------------
# Description: Linux Lite Upgrade Script
# Author: Jerry Bezencon 2014
# Website: https://www.linuxliteos.com
#------------------------------------------------------------

# Ensure multi-language support
export LANG=C

# 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
zenity --question --title="Linux Lite Upgrade Utility" --window-icon="/usr/share/icons/zenity-llcc.png" --text="We will now Upgrade to Linux Lite 2.2\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 )

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

  else
       exit 0
  fi

# Install new packages, remove obsolete packages, clean up
x=$( stdbuf -oL /bin/bash \-c '(sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade \-y && sudo apt-get install inxi libreoffice-gnome dmz-cursor-theme file-roller lite-welcome lite-cleaner catfish deja-dup system-config-date light-locker thunar-archive-plugin \-y && sudo apt-get remove xarchiver \-y && sudo apt-get autoremove \-y && sudo apt-get clean )' 2>&1 |
stdbuf -oL sed -n -e '/\[*$/ s/^/# /p' -e '/\*$/ s/^/# /p'|
zenity --progress --title="Upgrading to Linux Lite 2.2..." --pulsate \
--width=600 --auto-close )

# Reboot dialogue
# Credit to xunil: http://bbs.archbang.org/viewtopic.php?id=279
title="Select Reboot to complete the Upgrade"
exit_type=`zenity  --width="380" --height="220" --title="$title" --list --radiolist --column="Select" \
    --column="Exit Type" --column="Description" \
    TRUE "Reboot" "Reboot your computer"\
    FALSE "Shutdown" "Shutdown your computer"\
    FALSE "Cancel" "Continue using your computer" `

# User must select a target type (Check if they cancelled)
if [ ! "$exit_type" ]; then
    zenity --error --title="Error" --text="You must make a selection"
    exit
fi

# Action to perform by user
if [ "$exit_type" = "Reboot" ]
then

        # Do Reboot here
        sudo shutdown -r now | zenity --progress --percentage=95 --title=Reboot --auto-close --auto-kill --no-cancel --width=300


elif [ "$exit_type" = "Shutdown" ]
then
    # Do Shutdown here
    sudo shutdown -h now | zenity --progress --percentage=95 --title=Shutdown --auto-close --auto-kill --no-cancel --width=300

else

    # Do Cancel here
    exit 0
fi

# Set lite-welcome to autostart on first boot - to do
# command here

# Add new wallapapers
# command here

# Change launchers from xdg-open to exo-open - to do
# command here

# Add new right click actions to Thunar - to do
# command here

# Update plymouth, lsb_release and issue files - to do
# command here

# Update to new login screen - to do
# command here

# Remove obsolete PPA's - to do
# command here



Re: Upgrade Script - sysdrum - 12-10-2014

I like it.


Re: Upgrade Script - anon222 - 12-12-2014

First we must ensure that the script doesn't brake anything
apt-get upgrade -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"
Code:
#!/bin/bash
#------------------------------------------------------------
# Description: Linux Lite Upgrade Script
# Author: Jerry Bezencon 2014
# Website: https://www.linuxliteos.com
#------------------------------------------------------------

# Ensure multi-language support
export LANG=C

# 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
zenity --question --title="Linux Lite Upgrade Utility" --window-icon="/usr/share/icons/zenity-llcc.png" --text="We will now Upgrade to Linux Lite 2.2\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 's/^/#/g' |
zenity --progress --title="Updating package information..." --pulsate \
--width=600 --auto-close )

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

  else
       exit 0
  fi

# Install new packages, remove obsolete packages, clean up
x=$( stdbuf -oL /bin/bash \-c '(stdbuf -oL /bin/bash \-c '(sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"  && sudo apt-get install inxi libreoffice-gnome dmz-cursor-theme file-roller lite-welcome lite-cleaner catfish deja-dup system-config-date light-locker thunar-archive-plugin \-y && sudo apt-get remove xarchiver \-y && sudo apt-get autoremove \-y && sudo apt-get clean )' 2>&1 |
stdbuf -oL sed 's/^/#/g' |
zenity --progress --title="Upgrading to Linux Lite 2.2..." --pulsate \
--width=600 --auto-close )

# Reboot dialogue
# Credit to xunil: http://bbs.archbang.org/viewtopic.php?id=279
title="Select Reboot to complete the Upgrade"
exit_type=`zenity  --width="380" --height="220" --title="$title" --list --radiolist --column="Select" \
    --column="Exit Type" --column="Description" \
    TRUE "Reboot" "Reboot your computer"\
    FALSE "Shutdown" "Shutdown your computer"\
    FALSE "Cancel" "Continue using your computer" `

# User must select a target type (Check if they cancelled)
if [ ! "$exit_type" ]; then
    zenity --error --title="Error" --text="You must make a selection"
    exit
fi

# Action to perform by user
if [ "$exit_type" = "Reboot" ]
then

        # Do Reboot here
        sudo shutdown -r now | zenity --progress --percentage=95 --title=Reboot --auto-close --auto-kill --no-cancel --width=300


elif [ "$exit_type" = "Shutdown" ]
then
    # Do Shutdown here
    sudo shutdown -h now | zenity --progress --percentage=95 --title=Shutdown --auto-close --auto-kill --no-cancel --width=300

else

    # Do Cancel here
    exit 0
fi

# Set lite-welcome to autostart on first boot - to do
# command here

# Add new wallapapers
# command here

# Change launchers from xdg-open to exo-open - to do
# command here

# Add new right click actions to Thunar - to do
# command here

# Update plymouth, lsb_release and issue files - to do
# command here

# Update to new login screen - to do
# command here

# Remove obsolete PPA's - to do
# command here
New wallpapers could be packed into package for example lite-wallpapers-2.2 or similar.


Re: Upgrade Script - altman - 12-12-2014

Thanx Misko , I don t know how you guys do these ! You must be a computer whiz kid ! ( in a good way )

Will it be Default on next ISO Install CD !


Re: Upgrade Script - anon222 - 12-12-2014

Ha,ha, thanks.
I'm a 30 year old kid.  ;D

Will it be Default on next ISO Install CD?
I don't know. That's along way to go.


Re: Upgrade Script - N4RPS - 12-22-2014

Hello!

Wish you folks the best on this.  I'm starting to forget everything I've installed when I 'upgrade', so this will be a BIG help!

73 DE N4RPS
Rob



Re: Upgrade Script - altman - 12-27-2014

(12-12-2014, 10:19 PM)misko_2083 link Wrote: Ha,ha, thanks.
I'm a 30 year old kid.  ;D

Will it be Default on next ISO Install CD?
I don't know. That's along way to go.

Lol , yep , same here , 49yo kid !

Will check on next iso release if installed by default . Will be a little while since LL2.2 Finale s only got released .


Re: Upgrade Script - Wirezfree - 01-02-2015

Hi,

I realise you folks are really busy, and have many things to do...

Wondering how is the upgrade tool progressing?
I only have 3 machines, but would like to keep them in sync.

Thanks... Dave


Re: Upgrade Script - Valtam - 01-02-2015

(01-02-2015, 11:33 AM)Wirezfree link Wrote: Hi,

I realise you folks are really busy, and have many things to do...

Wondering how is the upgrade tool progressing?
I only have 3 machines, but would like to keep them in sync.

Thanks... Dave

Work is progressing, I don't have a date Dave. It's a tricky script that has to be thoroughly tested to avoid worldwide breakages :p


Re: Upgrade Script - Wirezfree - 01-02-2015

Hi Jerry,

Thanks... Fully Understand...
I guess after years of Windows, and now making the move..
I'm eager to get/keep all machines at the same level/revision.

I will wait patiently

Dave