In the new apk software, please alias "install" for "add"

The command was opkg install…

most package managers have converged on “install” as the verb

I’m not saying you have to remove “add”

Just apk should understand that

apk install sftp

means that the same thing as

apk add sftp

It is unnecessarily painful to bend users into learning new terminology, it is already enough of a pain to re-forge the flesh of neuronal memory from opkg to apk, so that would be basically free change to smooth this transistion

(could also alias the obsolete commands like opkg install entirely into apk add but that’s beyond the scope of this request)

apk is not made here. it is solid & accepted in alpine

2 Likes

As @brada4 pointed out, apk is not code that originates within the OpenWrt project -- it comes from upstream (courtesy of Alpine Linux).

As such, you can request those changes as feature requests in the Alpine context, but it's highly unlikely that they would adopt such FRs given that APK isn't related to or derived from the opkg package manager.

With all of that said...

There are some situations where breaking changes are necessary. In those cases, we all adapt and in the long run the benefits are realized as more stable operation with better maintainability, among other things.

A prime example of this is the DSA transition which represents a huge departure from the swconfig methods that preceded it. Here, too, users had to learn new syntax and reconfigure their devices. But the developers have always ensured that there is sufficient time to bake for the new methods so that the majority of bugs can be resolved and functionality will be on-par or better than the predecessor (which is why DSA has rolled out target-by-target since 21.02, and why APK was not built into 24.10).

2 Likes

I typed apk install once. It returned an error message. Reading head of ssh console gave me the solution. It is not that hard to learn a new command. You can do it ...

Well actually, no. It would totally muddy the waters of any transition by hiding apk behind the alias.
It would perpetuate the "old way".

What might be useful in a transition (perhaps for the lifetime of 25.12) would be a script called "opkg" that gave the same message that you now get when starting a terminal session. ie:

OpenWrt recently switched to the "apk" package manager!

 OPKG Command           APK Equivalent      Description
 ------------------------------------------------------------------
 opkg install <pkg>     apk add <pkg>       Install a package
 opkg remove <pkg>      apk del <pkg>       Remove a package
 opkg upgrade           apk upgrade         Upgrade all packages
 opkg files <pkg>       apk info -L <pkg>   List package contents
 opkg list-installed    apk info            List installed packages
 opkg update            apk update          Update package lists
 opkg search <pkg>      apk search <pkg>    Search for packages
 ------------------------------------------------------------------

For more information visit:
https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet

3 Likes

Ok. Having fun now.

Type in the following commands:

echo "#!/bin/sh" > /usr/sbin/opkg
echo ". /etc/profile.d/apk-cheatsheet.sh" >> /usr/sbin/opkg
chmod +x /usr/sbin/opkg

Now try typing opkg

3 Likes

Well, ok, what is the breaking change that requires it be called “add” and not “install”

Do they use the “install” keyword for something ?

Can we really not ask them to just put an alias so that it just works, because “install”

apt install <package-name>
brew install <package-name>
cargo install <package-name>
choco install <package-name>
conda install <package-name>
dnf install <package-name>
gem install <package-name>
go install <package-name>
npm install <package-name>
pip install <package-name>
scoop install <package-name>
winget install <package-name>
yum install <package-name>
apk add <package-name>
composer require <package-name>
dotnet add package <package-name>
pnpm add <package-name>
yarn add <package-name>
pacman -S <package-name>

Just ask them to treat add or install as the same thing

And also “remove” “uninstall” and “del”

apt remove <package-name>

composer remove <package-name>
conda remove <package-name>
dnf remove <package-name>
pnpm remove <package-name>
yarn remove <package-name>
yum remove <package-name>
choco uninstall <package-name>
gem uninstall <package-name>
npm uninstall <package-name>
pip uninstall <package-name>
scoop uninstall <package-name>
winget uninstall <package-name>
apk del <package-name>
cargo uninstall <package-name>
dotnet remove package <package-name>
go clean -i <package-name>
pacman -R <package-name>

At least search is search

