Bug 225361 - ports-mgmt/pkg: pkg install xxx removes needed and unrelated packages from system
Summary: ports-mgmt/pkg: pkg install xxx removes needed and unrelated packages from sy...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-pkg mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-21 18:23 UTC by pru13allan
Modified: 2018-02-11 23:17 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pru13allan 2018-01-21 18:23:04 UTC
When installing a Perl-script from package database several packages were deleted that was not related to it.
One of them were fwknopd that was running at the time of the installation and that I had to manually install again to not get locked out from the remote machine.

The pkg job numbers [1/10], [2/10], ... is not logical (to me, anyway).


[root@fbsd4:~]# pkg install mysqltuner
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01    
Fetching packagesite.txz: 100%    5 MiB   2.5MB/s    00:02    
Processing entries: 100%
FreeBSD repository update completed. 24599 packages processed.
All repositories are up to date.
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.10.1 -> 1.10.3_1

Number of packages to be upgraded: 1

2 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching pkg-1.10.3_1.txz: 100%    2 MiB   2.3MB/s    00:01    
Checking integrity... done (0 conflicting)
[1/1] Upgrading pkg from 1.10.1 to 1.10.3_1...
Extracting pkg-1.10.3_1: 100%
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 10 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
        mesa-libs-17.2.4
        libva-1.8.3
        ffmpeg-3.4,1
        gnupg-2.2.2
        gpgme-1.9.0_1
        fwknop-2.6.9_2
        motion-4.0.1_5

New packages to be INSTALLED:
        mysqltuner: 1.7.2

Installed packages to be REINSTALLED:
        apr-1.6.3.1.6.1
        libidn2-2.0.4

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

The operation will free 68 MiB.
547 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/10] Fetching mysqltuner-1.7.2.txz: 100%   54 KiB  55.1kB/s    00:01    
[2/10] Fetching apr-1.6.3.1.6.1.txz: 100%  399 KiB 408.2kB/s    00:01    
[3/10] Fetching libidn2-2.0.4.txz: 100%   95 KiB  96.9kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/10] Deinstalling fwknop-2.6.9_2...
You may need to manually remove /usr/local/etc/fwknop/access.conf if it is no longer needed.
You may need to manually remove /usr/local/etc/fwknop/fwknopd.conf if it is no longer needed.
[1/10] Deleting files for fwknop-2.6.9_2: 100%
[2/10] Deinstalling gpgme-1.9.0_1...
[2/10] Deleting files for gpgme-1.9.0_1: 100%
[3/10] Deinstalling gnupg-2.2.2...
Deleting files for gnupg-2.2.2: 100%
[1/10] Deinstalling motion-4.0.1_5...
[1/10] Deleting files for motion-4.0.1_5: 100%
[2/10] Deinstalling ffmpeg-3.4,1...
[2/10] Deleting files for ffmpeg-3.4,1: 100%
[3/10] Deinstalling libva-1.8.3...
Deleting files for libva-1.8.3: 100%
[1/10] Deinstalling mesa-libs-17.2.4...
[1/10] Deleting files for mesa-libs-17.2.4: 100%
[2/10] Installing mysqltuner-1.7.2...
[2/10] Extracting mysqltuner-1.7.2: 100%
[3/10] Reinstalling apr-1.6.3.1.6.1...
Extracting apr-1.6.3.1.6.1: 100%
[1/10] Reinstalling libidn2-2.0.4...
[1/10] Extracting libidn2-2.0.4: 100%
Message from apr-1.6.3.1.6.1:
/!\ ================================================================== /!\

The Apache Portable Runtime project removed support for FreeTDS with
version 1.6. Users requiring MS-SQL connectivity must migrate
configurations to use the added ODBC driver and FreeTDS' ODBC features.

/!\ ================================================================== /!\

My system:
FreeBSD fbsd4 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r320146M: Tue Jun 20 09:59:03
 MDT 2017  raspberry@hive.raspbsd.org:/usr/home/brd/rpi3/crochet/work/obj
 /arm64.aarch64/usr/src/sys/GENERIC  arm64
Comment 1 Larry Rosenman freebsd_committer 2018-01-21 20:59:55 UTC
I'm working with a user, and suggested he use my package, and saw similar.  

Sorry Larry,

never used poudriere.

But I used my browser to download boinc-client-7.8.6_2.txz from your
repository.

Then I did
pkg install -n /usr/home/stthu/Downloads/boinc-client-7.8.6_2.txz
to see what will happen. See below:

Updating database digests format: 100%
The following 72 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
        minidlna-1.2.1,1
        ghostscript9-agpl-base-9.16_5
        psutils-1.17_5
        mutt-1.9.2
        sxiv-24
        lynx-2.8.8.2_6,1

