How to update all software at once

Greetings,
this is not a request for help.
Rather a help for those that find it useful.
UPDATE ALL SOFTWARE AT ONCE!
While is possible to do a manual update of each software that was installed under LUCI, there is a nice way and much faster to update all installed software using CLI.
First, for the sake of easiness, when you are in L:UICI, update your software list.
Than SSH to your router and paste the following line in it:

opkg list-upgradable | cut -f 1 -d ' ' | while IFS='$\n' read -r line; do opkg install $line ; done

This will update everything and you dont have to do that manually one by one in LUCI.
I hope that helps.

For the many reasons previously discussed at length on the forum (and now warned about in the wiki) this is a really bad idea.

Do not upgrade your packages this way.

3 Likes

Apologies to have suggested such a method.
I used it myself for a long time to save myself a lot of time and always worked well.
I read the wiki you pointed. Thanks. (I guess I was luck all this time)
It is difficult for me to decide what to upgrade and what not to upgrade even manually.
From the wiki, I understand that sysupgrade should be the preferred method.
Therefore, would it be wise to simply re-apply the same image (the installed one) or an higher version if available?
Using the Attended Sysupgrade inside Luci, would that eventually upgrade all installed packages as well?
What would be the best method for non expert users?
Thanks

The problem with the method you suggested is that it does works well, right up until it doesn't. And when you hit that point it can be extremely difficult to not only diagnose, but to fix without just starting from scratch.

Unless a package you're using has been updated with some new functionality that you need, or there's a security issue (which happens rarely and is usually mentioned on the forums), you don't really need to update any of the packages on a regular basis. Just upgrade the whole firmware (using sysupgrade) when new OpenWRT releases come out, i.e. 22.03.1,.2,.3 etc.

2 Likes

say hi to your new possible soft brick

3 Likes

Ok,
so I can safely not update anything in the update tab till there is a new image version.
Generally I always update my linux distro when updates are available as it not only better the software that is installed but also updates security possible holes.
However, in OpenWRT we need to keep constantly an eye in the forum to find out if is necessary to update or wait for a new version to sysupgrade.
Thats correct?

sure but it got plenty of space and RAM, something openwrt devices usually don't have.
for that reason, there's no dependencies DB in openwrt, you upgrade one package too many,
or forget one, and you got a soft brick on your hands.

not constantly, but it doesn't hurt.
openwrt release new versions frequently, with the recently discovered bugs/holes fixes, if there are any.

Sounds good.
I tested the Attended Sysupgrade recently and it seems to be able to retain and update also the packages installed after the upgrade (normally are no longer there in a normal sysupgrade).

A side question.. just in case is also a bad idea...
This way to upgrade that I used to do before the LUCI Attended Sysupgrade, can I post it as a suggestion without jeopardize users router?

Also never had issues with it but again, as you pointed out, all is fine as long as it goes fine

I've seen it referenced to previously, so I guess it should be OK, never tried it myself though.

But why not simply collect all installed packages, paste them into the package list in
https://firmware-selector.openwrt.org/, and get an image loaded with the packages you
want/need, as the end result?

2 Likes

mostly because I found a neat and fast procedure...
also because I search a lot for a simple solution and that came along faster
I will post that option on a separate post.
Thanks for your feedback.
I always appreciate a constructive feedback.
I will keep all your suggestions in mind from now on.,

there's one drawback with the opkgscript.sh, if you need a specific package for you internet access to work, say a NIC driver, it'll fail, creating a catch 22 kind of situation.

you can't reach internet, because you're missing package A, and you can't DL package A, because you can't reach internet.

1 Like

I usually ride the in-between track... stay on the latest stable release but selectively update packages such as cURL, DNSMasq, openssl, and wolfssl which regularly releases fixes and security patches. Other than that I wouldn't really touch base files.

I've soft bricked a router trying it with busybox.

2 Likes

I think I answer a bit fast earlier on.
I noticed that when using the Attended Sysupgrade within the LUCI interface, it will look for the latest stable release, and even allows you to add or remove packages that are o aren't needed.
And keeps all the software you had installed before the sysupgrade.
Here is a great tutorial. Skip till 15:28.
How to upgrade OpenWrt?

It is also possible to use CLI to do the same.

2 Likes

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