Hello, after attended update the opkg package is missing. How to get opkg without reflashing router?
Linux version 6.6.58 (builder@buildhost) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 13.3.0 r27935-bcd95cb9c4) 13.3.0, GNU ld (GNU Binutils) 2.42) #0 SMP Mon Oct 28 13:01:52 2024
manually unpack ipk (gz:ed + tar, if I remember correctly)
What is the output of:
ubus call system board
Kernel 6.6.58 means you're running SNAPSHOT. Do you have owut installed?
In that case, SSH into the router and run owut upgrade --add opkg
.
What happened is that luci-app-opkg
was renamed to luci-app-package-manager
and opkg is not a dependency anymore, but a top level package and needs to be explicitly added in the list.
If you don't have owut, get a list of your packages and create a build on the Firmware Selector and install while keeping your configuration. You won't ose any data.
More info here: Owut: OpenWrt Upgrade Tool - #153 by efahl
Cheers!
At first I want to thank you and all users at this thread who try to help me. no owut is not installed. I think history of trouble was follow - I flashed OpenWrt. Run It with luci and opkg was present in system. Unfortunatelly I think there is something unmounted/or go wrong after 4 or 5th snapshot upgrade. So I looking possibility not to go through full factory reset and reflash and just curl or wget opkg from somewhere and extract it to /usr/bin
where to get correct aarch opkg ipk?
When you typed in ubus call system board
it seems to have interpreted it as rubus
-- can you try again...
Also, please don't post screenshots. Instead:
Please use the "Preformatted text </>
" button for logs, scripts, configs and general console output.
Please edit your post accordingly. Thank you!
You typed run owut
, the command is owut, without the run word.
root@Andersen11:~# ubus call system board
{
"kernel": "6.6.58",
"hostname": "Andersen11",
"system": "ARMv8 Processor rev 4",
"model": "MERCUSYS MR90X v1",
"board_name": "mercusys,mr90x-v1",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "SNAPSHOT",
"description": "OpenWrt SNAPSHOT",
"revision": "r27935-bcd95cb9c4",
"target": "mediatek/filogic",
"builddate": "1730120512"
}
}`
There is no owut available. But - when I go to attended sysupgrade and switch to advanced mode and add owut to snapshot and flashed - owut was appeared. Then I run owut upgrade -add opkg, And opkg package was appeared. But in web there is error durning opkg update. Unable to execute *opkg update* command: PermissionError: Exec permission denied
In that case, I would recommend running Luci Attended Sysupgrade, get your package list (select them, copy to a text editor and remove the new lines) and paste it in the Firmware Selector for your model here: https://firmware-selector.openwrt.org/?version=SNAPSHOT&target=mediatek%2Ffilogic&id=mercusys_mr90x-v1
Then, click on Customize installed packages and/or first boot script
and paste your package list there and add opkg and owut if it's not there. Then flash your generated image keeping your current config.
It should work.

Luci Attended Sysupgrade, get your package list (select them, copy to a text editor and remove the new lines
Here's a one-liner to do that in CLI:
$ eval $(ubus call rpc-sys packagelist | jsonfilter -e 'packages=$.*') && echo $packages
openssh-sftp-server libc mkf2fs ... kmod-pppoe dnsmasq-full

Here's a one-liner to do that in CLI:
Wow, mind blown, I always did that manually because I used echo $(opkg list-installed | sed -e "s/\s.*$//")
and returned like a gazillion packages and Luci ASU returned a lot few and didn't know there was something better.
Thanks!

ere's a one-liner to do that in CLI:
$ eval $(ubus call rpc-sys packagelist | jsonfilter -e 'packages=$.*') && echo $packages openssh-sftp-server libc mkf2fs ... kmod-pppoe dnsmasq-full
Does this require snapshot?
root@2305:~# ubus call rpc-sys packagelist
Command failed: Not found
the older forum hack, to only fetch the user installed packages, also still works:
install_time=$(opkg status kernel|awk '$1=="Installed-Time:" {print $2}');opkg status|awk '$1=="Package:" {package=$2} $1=="Status:" {user_inst=/ user/ && / installed/} $1=="Installed-Time:" && $2!='$install_time' && user_inst {print package}'`

Does this require snapshot?
No, that's in the last 4(?) releases, since that rpc-sys call was added.
This call is what all of the ASU clients use internally to collect the top-level package list, and is doing basically what you outline in your awk code. https://github.com/openwrt/rpcd/blob/master/sys.c#L184
There's a parameter that gives back the same as opkg list-installed
, but with the ABI tags stripped from the names (False
is the default):
$ ubus call rpc-sys packagelist '{"all":True}' | wc -l
286
$ ubus call rpc-sys packagelist '{"all":False}' | wc -l
86
$ ubus call rpc-sys packagelist | wc -l
86
Oh, and I need to add that the rpc-sys packagelist
call is being updated to handle apk
, too. So when we switch over, you won't have to rewrite any scripts that use it.