Open OrangeDog opened 4 years ago
Actually, it installed just fine with a manual apt install zabbix-agent zabbix-sender
, so I have no idea what was going on.
For reference from our conversation in Slack.
I was able to avoid zabbix-sender
being installed using the following pillar:
zabbix:
# Overrides map.jinja
lookup:
version_repo: '4.4'
agent:
pkgs:
- zabbix-agent
Tested locally with Kitchen on default-ubuntu-1804-3000-2-py3
.
You already have zabbix-agent
installed from Ubuntu repo - zabbix-agent 1:4.0.17+dfsg-1
, this package include zabbix-sender utility. But in official Zabbix repo there is 2 separate packages - zabbix-agent
and zabbix-sender
.
Most obvious solution - install zabbix-agent
from official repo then zabbix-sender
should install without problems.
So this issue is not directly related with this formula, @OrangeDog would you mind close it?
It's this formula that should be deciding what gets installed from where on each platform.
I don't think that formula can cover all cases. There is no problems when formula is applied on clean system. You have system in unknown but definitely not clean state. I described cause of this issue above, how you suppose formula must behave in this situation? This formula and Salt too can't solve package manager conflicts.
Probably I faced this issue too. Root of the issue - how apt
select candidate for installation when specific version is provided.
Check policy first.
# apt-cache policy zabbix-agent
zabbix-agent:
Installed: 1:5.0.1-1+buster
Candidate: 1:5.0.1-1+buster
Version table:
1:5.0.1+dfsg-1~bpo10+1 100
100 http://ftp.halifax.rwth-aachen.de/debian buster-backports/main amd64 Packages
*** 1:5.0.1-1+buster 500
500 https://repo.zabbix.com/zabbix/5.0/debian buster/main amd64 Packages
100 /var/lib/dpkg/status
1:4.0.4+dfsg-1 500
500 http://ftp.halifax.rwth-aachen.de/debian buster/main amd64 Packages
Looks good, official repo have more priority. Lets try to actually install package.
# apt-get -s install zabbix-agent=1:5.0*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '1:5.0.1+dfsg-1~bpo10+1' (Debian Backports:buster-backports [amd64]) for 'zabbix-agent'
The following packages will be upgraded:
zabbix-agent
1 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Inst zabbix-agent [1:5.0.1-1+buster] (1:5.0.1+dfsg-1~bpo10+1 Debian Backports:buster-backports [amd64])
Conf zabbix-agent (1:5.0.1+dfsg-1~bpo10+1 Debian Backports:buster-backports [amd64])
it's easily can be noticed that apt
tries to install package from backports
though backports
repo have a lover priority. And after package from backports
(or from system repository as in OrangeDog case) will be installed, then installation of zabbix-sender
will fail.
Only solution I can see in this situation - provide more specific version for apt
. I.e. in my example problem can be solved by using 1:5.0*buster
as version string
apt-get -s install zabbix-agent=1:5.0*buster
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '1:5.0.1-1+buster' (zabbix:repo.zabbix.com [amd64]) for 'zabbix-agent'
The following NEW packages will be installed:
zabbix-agent
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Inst zabbix-agent (1:5.0.1-1+buster zabbix:repo.zabbix.com [amd64])
Conf zabbix-agent (1:5.0.1-1+buster zabbix:repo.zabbix.com [amd64])
Something like 1:5.0.*{{ grains['oscodename'] }}
can be used in pillars for Debian family, not sure about other distributives.
Due fact that version string is completely under user control, from the formula side we can only update documentation and pillar.example
and notice users about this behavior and possible consequences.
@OrangeDog does this looks similar to your situation?
It's this formula that should be deciding what gets installed from where on each platform.
It's impossible to pin specific repository for specific package in Debian family OS-es. It is possible to pin release
but in Zabbix official repository generic main
is used, therefor pining something like release a=main
makes a very little sense.
On Ubuntu 20.04 this formula tries to install both
zabbix-agent
andzabbix-sender
, which doesn't work with the 4.4 repo: