Sysupgrade instead of opkg upgrade

Not having the expertise to compile my own image, and knowing opkg upgrade is problematic, can I simply do a sysupgrade in luci with a newly dated stable release? Or is it worth waiting for official version change, such as 18.06.2 to 18.06.3?

Initial major version release is considered stable in general.
However, release notes may contain known issues for some device models.

1 Like

There are actually a lot of factors at play in this case. The only way you can use a firmware with updated packages is to compile it yourself. The other way is to use the Snapshots but they are nightly builds so you'll need to reflash every now and then and you cant update or install further packages into it, after one day probably.

If you're looking for low-maintenance and simple upgrades, yes, staying on the "release" images is robust. Especially with v19 expected soon, I wouldn't rush into an "upgrade" if you aren't building your own images.

5 Likes

This has been discussed in other threads lately, but was not mentioned here...

DO NOT USE OPKG UPGRADE!

Seriously, don't. Ever. Unless you know what you are doing, have a very good reason to do it, and are willing to face the consequences if you mess up your router when it doesn't go well. It will consume flash memory space, but even more importantly, there can be kernel mismatches and other broken dependencies which can cause various issues for OpenWrt -- some of them just at the nuisance level, others can be quite severe requiring re-flashing and such.

EDIT: I should have stated that this message is for the future viewers of this thread -- the OP did mention that they know that opkg upgrade is bad practice.

1 Like

Yes, package upgrade is problematic.

Though, you have the subject of the topic mentioning "opkg update", which is a different thing; it simply updates the list of the available packages.

Thank you Jeff and all that replied.

I want to know more about your advice:

There are (at least) two other places where we talk about ways to "get current packages" into OpenWrt.

  1. The opkgscript.sh script makes it easier to "get your packages back to normal" by saving a list of manually-installed packages before flashing a new release. The script then uses opkg install to put back those same packages after flashing the new firmware.
  2. The OpenWrt OS upgrade procedure (LuCI or sysupgrade) page offers a script to identify user-installed packages.

Does you advice (warning about never using opkg upgrade) have any bearing on the operation of these scripts? Many thanks.

@richb-hanover-priv -

The two scripts/processes you point out are totally fine.

Starting with #2, sysupgrade is the standard procedure for flashing a firmware image into flash memory. Typically, one would be upgrading official release builds (for example, there are major upgrades such as 17.01.4 -> 18.06.0, or minor ones like 18.06.1 -> 18.06.2, just as examples), sometimes people will downgrade, use sysupgrade to install custom images, or use the tool to keep up to date with snapshots. While there is always some risk associated with writing firmware to flash memory, sysupgrade has some basic integrity checks to make it a bit more fault-resistant (like a corrupt image), and is generally quite reliable.

The opkgscript.sh script that you mentioned is intended to make it easier to restore a previously running set of packages into a freshly sysupgrade'd installation. When you run sysupgrade (or first boot), it erases the flash memory and installs the OpenWrt firmware image that you specify. This means that all packages are erased and need to be re-installed (unless they are part of the image). The script basically makes a list of the user-installed packages pre-sysupgrade, then runs opkg update and opkg install to get those packages re-installed.

opkg upgrade is something else entirely -- it looks for updates to currently installed packages. Conceptually, this is okay on the big distros (i.e. a desktop linux install like ubuntu), but opkg doesn't have appropriate fail-safe checks to ensure proper compatibility at the kernel level and other dependencies. This can cause major issues with the installation, and therefore should never be used.

Does that all make sense?

5 Likes

Not only does it make sense, but it's a perfect answer. Thanks.

2 Likes

It does. thank you for your time on this!

Let me also add my own script here. It allows me to sysupgrade to snapshots regularly, and will track and reinstall all packages that I have installed manually. Just wait 20 minutes after the reflash.

Excellent. We are building a good knowledge base of techniques that make it easier to upgrade the entire router (firmware and package) "back to the same state" as before. Thanks.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.