"pkg upgrade foo" installs foo if not already installed, bug?

0 views
Skip to first unread message

Aleksandr Miroslav

unread,
Apr 1, 2023, 9:16:43 PM4/1/23
to freebsd-...@freebsd.org
Observe the following:

$ pkg info|grep -q cowsay && echo installed || echo not installed
not installed
$ sudo pkg upgrade -q -y cowsay
$ pkg info|grep -q cowsay && echo installed || echo not installed
installed

It looks like when "pkg upgrade" is given an uninstalled package to
upgrade, it installs it.

(This is on 13.1-RELEASE.)

I would think the expected behavior would be to throw an error because the
package does not exist, or at least have a switch to control it.

Am I misunderstanding how "pkg upgrade" should work, or was this
behavior changed recently?

(I quickly looked through bugzilla, the pkg src tree, and the GitHub
issues for pkg and didn't find anything, but it's possible I may have
missed something.)

Paul Procacci

unread,
Apr 1, 2023, 11:08:20 PM4/1/23
to Aleksandr Miroslav, freebsd-...@freebsd.org
pkg upgrade IS package install w/ the exception that pkg upgrade tries to upgrade dependencies of packages matched.
Any packages listed on the command line are added to the list of packages to ensure are available.

pkg-upgrade(8) has these details spelt out.

~Paul

--
__________________

:(){ :|:& };:
Reply all
Reply to author
Forward
0 new messages