freebsd / pkg

Package management tool for FreeBSD. Help at #pkg on Libera Chat or pkg@FreeBSD.org
Other
740 stars 277 forks source link

Conflict resolution wants to install the already installed conflicting package instead of deleting it #1447

Open grembo opened 8 years ago

grembo commented 8 years ago

Situation: pacemaker was already installed and heartbeat should be installed.

I ran: pkg install heartbeat

It then asked me if I want to install heartbeat, detected the conflict, asked me if I want to install it again. It then went on to download both packages and (re-)install both (at least that what the log looks like to me). As installing pacemaker failed due to detecting the conflict, I ended up with what I wanted, it's still certainly not how pkg should behave.

Also, this output is kind of weird:

The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        heartbeat: 2.1.4_27

Complete log:

Fetching meta.txz: 100%    944 B   0.9kB/s    00:01    
Fetching packagesite.txz: 100%    5 MiB   1.4MB/s    00:04    
Processing entries: 100%
FreeBSD repository update completed. 25363 packages processed.
Updating database digests format: 100%
New version of pkg detected; it needs to be installed first.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        pkg: 1.8.5_1 -> 1.8.6

2 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching pkg-1.8.6.txz: 100%    2 MiB 849.8kB/s    00:03    
Checking integrity... done (0 conflicting)
[1/1] Upgrading pkg from 1.8.5_1 to 1.8.6...
[1/1] Extracting pkg-1.8.6: 100%
You may need to manually remove /usr/local/etc/pkg.conf if it is no longer needed.
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        heartbeat: 2.1.4_27

The process will require 7 MiB more space.
1 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching heartbeat-2.1.4_27.txz: 100%    1 MiB   1.5MB/s    00:01    
Checking integrity... done (1 conflicting)
  - heartbeat-2.1.4_27 conflicts with pacemaker-1.1.14 on /usr/local/lib/libcib.a
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        heartbeat: 2.1.4_27

The process will require 7 MiB more space.

Proceed with this action? [y/N]: y
Fetching pacemaker-1.1.14.txz: 100%    2 MiB   1.2MB/s    00:02    
[1/3] Deinstalling pacemaker-1.1.14...
[1/3] Deleting files for pacemaker-1.1.14: 100%
==> You should manually remove the "hacluster" user. 
==> You should manually remove the "haclient" group 
[2/3] Installing heartbeat-2.1.4_27...
===> Creating groups.
Using existing group 'haclient'.
===> Creating users
Using existing user 'hacluster'.
[2/3] Extracting heartbeat-2.1.4_27: 100%
[2/3] Installing pacemaker-1.1.14...
pkg: pacemaker-1.1.14 conflicts with heartbeat-2.1.4_27 (installs files into the same place).  Problematic file: /usr/local/lib/libcib.a
bapt commented 8 years ago

thanks for reporting I will look at it

bapt commented 8 years ago

Should be fixed in git, I will issue a new release soon

bapt commented 8 years ago

in 1.8.7

grembo commented 8 years ago

Tested & confirmed, thank you!

mat813 commented 8 years ago

Mmmm, I'm not certain this is fixed:

# pkg install bind9-devel
Updating abso repository catalogue...
abso repository is up-to-date.
All repositories are up-to-date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        bind9-devel: 9.12.0.a.2016.07.04

Number of packages to be installed: 1

The process will require 59 MiB more space.
7 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching bind9-devel-9.12.0.a.2016.07.04.txz: 100%    7 MiB   7.9MB/s    00:01
Checking integrity... done (1 conflicting)
  - bind9-devel-9.12.0.a.2016.07.04 conflicts with bind911-9.11.0.b1 on /usr/local/bin/bind9-config
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 3 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
        bind911-9.11.0.b1

New packages to be INSTALLED:
        bind9-devel: 9.12.0.a.2016.07.04

Installed packages to be REINSTALLED:
        pkg-1.8.7

Number of packages to be removed: 1
Number of packages to be installed: 1
Number of packages to be reinstalled: 1

