# Why does pkg upgrade want to install deprecated packages



## ProServ (Mar 23, 2022)

Hi, 
Ran pkg upgrade and it wants to install deprecated packages

# pkg upgrade
The following 4 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        db5: 5.3.28_8
        ruby26: 2.6.9,1

Installed packages to be UPGRADED:
        expat: 2.4.4 -> 2.4.7
        nss: 3.75 -> 3.76

Number of packages to be installed: 2
Number of packages to be upgraded: 2


from the Makefile for db5:
DEPRECATED=     EOLd, potential security issues, maybe use db18 instead

Ruby26

DEPRECATED=     Use newer version of Ruby. Ruby 2.6 will reach its EoL on March 31, 2022
EXPIRATION_DATE=        2022-03-31

Just don't get why pkg would install deprecated pkg.
Thanks.


----------



## mer (Mar 23, 2022)

because at this point in time, the deprecated packages are the dependencies of what you want to install.
db5:  whatever package is depending on db5 needs to be updated to use db18.


----------



## ProServ (Mar 24, 2022)

mer said:


> because at this point in time, the deprecated packages are the dependencies of what you want to install.
> db5:  whatever package is depending on db5 needs to be updated to use db18.


Hi,
 # pkg info -r db5
pkg: No package(s) matching db5

 # pkg info -r ruby26
pkg: No package(s) matching ruby26

Any other ideas?
Thanks.


----------



## monwarez (Mar 24, 2022)

This command will only get you direct dependency on db5, for example: libreoffice depends on apr which depends on db5.
Use `pkg delete -n db5` to see all the dependency for db5, and `pkg delete -n ruby26` for ruby26.


----------



## mer (Mar 24, 2022)

pkg query %rn-%rv db5
redland-1.0.17_4
apr-1.7.0.1.6.1_1

You can add that as a "pkg alias" in /usr/local/etc/pkg.conf call it "reverse-depends".  Then you can do:
pkg reverse-depends apr
libreoffice-7.2.6.2
serf-1.3.9_6

Or use the pkg delete -n as monwarez suggests.
I also think the pkg info works on packages that you have installed, not on the remote repo.  So if you don't say "yes" on your pkg install command, you don't have db5 or ruby26 installed.  That is what pkg: No package(s) matching ruby26 means.

pkg info -r db5
db5-5.3.28_8:
    redland-1.0.17_4
    apr-1.7.0.1.6.1_1


----------



## grahamperrin@ (Mar 24, 2022)

<https://www.freshports.org/databases/db5/#dependencies>


```
root@mowa219-gjp4-8570p-freebsd:~ # porttree --quiet --reverse databases/db5
Depending on
0       ┌databases/db5
1       └devel/gmake (B)
2        ├devel/gettext-runtime (L)
3        │├converters/libiconv (B)
4        │└print/indexinfo (R)
         └print/indexinfo (R) → 4

Required by:
0       ┌databases/db5
1       ├archivers/rpm4 (L)
2       │├archivers/deco (R)
3       │├lang/linux-c7-tcl85 (E)
4       ││├emulators/linux-c7 (R)
5       ││├emulators/linux-power10-functional-sim (R)
6       ││└emulators/linux-power9-functional-sim (R)
7       │├misc/libmodulemd (L)
8       ││└sysutils/libdnf (L)
9       ││ └sysutils/dnf (R)
10      │├misc/libsolv (L)
        ││└sysutils/libdnf (L) → 8
        …
```

– abbreviated (the _required by_ tree is *much* longer in this case).

ports-mgmt/porttree


----------



## ProServ (Mar 24, 2022)

Hi,
I have db18 installed. Since pkg upgrade wanted to update nss and ruby26 tried the following.
pkg autoremove
pkg clean -a -n
pkg clean -a -y

Then pkg upgrade upgraded nss and only installed ruby26. Then ran pkg remove ruby26.
That seems to have worked.


----------

