pkg force to add a package

Tomasz Sowa tomek at ttmath.org
Wed Feb 10 17:30:18 UTC 2016


Hi

Some questions about pkg. On one computer I have recompiled my ports,
next I wanted to copy them to another machine so I created packages
(for simplicity I'm showing only one package):
/home/tomek# pkg create -f tar nettle-3.2
Creating package for nettle-3.2
It created nettle-3.2.tar package.

On the other machine I have nettle installed but it was in an old
version:
[second_machine]/home/tomek# pkg info | grep nettle
nettle-2.7.1                   Low-level cryptographic library

Let we see some files from the package:
[second_machine]/home/tomek# pkg info -l nettle-2.7.1 | grep lib | head -n 4
        /usr/local/lib/libhogweed.a
        /usr/local/lib/libhogweed.so
        /usr/local/lib/libhogweed.so.2
        /usr/local/lib/libhogweed.so.2.5

Make sure those files belong to the nettle package:
[second_machine]/home/tomek# pkg which /usr/local/lib/libhogweed.so.2 /usr/local/lib/libhogweed.so.2.5
/usr/local/lib/libhogweed.so.2 was installed by package nettle-2.7.1
/usr/local/lib/libhogweed.so.2.5 was installed by package nettle-2.7.1

Now I move the new nettle-3.2 to this machine and try to
`pkg add` it:
[second_machine]/home/tomek# pkg add nettle-3.2.tar 
[second_machine] Installing nettle-3.2...
the most recent version of nettle-2.7.1 is already installed

It reports me that I have the newest version installed, where the
information (version) is taken from? is it normal behavior?

So I have forced the installation:
[second_machine]/home/tomek# pkg add -f nettle-3.2.tar
[second_machine] Installing nettle-3.2...
package nettle is already installed, forced install
[second_machine] Extracting nettle-3.2: 100%

Make sure it is really installed:
[second_machine]/home/tomek# pkg info | grep nettle
nettle-3.2                     Low-level cryptographic library

But what about the old files from nettle 2.7.1?
[second_machine]/home/tomek# ll /usr/local/lib/libhogweed.so.2 /usr/local/lib/libhogweed.so.2.5
lrwxr-xr-x  1 root  wheel      17  2 lip  2015 /usr/local/lib/libhogweed.so.2@ -> libhogweed.so.2.5
-rw-r--r--  1 root  wheel  419229  2 lip  2015 /usr/local/lib/libhogweed.so.2.5

There are still there, may they belongs to some other package now?
[second_machine]/home/tomek# pkg which /usr/local/lib/libhogweed.so.2 /usr/local/lib/libhogweed.so.2.5
/usr/local/lib/libhogweed.so.2 was not found in the database
/usr/local/lib/libhogweed.so.2.5 was not found in the database

No, they are orphans. And next question is: is it correct behavior?
I would expect that either `pkg info | grep nettle` reports both:
nettle-2.7.1                   Low-level cryptographic library
nettle-3.2                     Low-level cryptographic library
or if only nettle-3.2 is installed those files from 2.7.1
are uninstalled. Correct me if am wrong pls.


-- 
Tomek



More information about the freebsd-pkg mailing list