2 MiB to be downloaded.

Proceed with this action? [y/N]:

Or maybe it is a different bug…

grembo commented 8 years ago

It worked ok for my specific example, but I could also reproduce the issue you're seeing. In my case I had bind-tools-9.10.3P3 installed and then tried to install bind910. Now it tried installing bind-tools-9.104P1 (pretty similar to the heartbeat problem). After upgrading this doesn't happen anymore, so installing bind-tools will delete bind910 and vice versa like expected. So maybe this is related to the fact that the conflicting package wasn't at its latest version, which made pkg add it to a list of packages to upgrade? (just a wild guess)

$ sudo pkg install bind910
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        bind910: 9.10.4P1

Number of packages to be installed: 1

The process will require 49 MiB more space.
6 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching bind910-9.10.4P1.txz:   0%
Checking integrity... done (1 conflicting)
  - bind910-9.10.4P1 conflicts with bind-tools-9.10.3P3 on /usr/local/bin/delv
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        bind910: 9.10.4P1

Number of packages to be installed: 1

The process will require 49 MiB more space.

Proceed with this action? [y/N]: y
Fetching bind-tools-9.10.4P1.txz:   0%
[1/3] Deinstalling bind-tools-9.10.3P3...
[1/3] Deleting files for bind-tools-9.10.3P3:   0%
[2/3] Installing bind910-9.10.4P1...
[2/3] Extracting bind910-9.10.4P1:   0%
[2/3] Installing bind-tools-9.10.4P1...
pkg: bind-tools-9.10.4P1 conflicts with bind910-9.10.4P1 (installs files into the same place).  Problematic file: /usr/local/bin/delv
bapt commented 8 years ago

crap the bind thing is the one I was specifically looking at. there might be another reason...

bapt commented 8 years ago

I would need more material as I have tried specifically with bind-tools and bind910 and can't reproduce

grembo commented 8 years ago

Ok, this is how you can reproduce it:

e.g.

pkg delete bind-tools bind910
rm /var/cache/pkg/bind*
fetch https://blog.grem.de/bits/bind-tools-9.10.3.txz
pkg add bind-tools-9.10.3.txz
pkg install bind910
grembo commented 8 years ago

Output of the procedure above:

[root@bsd64 ~]# rm /var/cache/pkg/bind*
[root@bsd64 ~]# fetch https://blog.grem.de/bits/bind-tools-9.10.3.txz
bind-tools-9.10.3.txz                         100% of 2466 kB 1644 kBps 00m01s
[root@bsd64 ~]# pkg add bind-tools-9.10.3.txz
Installing bind-tools-9.10.3...
Extracting bind-tools-9.10.3: 100%
[root@bsd64 ~]# pkg install bind910
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Updating database digests format: 100%
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        bind910: 9.10.4P1

Number of packages to be installed: 1

The process will require 49 MiB more space.
6 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching bind910-9.10.4P1.txz: 100%    6 MiB   1.6MB/s    00:04    
Checking integrity... done (1 conflicting)
  - bind910-9.10.4P1 conflicts with bind-tools-9.10.3 on /usr/local/bin/delv
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        bind910: 9.10.4P1

Number of packages to be installed: 1

The process will require 49 MiB more space.

Proceed with this action? [y/N]: y
Fetching bind-tools-9.10.4P1.txz: 100%    2 MiB 841.0kB/s    00:03    
[1/3] Deinstalling bind-tools-9.10.3...
[1/3] Deleting files for bind-tools-9.10.3: 100%
[2/3] Installing bind910-9.10.4P1...
[2/3] Extracting bind910-9.10.4P1: 100%
[2/3] Installing bind-tools-9.10.4P1...
pkg: bind-tools-9.10.4P1 conflicts with bind910-9.10.4P1 (installs files installs files into the same place).  Problematic file: /usr/local/bin/delv
mat813 commented 8 years ago

I have a transcript of pkg -o DEBUG_LEVEL=4 install bind910:

https://people.freebsd.org/~mat/pkg-bind.txt