apt search <package-name>
cargo search <package-name>
choco search <package-name>
composer search <package-name>
conda search <package-name>
dnf search <package-name>
npm search <package-name>
pip search <package-name>
winget search <package-name>
yarn search <package-name>
apk search <package-name>
brew search <package-name>
dotnet search <package-name>
gem search <package-name>
scoop search <package-name>
pacman -Ss <package-name>
go list -m <package-name>
yum list available | grep <package-name>

But for search, how fuzzy that search is, is always some nasty surprise, like when you search “ssh“ and there’s either nothing or 25 pages except the thing you want, no separation between title search, verbatim search and description search !

Anyway, I don’t think that’s a lot to ask them, add since “install” just breaks already, no script is going to break just because it aliases with “add”.

You can write a shell function do this without having to modify apk itself. Here's an example adapted from the wiki:

mkdir -p /etc/profile.d
cat << "EOF" > /etc/profile.d/alias.sh
apk() {
    subcommand="$1"
    shift
    if [ "$subcommand" = install ]; then
        subcommand=add
    fi
    command apk "$subcommand" "$@"
}
EOF
. /etc/profile

Feel free to ask them. But they (i.e. APK package developers/maintainers) probably aren't going to see it on the OpenWrt forums.

1 Like

Just as an aside, I don't exactly recall when apk replaced opkg in master/snapshots, but it was around summer 2024.
The pain was so bad - it took a whole minute for me to

re-forge the flesh of neuronal memory from opkg to apk

and another whole 5 minutes to refactor code I was using to detect installed optional packages.

Now, when using 24.10.x I find myself asking the question:
In the old opkg software, could someone please alias “add” for “install”.

You can, after all, teach an old dog (me) new tricks.

2 Likes

Personally I don’t see the value in the user even having to know the package manager’s name

just

install

remove

60 years of unix and no one made a program called “install”

root@router:~# install
-ash: install: not found
root@router:~#

It’s not ambiguous, either, install sshd, it’s clear what I want, the OS should just do it.

I don’t want to spend the rest of my life making alias on every single computer I touch, it should just work, I shouldn’t have to reprogram my flesh every tuesday ! Computer should do the job of computer, I should not be the one getting reprogrammed. The change I suggest here is easier to implement than the effort explaining why it’s not needed in this thread already !

Anyway, after 15 minutes of doing micro-labour for the Captcha company and passing through approximately 50 operations, I have created and account and created an issue so it can all be safely ignored as our digital infrastructures demands we change ever faster, all day every day !

https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/11179

Perhaps some old dogs can't learn new tricks after all...

That is 14 minutes longer than it took me to re-forge the flesh of neuronal memory from opkg to apk..
Oh well....

1 Like

ok sure, let’s say it’s just a 1 minute annoyance, now just multiply with with the number of openwrt users…

I don’t understand where dismissing that comes from, it’s ubiquitous, it was the same in 2000, you'd ask anything and you'd have the hordes coming out of the wood work to say no no nooooooo to absolutely ANY accommodation of the users as if somehow making computers into a forest of papercuts was a virtuous things, it's just a little paper cut, that's nothing now bite down I'll just reprogram your brain for a second !

That said, openwrt is such a dream to use when all things considered, I will miss when all routers and computers come with non-unlockable bootloaders !

You mean when all routers and computers come with "non-unlockable bootloaders" that we have to unlock.

  • Scotty: [Scotty has sabotaged Excelsior and left the ship stranded]
  • Kirk: Scotty, you're as good as your word.
  • Scotty: Aye, sir. The more they overthink the plumbing, the easier it is to stop up the drain.
  • Scotty: [giving McCoy a handful of computer chips]
  • Scotty: Here, Doctor, souvenirs from one surgeon to another. I took them out of her main transwarp computer drive router.
  • McCoy: Nice of you to tell me in advance.
  • Kirk: That's what you get for missing staff meetings, Doctor. Gentlemen, your work today has been outstanding and I intend to recommend you all for promotion... in whatever fleet we end up serving.

Since the FR has been filed with the Alpine team, this thread can now be closed.

1 Like