Upgrading by editing repository paths

Still a question I’m not fully clear about: When a new version of openSUSE is released, I download the iso, burn a DVD, boot it, and let the installer update my machine. But is that any different from simply editing the repositories and letting the package manager detect and install all updates?

Considering the upcoming 13.1 version: What happens if I open YaST - Software Management - Repositories, change “12.3” to “13.1” in each URL, then let Apper detect and install all updates it finds? Does it yield in the exact same result as upgrading with the DVD, without skipping or failing any steps? Also, is it more risky then using the DVD? Does anyone else take this approach to upgrading, and overall do you recommend it?

You’re not a developer, are you?

It’s simple.

Look, updates are designed to modify just a specific version of a program file.

An update of 12.3 will change a certain program of 12.3,
but this very update relies on that the program it should update is present in a certain version.

openSUSE 13.1 won’t have the same programs as 12.3.

And updates for 13.1 will only work on files of 13.1.

To use a simple image:
a certain screwdriver (I mean an update for 12.3) will only work for screws of a specific size (means programs of 12.3).

A new screwdriver of different size (here an update for 13.1) will not fit to the old screws (12.3 programs).

Using the wrong screwdriver in any case won’t work, and in many cases will only damage the screws (and make them unusable).

Hope this image is useful.

To change version levels you use zypper dup not zypper up. Big difference.

See here for instructions:
SDB:System upgrade - openSUSE

In short: Change all repo URLs from 12.3 to 13.1 f.e., and run “zypper dup”.
Don’t use Apper for that, it’s not designed to do that and will fail.

And it shouldn’t be more risky, I do that all the time.
One problem though: programs could temporarily stop working during the upgrade, because there could be incompatible libraries installed at any point.

On 2013-10-03 00:56, MirceaKitsune wrote:
>
> Still a question I’m not fully clear about: When a new version of
> openSUSE is released, I download the iso, burn a DVD, boot it, and let
> the installer update my machine. But is that any different from simply
> editing the repositories and letting the package manager detect and
> install all updates?

Yes, very different.

For example, with the DVD upgrade method fstab will be pruned of entries
that are not needed with systemd. However, a zypper dup upgrade will not
do it.

On the other hand, the DVD upgrade only changes what is on the DVD;
zypper dup upgrades all.

> Considering the upcoming 13.1 version: What happens if I open YaST -
> Software Management - Repositories, change “12.3” to “13.1” in each URL,
> then let Apper

Broken upgrade.

Yo do not let apper or yast do it. You switch to text mode, “init 3”,
and run “zypper dup”.

Known and aproved methods:

Online upgrade
method

Offline upgrade
method

Chapter 16. Upgrading the System and System Changes
openSUSE 12.3 Release Notes


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Well, you don’t really have to run “init 3” first.
It works just as fine in graphical mode.

But as I already mentioned, it could happen that a program doesn’t start during the update because your system is in an inconsistent state (that’s especially true for KDE programs f.e., because KDE consists of many packages). Already running programs should continue to work fine though.

You have all your graphical stack (X11, DE) replaced during update. It is very likely to break you current session to the extent that you won’t be able to log out or restart.

When you do a major update you want your system to be as close to offline as possible.

For updating from terminal with no desktop running or required, I have a bash script called Zypper Command, which runs Zypper and that can be helpful in system updates. Also works with a Desktop when not trying to do a major openSUSE version change.

Zypper Command - Zypper Package Management Menu System - Version 2.00 - Blogs - openSUSE Forums

Thank You,

On 2013-10-03 17:16, wolfi323 wrote:
>
> robin_listas;2589153 Wrote:
>> Yo do not let apper or yast do it. You switch to text mode, “init 3”,
>> and run “zypper dup”.
> Well, you don’t really have to run “init 3” first.
> It works just as fine in graphical mode.

Ha! You like living dangerously? >:-)

You can do a download run only while you do other things. For doing the
actual upgrade, I would seriously recommend runlevel 2.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

On 10/3/2013 1:53 PM, Carlos E. R. wrote:
> On 2013-10-03 17:16, wolfi323 wrote:
>>
>> robin_listas;2589153 Wrote:
>>> Yo do not let apper or yast do it. You switch to text mode, “init 3”,
>>> and run “zypper dup”.
>> Well, you don’t really have to run “init 3” first.
>> It works just as fine in graphical mode.
>
> Ha! You like living dangerously? >:-)
>
> You can do a download run only while you do other things. For doing the
> actual upgrade, I would seriously recommend runlevel 2.
>
Under systemd, runlevel2 and runlevel3 are both associated with the same target;


init 2 -> runlevel2.target -> multi-user.target
init 3 -> runlevel3.target -> multi-user.target

Thus both init 2 and init 3 wind up at the same place. See the links in /usr/lib/systemd/system.


venzke@euler2:~> ls -l /usr/lib/systemd/system/run*.target


P.V.
“We’re all in this together, I’m pulling for you” Red Green

Well, I have upgraded more than a few times in runlevel 5 (KDE3 or KDE4) already and never had a problem.

The old libs stay in memory as long as they are in use by programs, so the current session does not break (especially the terminal window in which you run “zypper dup”). Otherwise the upgrade would not even work in text mode, would it?

As I wrote, you can’t expect a fully working session during/after the upgrade (you may have problems starting certain programs), so you should reboot as soon as possible of course.
And even if you are not able to logout (never had this in KDE), you would still be able to run “reboot” f.e. in the terminal window or kill the X session with Ctrl+Alt+Backspace twice.