New packages to be INSTALLED:
        boinc-client: 7.8.6_2
        xlockmore: 5.54
        linux_base-c7: 7.4.1708_2
        openssl: 1.0.2n,1

Installed packages to be REINSTALLED:
        libXft-2.3.2_1
        xset-1.2.3_1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXext-1.3.3_1,1
        libXau-1.0.8_3
        libXp-1.0.3,1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXaw-1.0.13,2
        libXdmcp-1.1.2
        libXrender-0.9.10
        x11perf-1.6.0 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXmu-1.1.2_3,1
        libXt-1.1.5,1
        libSM-1.2.2_3,1
        libICE-1.0.9_1,1
        iceauth-1.0.7 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libxkbui-1.0.2_4 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libxkbfile-1.0.9
        xkbutils-1.0.4 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xwd-1.0.6 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        setxkbmap-1.3.1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xkbevd-1.1.4 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        pixman-0.34.0
        libXfixes-5.0.3
        libXcomposite-0.4.4_3,1
        xdpyinfo-1.3.2 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libdmx-1.1.3_3 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXxf86vm-1.1.4_1
        xgamma-1.0.6 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXv-1.0.11,1
        libXdamage-1.1.4_3
        libXrandr-1.5.1
        xev-1.2.2 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xinput-1.6.2 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXinerama-1.1.3_3,1
        xcalc-1.0.6_2 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xsetroot-1.1.1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        bitmap-1.0.8 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        fribidi-0.19.7 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xvid-1.3.4,1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libvdpau-1.1.1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libv4l-1.6.3_2 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        jbigkit-2.1_1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libid3tag-0.15.1b_1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXScrnSaver-1.2.2_3
        xautolock-2.2_1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        speexdsp-1.2.r3_1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libltdl-2.4.6 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xvinfo-1.1.3 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXxf86misc-1.0.3_3 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXxf86dga-1.1.4_3
        xf86dga-1.0.3_1 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXevie-1.0.3_3 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXTrap-1.0.1_3 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        libXfontcache-1.0.5_3 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xrdb-1.1.0 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xpr-1.0.4 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xmessage-1.0.4 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xkill-1.0.4 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xhost-1.0.7 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        xgc-1.0.5 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        smproxy-1.0.6 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        appres-1.0.4 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')
        twm-1.0.9 (ABI changed: 'freebsd:10:x86:64' -> 'freebsd:11:x86:64')

Number of packages to be removed: 6
Number of packages to be installed: 4
Number of packages to be reinstalled: 62

The process will require 197 MiB more space.
40 MiB to be downloaded.
Comment 2 pru13allan 2018-02-11 19:51:15 UTC
One possible cause may be that 'pkg' is sensitive to kernel versions (uname -K).

I have seen the behaviour on more than one 12-CURRENT, where server is version 1200054 and an updated pkg is compiled on 1200056, that packages with same package version as in repository get on the list of 'to be REMOVED'.
After reinstalling these packages (with same version numbers) all is OK.

When trying to force an update of package database this is what shows up:
# pkg update -f
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    944 B   0.9kB/s    00:01    
Fetching packagesite.txz: 100%    5 MiB   2.4MB/s    00:02    
Processing entries:   0%
pkg: Newer FreeBSD version for package desktop-file-utils:
- package: 1200056
- running kernel: 1200054
pkg: repository FreeBSD contains packages for wrong OS version: FreeBSD:12:aarch64
Processing entries: 100%
Unable to update repository FreeBSD
Error updating repositories!

My conclusion: Keep up with new kernel versions.
(And 'pkg upgrade -f' after OS upgrade)
Comment 3 Conrad Meyer freebsd_committer 2018-02-11 20:00:44 UTC
(In reply to pru13allan from comment #2)
I don't think kernel version changes are the only issue with the described symptom, and I don't think the proposed solution "Keep up with new kernel versions" is an acceptable resolution to the problem.

If pkg arrives in the scenario where a 'pkg install' wants to remove installed packages, it should produce an error message and abort.  Full stop.

If the resulting action isn't insane, the user can remove the mentioned conflicting packages if it makes sense, and then re-run the 'pkg install'.  If the resulting action would have been insane, the user is prevented from shooting themselves in the foot.
Comment 4 pru13allan 2018-02-11 21:50:35 UTC
(In reply to Conrad Meyer from comment #3)

My conclusion is not working for everyone. Sorry about that.

It is always a risk of having version problems on a fast evolving OS.
I now start from scratch after source update to minimize most of these problems.

But you are absolutly right about that pkg install should stop and not
remove packages that dont match current kernel version.
One way to do it is to put them in 'to be REINSTALLED' if possible.
Comment 5 Conrad Meyer freebsd_committer 2018-02-11 23:17:15 UTC
Yep, I would find reinstalled or upgraded much more acceptable than removed.