Updating packages on LEDE with OPKG

Hello

So I was looking for a way to update packages on LEDE firmware and I came across this from Openwrt
https://wiki.openwrt.org/doc/techref/opkg
Basically it says that its not recommended to upgrade packages but instead install newer firmware version, this is correct? What do other users do?

1 Like

Flash a new firmware.

You can upgrade a singular non-core package, but you should avoid trying to opkg upgrade all possible packages.

1 Like

When you say flash a new firmware do you mean a new stable release or a night build?

Upgrading all packages might break stuff according to documentation. However, I have always kept all packages up-to-date and have never run into any issues myself. Any downside to upgrading packages this way if you experience no issues?

Mushoz do you upgrade them one at the time or can you upgrade all at once

First run

opkg update

And then run

opkg list-upgradable | awk -F ' - ' '{print $1}' | xargs opkg upgrade

But you might want to wait running that command until you know for sure that it is okay to update all packages. That I have been doing it successfully doesn't mean it is good practice :slight_smile:

1 Like

Flash space consumption in /overlay is naturally the first downside, but is likely not a major issue in modern routers with lots of flash.

More serious issues can arise if you try to upgrade the deepest core packages, like busybox, ubus, ubox etc., which may affect e.g. sysupgrade functionality. Normally there is nothing special, but sometimes there are intertwined version dependencies, which could leave you stuck without resetting and sysupgrade capability (but even then the failsafe mode should still work, naturally).

1 Like

Fair enough, dont want to break something that i cant fix, just wondering what happens if a big bug is found on one of the applications, does the project then just create a new version?

That's a good reason to update a package or two, assuming you have enough free space!

1 Like

Yeah but then I wonder if i could even tell if an update broke something, ill have a look at what needs updating and go from there. I remember Openwrt has a stable release and a nighly build, does LEDE have the same? Also is there a way to tell if a particular update is intertwined with other packages?

There have occasionally been some brief problems when a library received a major update and packages that depend on it weren't "bumped" in version, but generally it has been pretty good over the last couple years.

Yes, there are nightly builds off master and the packages for the "stable" branch are rebuilt on a reasonably frequent basis. https://openwrt.org/downloads

I usually check for updates every month or 2, I get the reason why some do not.

I use this script to update my router

And I use this command to do it: (you need curl installed " opkg install curl ")

curl -k -sSL https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh -o ./opkg-upgrade.sh && chmod +x ./opkg-upgrade.sh && ./opkg-upgrade.sh

The command above runs the script right away and stores the scrip, When I want to run the script after that I use:

./opkg-upgrade.sh
1 Like

just wondering what happens if I re-flash the "squashfs-factory.bin" instead of the "squashfs-sysupgrade.bin" while already on LEDE

Hopefully sysupgrade and/or LuCI would prevent you from bricking your router. I wouldn't try it!

okay, but if I were to flash the OEM firmware back to the router would I then use the “squashfs-factory.bin”. I'm just asking because I always wondered

factory.bin has header/wrapper/packaging that the OEM flash routine accepts. So, you use the factory version always when you flash from OEM firmware. Otherwise the factory version has similar functionality as the sysupgrade version.

I think that the Openwrt sysupgrade routine should reject the factory version as it has different packaging.

Ps.

Openwrt and LEDE as the same thing after the recent merge. LEDE source code continued under the Openwrt name. There is currently the stable 17.01 build and then also the daily buildbot snapshot from master.