But the upgrade itself works just fine.

Anyway, if you think it’s safer in text mode, I’m fine with that. :wink:

And @MirceaKitsune:
If you’re asking because of the download size of the DVD, there’s also the NET-install ISO, which doesn’t contain any packages but downloads them as needed from the online repos (so is similar to “zypper dup” in that sense, but uses the standard installer like the DVD so makes e.g. those changes to the fstab as mentioned by Carlos)

Thanks for all the info, I’ll keep this advice in mind when it comes to upgrading. Good thing I didn’t just edit the URL’s and let Apper update… I assumed an OS version update simply means installing all the new packages. I’ll only need this knowledge temporarily anyway, since once I’m sure enough I’ll be switching to Tumbleweed (will have to apply this there).

On 2013-10-04 06:00, PV wrote:
> On 10/3/2013 1:53 PM, Carlos E. R. wrote:

>> actual upgrade, I would seriously recommend runlevel 2.
>>
> Under systemd, runlevel2 and runlevel3 are both associated with the same
> target;

That’s a mistake (of systemd)


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

On 10/5/2013 4:44 AM, Carlos E. R. wrote:
> On 2013-10-04 06:00, PV wrote:
>> On 10/3/2013 1:53 PM, Carlos E. R. wrote:
>
>>> actual upgrade, I would seriously recommend runlevel 2.
>>>
>> Under systemd, runlevel2 and runlevel3 are both associated with the same
>> target;
>
> That’s a mistake (of systemd)
>

It certainly is an oversight with the current versions of systemd in openSUSE 12.2 & 12.3 et al. But for now there is
not a run-level 2. Look at this snippet from 12.3:


venzke@euler2:~> who -r
run-level 5  2013-10-03 23:12                   last=3
venzke@euler2:~> su -
Password:
euler2:~ # init 2
euler2:~ # who -r
run-level 3  Oct  5 19:37                   last=5
euler2:~ # init 5
euler2:~ # who -r
run-level 5  Oct  5 19:38                   last=3
euler2:~ # exit
logout


P.V.
“We’re all in this together, I’m pulling for you” Red Green

On 2013-10-06 02:47, PV wrote:
> On 10/5/2013 4:44 AM, Carlos E. R. wrote:

>> That’s a mistake (of systemd)
>>
>
> It certainly is an oversight with the current versions of systemd in
> openSUSE 12.2 & 12.3 et al. But for now there is not a run-level 2.
> Look at this snippet from 12.3:
>

Interesting.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

Well, wouldn’t runlevel 1 (“Single user mode”) not be more suited and even safer than runlevel 2 (“Local multiuser without remote network”) for installing updates? :wink:

Runlevel 1 does still exist with systemd, it is linked to rescue.target.

You’d have to pull in all the packages. Runlevel 1 / single user means no networking. Or you’d have to set that up whilst in single user mode.

I’ve used the method of changing numbers once, but this was on a machine with only the KDE:Release repo active - the rest stock install -, from 12.2 to 12.3, Haven’t had any complaints. But … it’s not advized, not supported. Though zypper is technically capable to do it.

On 2013-10-06 23:36, Knurpht wrote:
>
> wolfi323;2589606 Wrote:
>> Well, wouldn’t runlevel 1 (“Single user mode”) not be more suited and
>> even safer than runlevel 2 (“Local multiuser without remote network”)
>> for installing updates? :wink:
>>
>> Runlevel 1 does still exist with systemd, it is linked to rescue.target.
>
> You’d have to pull in all the packages. Runlevel 1 / single user means
> no networking. Or you’d have to set that up whilst in single user mode.

Runlevel 1 means more than no network. There is only one terminal, so
you can not, for instance, have the manual in one page, the cli on
another, and the log output in another. That was the advantage of level
2, multiple terminals.

Level 1 not only stops network, it stops most non esentials services.
Obviously, postfix, amavis, NFS, apache, ftp, xinet… all are stopped.
Also some others not so obvious, where the relation to networking is not
apparent. You can not start graphical mode manually, for instance.

Certainly level 1 seems safer. But if you get stuck and need another
terminal to see what is hapening, you can not.

In any case, you can not run a zypper dup on level 1, nor 2: there is no
network, and dup pulls the upgrades from a networked server…

I forgot that. O:-)


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

Yes, of course. Carlos recommended to download the packages first and then do the actual upgrade in runlevel 2.
This was what I was referring to.

I’ve used the method of changing numbers once, but this was on a machine with only the KDE:Release repo active - the rest stock install -, from 12.2 to 12.3, Haven’t had any complaints. But … it’s not advized, not supported. Though zypper is technically capable to do it.

As I already wrote, I always did the upgrade in runlevel 5 without problems. Well, at least no problems that I wouldn’t have had in runlevel 3 (or 2 or 1) as well… :wink:
With non-standard repos you have to take a bit more care of course (or better disable them for the upgrade), but that is independent of the runlevel in which you do the upgrade.

Oh, and btw, the “Known and approved method” (Carlos’ words) Online upgrade method does not mention anywhere that you should switch to runlevel 3 for the upgrade.
It does say this however:

It is strongly recommended that you run this inside GNU screen or tmux to protect the upgrade process in case anything should go wrong with the X session during the upgrade.

Although I always did that in a standard Konsole.
Well, I even used YaST->Software Management once or twice to do the upgrade (“All in this list”->“Update”, then solve the dependency conflicts…) but I wouldn’t advise or even suggest this.