How to change opkg update script to apk for openWRT V 25

Hello,

I use this scipt in openWRT V 24 for packet updates:

#! /bin/ash

opkg update

RC=$(opkg list-upgradable)

if \[ „$RC“ == „“ \];then


exit


fi

opkg list-upgradable | cut -f 1 -d ’ ’ | xargs opkg upgrade

and i copy it in the Sbin Folder and it works in V 24, but now it need to modify to apk

Like this ? and in which Folder it must be copy with scp ?

#! /bin/ash

apk update

RC=$(apk -u list)

if \[ „$RC“ == „“ \];then

exit

fi

apk -u list | cut -f 1 -d ’ ’ | xargs apk upgrade

and need the script a chmod in openWRT V 25 ?

in openWRT V 24 no Router brick with the opkg Script

Yeah, like @lleachii indicates, don't do that. Read my remarks on the thread he links above.

But in case you are a gambler, there's no need for a specialized script, just apk commands.

apk update   # update package indexes
apk version  # list all the packages that are out-of-date
apk upgrade  # upgrade the packages that are out-of-date
1 Like

If you have more than 5 Rotuers it would be nice to update in a simple Way with a script or not ?

There's also a pre-canned response to post in threads such as this:

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.

Just install owut and do owut upgrade on each of them?

1 Like

OK i try and Thank you

:+1:t3: I just edited the template to include apk upgrade...

2 Likes

owut is already installed.

1 Like

I yes router soft brick in v24 upgrading netifd.

owut check -v
# read the text
: owut upgrade -v

Yes, last command in my script fragment is also commented so that you check through output....

I suppose that warning can be removed, or, 'softened' now that most packages in 25.12 are stable. snapshots were a turkey-shoot. "Whoops, there goes libx dep"

1 Like