Author Topic: [ Solved ] Sparkylinux safe and complete upgrade.  (Read 1634 times)

Offline way12go

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 476
  • Saying something clever is easy,when you r stupid.
[ Solved ] Sparkylinux safe and complete upgrade.
« 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.
« Last Edit: October 30, 2014, 01:34:44 am by way12go »
Saying something clever is easy, when you are stupid. - Sagar Gorijala.

Offline pavroo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1456
    • SparkyLinux
Re: [ Solved ] Sparky linux safe and complete upgrade.
« Reply #1 on: October 28, 2014, 06:20:50 pm »
I would add :
Code: [Select]
sudo apt-get install -fafter or instead:
Code: [Select]
dpkg --configure -aIf 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:
Code: [Select]
#!/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
« Last Edit: October 28, 2014, 07:32:29 pm by pavroo »
Nothing is easy as it looks.

Offline py-thon

  • Jr. Member
  • **
  • Posts: 68
Re: [ Solved ] Sparky linux safe and complete upgrade.
« Reply #2 on: October 29, 2014, 02:42:10 pm »
I would advise against
Code: [Select]
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.
Tower: Sparky 64bit MATE
Netbook: Sparky 32bit MATE

Offline grandadruss

  • Newbie
  • *
  • Posts: 31
Re: [ Solved ] Sparky linux safe and complete upgrade.
« Reply #3 on: October 29, 2014, 11:10:22 pm »
For me script is just
Code: [Select]
#!/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
Code: [Select]
apt-get install -f every time?

Offline pavroo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1456
    • SparkyLinux
Re: [ Solved ] Sparky linux safe and complete upgrade.
« Reply #4 on: October 30, 2014, 12:35:41 am »
Not every time, only if the upgrade failed.
Nothing is easy as it looks.

Offline grandadruss

  • Newbie
  • *
  • Posts: 31
Re: [ Solved ] Sparkylinux safe and complete upgrade.
« Reply #5 on: October 30, 2014, 10:58:20 pm »
Thankyou.
Problems are very rare.  :)

Offline pavroo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1456
    • SparkyLinux
Re: [ Solved ] Sparkylinux safe and complete upgrade.
« Reply #6 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.
Nothing is easy as it looks.

Offline way12go

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 476
  • Saying something clever is easy,when you r stupid.
Re: [ Solved ] Sparkylinux safe and complete upgrade.
« Reply #7 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.
Saying something clever is easy, when you are stupid. - Sagar Gorijala.

Offline way12go

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 476
  • Saying something clever is easy,when you r stupid.
Re: [ Solved ] Sparkylinux safe and complete upgrade.
« Reply #8 on: November 03, 2014, 05:25:02 am »
Code: [Select]
#!/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?
« Last Edit: November 03, 2014, 05:27:46 am by way12go »
Saying something clever is easy, when you are stupid. - Sagar Gorijala.

Offline KrunchTime

  • Newbie
  • *
  • Posts: 18
Re: [ Solved ] Sparky linux safe and complete upgrade.
« Reply #9 on: December 03, 2014, 11:05:27 pm »
For me script is just
Code: [Select]
#!/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