Upgrade all packages for CLI

Good evening everyone, until recently with a command via CLI I could update all the packages installed on the router if there was an update. The command page I think was https://openwrt.org/docs/guide-user/additional-software/opkg Now on that page the command is gone and I don't remember it. Who is writing to me? is there an app that allows you to do it from Luci?


It bears mention that upgrading packages can cause multiple issues if you aren't careful. You might end up having to do a reset or reflash depending on what you hit. Don't upgrade a package unless you have a specific reason to do so such as a critical bugfix/security issue. And don't just shotgun update everything, unless you're feeling lucky.


See also https://openwrt.org/meta/infobox/upgrade_packages_warning

and numerous topics here on the forum.


If you don’t mind a very rare issue occasionally, and you want bleeding edge just use the master/snapshot images. Master branch is pretty stable these days- good enough to use for intermediate folks and up in my opinion.

1 Like

opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
cut just cuts 1 field with delimiter ' ' - space.

Please, leave the command in Wiki with notice.


The command is still on that wiki page, but not quite that prominently as earlier...

Exact. Before it worked but now this command seems to give me problems.

I obtain

opkg: the ``upgrade'' command requires at least one argument
usage: opkg [options...] sub-command [arguments...]
where sub-command is one o

Which is the list of arguments?

Just don't use it.... seriously, don't. Unless you know exactly what you are doing, or are willing to deal with the consequences of messing up your router (and having to start over completely). The 'problems' you are experiencing attempting to use opkg upgrade are very likely saving you from major problems on your router!

The fact that you are not familiar with the arguments for the upgrade command further reinforces that you should not be using it. However, if you are looking to upgrade your OpenWrt version (say from 19.07.1 > 19.07.2), that is easy using the sysupgrade command.

1 Like

Update the package list first, otherwise list upgradable will return nothing and upgrade will return that error.

opkg update; opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade

Please do not do this package upgrade.

Upgrading packages (via the CLI opkg upgrade command or the LuCI Upgrade... button) can result in major problems. It is generally highly discouraged, unless you know what you are doing or if there is specific instruction to do so.


thanks, didn't know that, so far I haven't had any issues with my routers but I'll sysupgrade instead from now on.

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