# updating installed package tries to remove other packages



## chavez243ca (Oct 2, 2018)

Have an ongoing issue with a couple hosts, pretty much anytime I update an installed package via pkg, it wants to remove clamav-unofficial-sigs. There seems to be an ongoing conflict between clamav, clamav-milter and clamav-unofficial-sigs - where updating any of those (and other packages) always descends into this battle of removing each other and I always have to sort things out with good, ole, reliable ports.

Any thoughts?


----------



## ljboiler (Oct 2, 2018)

I could be wrong, but looking at the pkg dependencies, it looks to me like:
1) clamav-unofficial-sigs depends on clamav
2) clamav and clamav-milter are mutually exclusive (one or the other)


----------



## SirDice (Oct 2, 2018)

Package dependencies are set in stone. Building some parts from ports will cause different dependencies to be included. This can lead to conflicts. Simple solution, don't mix ports and packages unless you know what you are doing and understand the consequences.

A better solution, especially if you have to maintain multiple hosts, is to set up your own repository. That will give you the flexibility of ports while keeping the ease of management from packages.


----------



## chavez243ca (Oct 20, 2018)

Just wanted to provide a contemporary example, since this just happened:

`root@cxxxxxxx:/usr/home/xxxx # pkg install sudo
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
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.5_1 -> 1.10.5_3

Number of packages to be upgraded: 1

3 MiB to be downloaded.

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

Installed packages to be REMOVED:
    clamav-unofficial-sigs-5.6.2

New packages to be INSTALLED:
    sudo: 1.8.25p1

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

The process will require 3 MiB more space.
679 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching sudo-1.8.25p1.txz: 100%  679 KiB 695.5kB/s    00:01  
Checking integrity... done (0 conflicting)
[1/2] Deinstalling clamav-unofficial-sigs-5.6.2...
You may need to manually remove /usr/local/etc/clamav-unofficial-sigs/user.conf if it is no longer needed.
[1/2] Deleting files for clamav-unofficial-sigs-5.6.2: 100%
**********************************************************************

In order to completely remove clamav-unofficial-sigs you need to
completely remove its working directory and installed third-party
signature databases from ClamAV's database directory.

As a guide what needs to be removed you can take a look at the:

/var/db/clamav-unofficial-sigs/configs/purge.txt

file, which lists all files related to clamav-unofficial-sigs.

**********************************************************************
[2/2] Installing sudo-1.8.25p1...
[2/2] Extracting sudo-1.8.25p1: 100%`

Perhaps in the vein of what SirDice said - clamav-unofficial-sigs (regardless of being installed as pkg or port) just does not play well with pretty much every other pkg. Seems odd though. Thought maybe something needs to be set in make.conf


----------



## chavez243ca (Oct 20, 2018)

Looked at the pkg options for clamav and sure enough milter=no, removed all three packages and built from ports - I think I might have to try pkg-lock to see if I can get other pkg maintenance to not mess with those particular ports.


----------



## ShelLuser (Oct 20, 2018)

Or just stop the mixed use of ports and packages. In the long run it's going to haunt you one way or the other.


----------



## Abraham79 (Oct 20, 2018)

ShelLuser said:


> Or just stop the mixed use of ports and packages. In the long run it's going to haunt you one way or the other.


If a package with different options needs to be enabled/disabled and built, we should use ports, I presume. As I understands, ports will add or remove packages when compiled for dependency resolution. In order to avoid this, do desktop/laptop/average user need to set up ports-mgmt/synth as a cleaner way to manage packages?


----------

