The future is now: opkg vs apk

Agreed, hopefully fixed, how does it look to you now? https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet#list_commands

1 Like

There was the following command

opkg list-installed | cut -f 1 -d " "

that output a list of packages in the form

watchcat
wireguard-tools
wireless-regdb
wpad-wolfssl
xtables-legacy
zlib

What analogue is there now that would output in the same form, without any creation dates and the rest?
I tried those suggested in WIKI, but I didn't find anything similar.

Similar to your example, this will list all installed packages:
apk list -I --manifest | cut -d' ' -f1

4 Likes

Did you see https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet#list_commands, specifically "Interesting Examples"?

Aha! But there I saw only 2 commands that do not display the list of packages as I want (((.
The above command completely solves my needs
apk list -I --manifest | cut -d' ' -f1
, for which the author was given a LIKE.
I will also write in words - A HUGE THANK YOU!!!
Now I would like to figure out why I get the following errors when updating packages from LUCI ...

fetch https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/packages/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/base/packages.adb
fetch https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/kmods/6.6.63-1-fdfd75048f27be9063795144b7871244/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/luci/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/routing/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/telephony/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/video/packages.adb

Perhaps it is not clearly there somewhere, but since English is not my native language and is not even at all similar to my native language, I may not grasp all the subtleties of its use.
Please understand and forgive me)).

Because upstream apk has a feature where they in that operation print normal status messages to stderr...

1 Like

OK! But I use the standard LUCI function and call it with the standard button in LUCI. This did not happen with the old packages.

It happens with APK now, due to the bug I linked above. LuCI just shows you, how apk produces output. In that merge request our Ansuel is trying and get upstream APK to fix things...

2 Likes

Can we ignore this?
Will this be the default job of the package update manager?
I don't know how it "sounds" in English, but in my language it's a problem((.

If I recall, there is no error message if you do an update using:
apk update

At the moment, it only seems to occur when using Luci to update.

There is no error. It is simply output going to stderr.

It is trivial to see, just redirect all stdout to the bit bucket.

$ apk update > /dev/null
fetch https://downloads.openwrt.org/snapshots/targets/x86/64/packages/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/base/packages.adb
fetch https://downloads.openwrt.org/snapshots/targets/x86/64/kmods/6.6.63-1-ed1b0ea64b60bcea5dd4112f33d0dcbe/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/luci/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/packages/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/routing/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/telephony/packages.adb
fetch https://downloads.openwrt.org/snapshots/packages/x86_64/video/packages.adb

If you don't like to see those fetch messages on stderr, simply send stderr to the bitbucket.

$ apk update 2> /dev/null
 [https://downloads.openwrt.org/snapshots/targets/x86/64/packages/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/x86_64/base/packages.adb]
 [https://downloads.openwrt.org/snapshots/targets/x86/64/kmods/6.6.63-1-ed1b0ea64b60bcea5dd4112f33d0dcbe/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/x86_64/luci/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/x86_64/packages/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/x86_64/routing/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/x86_64/telephony/packages.adb]
 [https://downloads.openwrt.org/snapshots/packages/x86_64/video/packages.adb]
OK: 10874 distinct packages available
1 Like

Maybe so. But it says "Errors".
So something needs to be done about it.
If it's not an error, then it shouldn't be written like that.
You can live with it, but it's not comfortable)).

изображение

I should have been clearer, where I mentioned 'no error', I meant to say 'no error message'!

Yes, and like I have already twice said above, the problem is in the upstream APK that prints normal status info as error, and OpenWrt are trying to get things fixed upstream.

(LuCI just prints out the strings coming from apk's error output stream)

2 Likes

Please have a löök at https://github.com/efahl/owut/issues/21#issuecomment-2542907478

That's something else, see https://github.com/openwrt/openwrt/commit/c268ae674d01dbd2215b6e3aefdbc763f17b8d0f

Hi,

The forum notice message about this "major change" which is the best communication to openwrt operators

Does not say anything about what the operators needs to know about this change

Like, beyond the command going from opkg -y install blabla to apt install -y blabla, is there anything the operator needs to know ?

Is it being assumed that the user knows what opkg was, what apt is and what the difference between the two are in a practical sense ?

Did you follow the links in the thread you mentioned? The "cheat sheet" would appear to fulfil precisely what you've asked for.

What I mean is that the pinned anouncement should contain the cheat sheet, I didn't see it.

But also, the announcement should contain the information that really matter, because less than 50% of people who see the announcement will see anything else.

This is the place to put the really important things to know, if there are any ?

I asked chatgpt what are the 5 MOST important things general openwrt operator MUST know and it said the following.

[spoiler]
Command Transition: Replace opkg install pkg with apk add pkg, and opkg remove pkg with apk del pkg. Most basic commands have direct replacements, so learn these first.

Signature Validation: Unlike opkg, apk enforces valid signatures for all packages. Use --allow-untrusted when installing unsigned or self-built packages to avoid errors.

Single-Step Install & Update: Use apk --update-cache add pkg to update indexes and install packages in one step, replacing opkg update && opkg install pkg.

Listing Tools: Use apk list --installed to see installed packages, apk list --upgradeable for updates, and apk list --orphaned to identify leftover dependencies after uninstalls.

Advanced Features: Leverage apk --simulate to test changes before applying them, and apk info --who-owns <file> to trace installed files to their package for better system management.
[/spoiler]

just my personal opinion if a new user (or a person who is looking for information) the best place is this:

https://openwrt.org/docs/guide-user/start
https://openwrt.org/docs/guide-user/additional-software/apk
https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet

ps: There is still little information but I trust that more will be added later...

if you see the doc for opkg it is quite complete...

https://openwrt.org/docs/guide-user/additional-software/opkg