I'm just wondering what is the equivalent of
apt-get upgrade apt upgrade yum update
with OpenWRT or LEDE?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
There no single command or argument, but you can easily do it. To upgrade all of the packages, LEDE recommends,
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
There are other less efficient ways where people use AWK and such.
Since LEDE firmware stores the base system in a compressed read-only partition, any update to base system packages will be written in the read-write partition and therefore use more space than it would if it was just overwriting the older version in the compressed base system partition. It's recommended to check the available space in internal flash memory and the space requirements for updates of base system packages.
I have created a little script called
opkg-upgrade to deal with upgrading in a better way.
It is available on github:
It will make upgrading as easy as:
As mentioned on the readme.md file, there may be problems with upgrading though.
I should also mention that upgrading from CRON is a very bad idea!
I would say that not even on a regular Linux distro blind upgrades are a good idea.
There are many things that can go wrong on upgrades and since OpenWrt usually runs on devices that can be bricked, it makes even less sense to do it unattended.
In short, the only cases where I would EVER upgrade are:
Still, I would never upgrade from cron.
I would also think 20 times before upgrading internal Flash (even big ones), since that would degrade it faster.
My script has the option to send an e-mail report with the available updates.
So I would recommend to add the reporting tool to cron, and then people can upgrade manually after receiving the e-mail. This makes things safer while also giving the option to revise the upgrades.
As of OpenWrt 19.07, performing
opkg upgrade [pkgname] may throw this error.
Collected errors: * pkg_hash_add_from_file: Failed to open /var/opkg-lists/openwrt_routing: Out of memory.
A workaround is to use
opkg install instead, which is the same as how
luci-app-opkg upgrades packages.
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg install