SparkyLinux Forums

Installation & Upgrade => System upgrading => Topic started by: way12go on October 28, 2014, 05:14:46 PM

Title: [ Solved ] Sparkylinux safe and complete upgrade.
Post by: way12go on October 28, 2014, 05:14:46 PM
[ Solved ] Sparkylinux safe and complete upgrade.

Copy this file to a text file and just save it as a text file without any need for .txt extension.

Let us say you name it as "UP".

Quote#!/bin/bash
sudo apt-get update          &&
sudo apt-get check           &&
sudo apt-get upgrade -f      &&
sudo apt-get dist-upgrade -f &&
sudo dpkg --configure -a     &&
sudo apt-get autoclean       &&
sudo apt-get autoremove -f   &&
sudo aptitude purge '~c'


I copied it to /Home/User-Dir/UP

Then do

chmod 755 UP

UP will become an executable file.

Now you open a terminal and enter UP and password and the system will be safely and completely upgraded.
Title: Re: [ Solved ] Sparky linux safe and complete upgrade.
Post by: pavroo on October 28, 2014, 06:20:50 PM
I would add :
sudo apt-get install -f
after or instead:
dpkg --configure -a
If the upgrade failed and the upgrading needs some extra libs, the 'dpkg --configure -a' can't solve it, but 'apt-get install -f' does.
The second suggestion - I don't use 'apt-get' and 'aptitude' together.
My option is: 'apt-get' only or 'aptitude' only to be used.
You don't need to use 'check' and 'upgrade -f'.
The script (in my way) could be like that:
#!/bin/bash

testroot="`whoami`"

if [ "$testroot" != "root" ]; then
    echo "Must be root"
    exit 1
fi

apt-get update && apt-get dist-upgrade -y && apt-get install -f && apt-get autoremove -y && apt-get autoclean -y
Title: Re: [ Solved ] Sparky linux safe and complete upgrade.
Post by: py-thon on October 29, 2014, 02:42:10 PM
I would advise against
sudo apt-get autoclean       &&
sudo apt-get autoremove -f


autoclean means that packages no longer in repos are deleted from cache. Sometimes it is helpful to still have those packages available for downgrade. 99 % of users have sufficient HDD-space not to worry about some additional packages in /var/cache/apt/archives. apt-get autoclean is something better used afterwards when the system is known to have upgraded well.

autoremove is not intelligent enough. On all my installations so far it wanted to purge packages that I use.
Title: Re: [ Solved ] Sparky linux safe and complete upgrade.
Post by: grandadruss on October 29, 2014, 11:10:22 PM
For me script is just

#!/bin/bash

apt-get update
apt-get dist-upgrade


Before I do anything else I read results of this in terminal and think carefully if anything else seems to need doing.
Not sure if I should run
apt-get install -f
every time?
Title: Re: [ Solved ] Sparky linux safe and complete upgrade.
Post by: pavroo on October 30, 2014, 12:35:41 AM
Not every time, only if the upgrade failed.
Title: Re: [ Solved ] Sparkylinux safe and complete upgrade.
Post by: grandadruss on October 30, 2014, 10:58:20 PM
Thankyou.
Problems are very rare.  :)
Title: Re: [ Solved ] Sparkylinux safe and complete upgrade.
Post by: pavroo on October 31, 2014, 01:32:24 PM
Yes, it is.
It happens not to often.

I am working on a new upgrading  tool, dedicated for sparky.
It'll be ready soon.
Title: Re: [ Solved ] Sparkylinux safe and complete upgrade.
Post by: way12go on October 31, 2014, 03:31:11 PM
As far as I remember I had one problem or the other with all the linux distros I've used up until now.

The problems were caused due to messing with package managers, editing source.list files or due to editing similar files and due to upgrade issues sometimes due to autoclean etc;

The most intelligent linux distros of all of them are

OpenSuse

and

Sparkylinux

and what so awesome is

Sparkylinux stability is better.

I never ran against any problems using Sparkylinux if I ran everything in Sparky-Aptus.

Now with pavroo's script I don't have to worry about anything.

Just run the "UP" file in "RUN" box after ticking both run from terminal and root and I'm good to go.

So far Sparkylinux JWM 32-bit is simply awesome.
Title: Re: [ Solved ] Sparkylinux safe and complete upgrade.
Post by: way12go on November 03, 2014, 05:25:02 AM
#!/bin/bash

testroot="`whoami`"

if [ "$testroot" != "root" ]; then
    echo "Must be root"
    exit 1
fi

apt-get update && apt-get dist-upgrade -y && apt-get install -f && apt-get autoremove -y && apt-get autoclean -y


Pavroo your code is very good. And the upgrade tool is also good. But when I run the UP script in Sparkylinux JWM "Run Command" I tick run in terminal and run as root and I get to see the upgrade process is small x-terminal and it automatically closes but I get to see the process that's going on.

On the other hand if I use upgrade app it doesn't show the progress.

Previously I used to do this...

Step1: sudo apt-get update && time sudo apt-get dist-upgrade
Step2: Use sparky-aptus and do all except what is in first tab.
So if there are any problems with upgrade, sparky-aptus would fix it.

And then I started using your script, the UP file and it was perfect.

Now the Sparky-upgrade, what does it do? No progress window. Is it just upgrade or dist-upgrade?
Is using Sparky-upgrade same as using UP script?

I have one small question.

If I install Sparkylinux any version once and if I do dist-upgrade once, will every upgrade command thereafter be same as simple upgrade command?
Title: Re: [ Solved ] Sparky linux safe and complete upgrade.
Post by: KrunchTime on December 03, 2014, 11:05:27 PM
Quote from: grandadruss on October 29, 2014, 11:10:22 PM
For me script is just

#!/bin/bash

apt-get update
apt-get dist-upgrade


Before I do anything else I read results of this in terminal and think carefully if anything else seems to need doing.
+1