Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum https://forum.linuxiarze.pl

[ Solved ] Sparkylinux safe and complete upgrade.

Started by way12go, October 28, 2014, 05:14:46 PM

Previous topic - Next topic

way12go

[ 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.
Success gives birth to success? Failure gives birth to failure? - Sagar Gorijala.

pavroo

#1
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
Nothing is easy as it looks. Danielle Steel

py-thon

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.
Tower and Notebook: Sparky (testing) 64bit MATE

grandadruss

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?

pavroo

Nothing is easy as it looks. Danielle Steel

grandadruss


pavroo

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. Danielle Steel

way12go

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.
Success gives birth to success? Failure gives birth to failure? - Sagar Gorijala.

way12go

#8
#!/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?
Success gives birth to success? Failure gives birth to failure? - Sagar Gorijala.

KrunchTime

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

View the most recent posts on the forum