pkg
pkg copied to clipboard
pkg-install doesn't always follow repo priorities settings correctly
We have a local pkg repo that contains a copy of all packages and the various upper-level .txz files from http://pkg.FreeBSD.org/FreeBSD:10:amd64/latest/
I have defined this repo to have a priority of 9 and stored the definition for this repo in /usr/local/etc/pkg/repos/. Yet, when I run a pkg install of a package with dependencies, it will get the requested package from our local repo, but the dependencies from the FreeBSD repo. As in:
% sudo pkg install clang33
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
Updating itadmin repository catalogue...
itadmin repository is up-to-date.
All repositories are up-to-date.
The following 2 packages will be affected (of 0 checked):
New packages to be INSTALLED:
clang33: 3.3_9 [itadmin]
llvm33: 3.3_10 [FreeBSD]
The process will require 155 MiB more space.
28 MiB to be downloaded.
Proceed with this action? [y/N]: n
It appears that the order of the REPOS_DIR setting in pkg.conf overrides the priority in this case. Once I change the order of the directories to look at /usr/local/etc/pkg/repos/ first, all packages are found in the higher priority repo.
% pkg -v
Version : 1.4.12
And now that I changed the order of the REPOS_DIR, pkg -vv shows this for the Repositories:
Repositories:
itadmin: {
url : "pkg+http://itadmin.foo.com/repos/FreeBSD/FreeBSD:10:amd64",
enabled : yes,
priority : 9,
mirror_type : "SRV"
}
FreeBSD: {
url : "pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/latest",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
This is bad, i hope it will be fixed someday. As workaround you can explicitly give pkg hint which repo must be used.
pkg install -r reponame package
I think I see the same issue, but I end up having installed broken package. Problem can only be alleviated by using "pkg install -r Local .....". Maybe this should be marked as bug?
I have "Local" repository with priority 10, which contains net-mgmt/zabbix22-proxy with same version as "FreeBSD" repository, but with different build options. When installing zabbix22-proxy, pkg complains about unsatisfied dependencies and all dependant packages except zabbix22-proxy, are installed from "FreeBSD" repository. Here's debug output
DBG(1)[4798]> pkg initialized Updating FreeBSD repository catalogue... DBG(1)[4798]> PkgRepo: verifying update for FreeBSD DBG(1)[4798]> Pkgrepo, begin update of '/var/db/pkg/repo-FreeBSD.sqlite' DBG(1)[4798]> Fetch: fetching from: http://pkgmir.pkg.freebsd.org/FreeBSD:10:amd64/latest/meta.txz with opts "i" DBG(1)[4798]> Fetch: fetching from: http://pkgmir.pkg.freebsd.org/FreeBSD:10:amd64/latest/packagesite.txz with opts "i" FreeBSD repository is up-to-date. Updating Local repository catalogue... DBG(1)[4798]> PkgRepo: verifying update for Local DBG(1)[4798]> Pkgrepo, begin update of '/var/db/pkg/repo-Local.sqlite' DBG(1)[4798]> Fetch: fetching from: http://localhost/amd64-default/meta.txz with opts "i" DBG(1)[4798]> Fetch: fetching from: http://localhost/amd64-default/packagesite.txz with opts "i" Local repository is up-to-date. All repositories are up-to-date. DBG(1)[4798]> want to get an advisory lock on a database DBG(1)[4798]> solver: cannot find provide for requirement: libxml2.so.2 DBG(1)[4798]> solver: cannot find provide for requirement: libssh2.so.1 DBG(1)[4798]> solver: cannot find provide for requirement: libsqlite3.so.0 DBG(1)[4798]> solver: cannot find provide for requirement: libOpenIPMIposix.so.0 DBG(1)[4798]> solver: cannot find provide for requirement: libOpenIPMI.so.0 The following 18 package(s) will be affected (of 0 checked): New packages to be INSTALLED: zabbix22-proxy: 2.2.9 [Local] iksemel: 1.4_6 [FreeBSD] gnutls: 3.3.15 [FreeBSD] trousers-tddl: 0.3.10_7 [FreeBSD] p11-kit: 0.23.1 [FreeBSD] libtasn1: 4.5_1 [FreeBSD] indexinfo: 0.2.3 [FreeBSD] ca_root_nss: 3.19.1_1 [FreeBSD] libffi: 3.2.1 [FreeBSD] nettle: 2.7.1 [FreeBSD] gmp: 5.1.3_2 [FreeBSD] libidn: 1.29 [FreeBSD] gettext-runtime: 0.19.4 [FreeBSD] fping: 3.10 [FreeBSD] net-snmp: 5.7.3_7 [FreeBSD] perl5: 5.20.2_4 [FreeBSD] curl: 7.42.1 [FreeBSD] unixODBC: 2.3.2_1 [FreeBSD]
When using "pkg install -r Local zabbix22-proxy" everything is fine
DBG(1)[4799]> pkg initialized Updating Local repository catalogue... DBG(1)[4799]> PkgRepo: verifying update for Local DBG(1)[4799]> Pkgrepo, begin update of '/var/db/pkg/repo-Local.sqlite' DBG(1)[4799]> Fetch: fetching from: http://localhost/amd64-default/meta.txz with opts "i" DBG(1)[4799]> Fetch: fetching from: http://localhost/amd64-default/packagesite.txz with opts "i" Local repository is up-to-date. All repositories are up-to-date. DBG(1)[4799]> want to get an advisory lock on a database DBG(1)[4799]> found stale pid 4798 in lock database, my pid is: 4799 DBG(1)[4799]> no concurrent processes found, cleanup the lock The following 26 package(s) will be affected (of 0 checked): New packages to be INSTALLED: zabbix22-proxy: 2.2.9 [Local] libxml2: 2.9.2_2 [Local] iksemel: 1.4_6 [Local] gnutls: 3.3.15 [Local] trousers-tddl: 0.3.10_7 [Local] p11-kit: 0.23.1 [Local] libtasn1: 4.5_1 [Local] indexinfo: 0.2.3 [Local] ca_root_nss: 3.19.1_1 [Local] libffi: 3.2.1 [Local] nettle: 2.7.1 [Local] gmp: 5.1.3_2 [Local] libidn: 1.29 [Local] gettext-runtime: 0.19.4 [Local] openipmi: 2.0.19_4 [Local] popt: 1.16_1 [Local] sudo: 1.8.13 [Local] nmap: 6.47 [Local] pcre: 8.37_1 [Local] libssh2: 1.4.3_5,2 [Local] fping: 3.10 [Local] net-snmp: 5.7.3_7 [Local] perl5: 5.20.2_4 [Local] curl: 7.42.1 [Local] unixODBC: 2.3.2_1 [Local] sqlite3: 3.8.10.1 [Local]
pkg -vv
Version : 1.5.3 PKG_DBDIR = "/var/db/pkg"; PKG_CACHEDIR = "/var/cache/pkg"; PORTSDIR = "/usr/ports"; INDEXDIR = ""; INDEXFILE = "INDEX-10"; HANDLE_RC_SCRIPTS = false; DEFAULT_ALWAYS_YES = false; ASSUME_ALWAYS_YES = false; REPOS_DIR [ "/etc/pkg/", "/usr/local/etc/pkg/repos/", ] PLIST_KEYWORDS_DIR = ""; SYSLOG = true; ABI = "FreeBSD:10:amd64"; ALTABI = "freebsd:10:x86:64"; DEVELOPER_MODE = false; VULNXML_SITE = "http://vuxml.freebsd.org/freebsd/vuln.xml.bz2"; FETCH_RETRY = 3; PKG_PLUGINS_DIR = "/usr/local/lib/pkg/"; PKG_ENABLE_PLUGINS = true; PLUGINS [ ] DEBUG_SCRIPTS = false; PLUGINS_CONF_DIR = "/usr/local/etc/pkg/"; PERMISSIVE = false; REPO_AUTOUPDATE = true; NAMESERVER = ""; EVENT_PIPE = ""; FETCH_TIMEOUT = 30; UNSET_TIMESTAMP = false; SSH_RESTRICT_DIR = ""; PKG_ENV { } PKG_SSH_ARGS = ""; DEBUG_LEVEL = 0; ALIAS { all-depends = "query %dn-%dv"; annotations = "info -A"; build-depends = "info -qd"; cinfo = "info -Cx"; comment = "query -i \"%c\""; csearch = "search -Cx"; desc = "query -i \"%e\""; download = "fetch"; iinfo = "info -ix"; isearch = "search -ix"; prime-list = "query -e '%a = 0' '%n'"; leaf = "query -e '%#r == 0' '%n-%v'"; list = "info -ql"; noauto = "query -e '%a == 0' '%n-%v'"; options = "query -i \"%n - %Ok: %Ov\""; origin = "info -qo"; provided-depends = "info -qb"; raw = "info -R"; required-depends = "info -qr"; roptions = "rquery -i \"%n - %Ok: %Ov\""; shared-depends = "info -qB"; show = "info -f -k"; size = "info -sq"; } CUDF_SOLVER = ""; SAT_SOLVER = ""; RUN_SCRIPTS = true; CASE_SENSITIVE_MATCH = false; LOCK_WAIT = 1; LOCK_RETRIES = 5; SQLITE_PROFILE = false; WORKERS_COUNT = 0; READ_LOCK = false; PLIST_ACCEPT_DIRECTORIES = false; IP_VERSION = 0; AUTOMERGE = true; VERSION_SOURCE = ""; CONSERVATIVE_UPGRADE = true; PKG_CREATE_VERBOSE = false; Repositories: FreeBSD: { url : "pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/latest", enabled : yes, priority : 0, mirror_type : "SRV", signature_type : "FINGERPRINTS", fingerprints : "/usr/share/keys/pkg" } Local: { url : "http://localhost/amd64-default", enabled : yes, priority : 10 }
Any news on this?
You can try with pkg 1.6. It should work as expected.
I have this issue too
pkg upgrade
Show me this:
Updating` FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
Updating poudriere repository catalogue...
poudriere repository is up-to-date.
All repositories are up-to-date.
Checking for upgrades (52 candidates): 100%
Processing candidates (52 candidates): 100%
The following 17 package(s) will be affected (of 0 checked):
Installed packages to be DOWNGRADED:
nettle: 3.2 -> 2.7.1 [FreeBSD]
libass: 0.13.1 -> 0.12.1_1 [FreeBSD]
libarchive: 3.1.2_6,1 -> 3.1.2_5,1 [FreeBSD]
harfbuzz: 1.1.3 -> 1.1.2 [FreeBSD]
gnutls: 3.3.17.1_2 -> 3.3.17.1 [FreeBSD]
enca: 1.18 -> 1.13_1 [FreeBSD]
Installed packages to be REINSTALLED:
xvid-1.3.4,1 [FreeBSD]
x265-1.8 [FreeBSD]
nginx-1.8.1,2 [poudriere]
mpv-0.15.0,1 [poudriere] (needed shared library changed)
libx264-0.144.2533_1 [FreeBSD]
libdvdread-5.0.3 [FreeBSD]
lame-3.99.5_3 [poudriere]
jsoncpp-0.6.0.r2_2 [FreeBSD]
ffmpeg-2.8.6,1 [poudriere]
curl-7.47.0 [FreeBSD]
cmake-3.4.2 [poudriere] (needed shared library changed)
The operation will free 1 MiB.
16 MiB to be downloaded.
Using
pkg upgrade -r poudriere
Show me this:
Updating poudriere repository catalogue...
poudriere repository is up-to-date.
All repositories are up-to-date.
Checking for upgrades (46 candidates): 100%
Processing candidates (46 candidates): 100%
The following 22 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
libdvdcss: 1.3.99 [poudriere]
Installed packages to be UPGRADED:
png: 1.6.20 -> 1.6.21 [poudriere]
pciids: 20151224 -> 20160116 [poudriere]
libgpg-error: 1.20_1 -> 1.21 [poudriere]
awesome: 3.5.6,1 -> 3.5.8,1 [poudriere]
Installed packages to be REINSTALLED:
xvid-1.3.4,1 [poudriere] (options changed)
x265-1.8 [poudriere]
nettle-3.2 [poudriere]
mpv-0.15.0,1 [poudriere] (needed shared library changed)
libx264-0.144.2533_1 [poudriere] (options changed)
libdvdread-5.0.3 [poudriere] (options changed)
libdrm-2.4.65_1,1 [poudriere] (options changed)
libass-0.13.1 [poudriere]
libarchive-3.1.2_6,1 [poudriere]
lame-3.99.5_3 [poudriere]
jsoncpp-0.6.0.r2_2 [poudriere]
harfbuzz-1.1.3 [poudriere]
gnutls-3.3.17.1_2 [poudriere]
ffmpeg-2.8.6,1 [poudriere] (options changed)
enca-1.18 [poudriere]
curl-7.47.0 [poudriere] (options changed)
cmake-3.4.2 [poudriere] (needed shared library changed)
The process will require 286 KiB more space.
24 MiB to be downloaded.
Pkg version is:
1.6.3
And the configuration for pkg is:
Version : 1.6.3
PKG_DBDIR = "/var/db/pkg";
PKG_CACHEDIR = "/var/cache/pkg";
PORTSDIR = "/usr/ports";
INDEXDIR = "";
INDEXFILE = "INDEX-10";
HANDLE_RC_SCRIPTS = false;
DEFAULT_ALWAYS_YES = false;
ASSUME_ALWAYS_YES = false;
REPOS_DIR [
"/etc/pkg/",
"/usr/local/etc/pkg/repos/",
]
PLIST_KEYWORDS_DIR = "";
SYSLOG = true;
ABI = "FreeBSD:10:amd64";
ALTABI = "freebsd:10:x86:64";
DEVELOPER_MODE = false;
VULNXML_SITE = "http://vuxml.freebsd.org/freebsd/vuln.xml.bz2";
FETCH_RETRY = 3;
PKG_PLUGINS_DIR = "/usr/local/lib/pkg/";
PKG_ENABLE_PLUGINS = true;
PLUGINS [
]
DEBUG_SCRIPTS = false;
PLUGINS_CONF_DIR = "/usr/local/etc/pkg/";
PERMISSIVE = false;
REPO_AUTOUPDATE = true;
NAMESERVER = "";
HTTP_USER_AGENT = "pkg/1.6.3";
EVENT_PIPE = "";
FETCH_TIMEOUT = 30;
UNSET_TIMESTAMP = false;
SSH_RESTRICT_DIR = "";
PKG_ENV {
}
PKG_SSH_ARGS = "";
DEBUG_LEVEL = 0;
ALIAS {
all-depends = "query %dn-%dv";
annotations = "info -A";
build-depends = "info -qd";
cinfo = "info -Cx";
comment = "query -i \"%c\"";
csearch = "search -Cx";
desc = "query -i \"%e\"";
download = "fetch";
iinfo = "info -ix";
isearch = "search -ix";
prime-list = "query -e '%a = 0' '%n'";
leaf = "query -e '%#r == 0' '%n-%v'";
list = "info -ql";
noauto = "query -e '%a == 0' '%n-%v'";
options = "query -i \"%n - %Ok: %Ov\"";
origin = "info -qo";
provided-depends = "info -qb";
raw = "info -R";
required-depends = "info -qr";
roptions = "rquery -i \"%n - %Ok: %Ov\"";
shared-depends = "info -qB";
show = "info -f -k";
size = "info -sq";
}
CUDF_SOLVER = "";
SAT_SOLVER = "";
RUN_SCRIPTS = true;
CASE_SENSITIVE_MATCH = false;
LOCK_WAIT = 1;
LOCK_RETRIES = 5;
SQLITE_PROFILE = false;
WORKERS_COUNT = 0;
READ_LOCK = false;
PLIST_ACCEPT_DIRECTORIES = false;
IP_VERSION = 0;
AUTOMERGE = true;
VERSION_SOURCE = "";
CONSERVATIVE_UPGRADE = true;
PKG_CREATE_VERBOSE = false;
AUTOCLEAN = false;
DOT_FILE = "";
REPOSITORIES {
}
VALID_URL_SCHEME [
"pkg+http",
"pkg+https",
"https",
"http",
"ftp",
"file",
"ssh",
]
Repositories:
FreeBSD: {
url : "pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/quarterly",
enabled : yes,
priority : 0,
mirror_type : "SRV",
signature_type : "FINGERPRINTS",
fingerprints : "/usr/share/keys/pkg"
}
poudriere: {
url : "http://localhost/packages/10x64-default",
enabled : yes,
priority : 100
}
I'm seeing this issue as well, FreeBSD 12.0-RELEASE-p3, pkg 1.10.5.
I've added a branch to my fork that demonstrates the problem here, that priorities are ignored for dependencies: https://github.com/kevans91/pkg/tree/dep_pri -> in both cases of the new test, one would expect that pkgA and its dependency pkgB would be pulled from the higher priority repo (i.e. the same repo). I've not yet begun to actually look at what it would take to fix this.
I'm not actually sure this is still correct. My previous response was unfortunately positioned just after 3ba48885a9e991, which broke this again. Backing up one step before revealed that my test was functional prior to that, but I'm afraid going too far back requires more and more effort to bisect.
3ba48885a9e991 was reverted by c6317d5bc531c1e1cf49d, and my test has succeeded since then.