# pkg install issue



## diddie17-1 (Jun 9, 2015)

Hi Guys,

I've searched and can't find anything relevant to help me solve this issue, although I might not have been searching in the right places.

When trying to install the xorg package I get an error:

```
pkg: sqlite error while executing UPDATE deps SET origin=?1, version=?2 WHERE name=?3; in file pkgdb.c:1669: UNIQUE constraint failed: deps.name, deps.version, deps.package_id
```
The issue is when installing docbook-xml-4.5, although I have uninstalled all docbook packages.  When I do a `pkg info` though I get -

```
docbook~pkg-renamed~09EE-4.1_4 V4.1 of the DocBook DTD, designed for technical documentation
docbook~pkg-renamed~3DC8-4.5_2 DocBook/SGML DTD V4.5, designed for technical documentation
docbook~pkg-renamed~4544-1.4   Meta-port for the different versions of the DocBook DTD
docbook~pkg-renamed~5164-4.4_2 DocBook/SGML DTD V4.4, designed for technical documentation
docbook~pkg-renamed~617E-5.0_1 DocBook 5.0, designed for technical documentation
docbook~pkg-renamed~859E-4.3   DocBook/SGML DTD V4.3, designed for technical documentation
docbook~pkg-renamed~871C-4.2   V4.2 of the DocBook DTD, designed for technical documentation
```
which I believe is what is causing the issue.

I have tried removing these doing for example:

```
pkg delete -f docbook~pkg-renamed~09EE-4.1_4
Checking integrity... done (0 conflicting)
Package(s) not found!
```
But the package is not found found.  Any ideas as to how to get rid of these packages so that I can get past this issue.

Thanks in advance.


----------



## kpa (Jun 9, 2015)

You should be able to use the -x option to make pkg(8) interpret the name as a regular expression:

`pkg delete -fx docbook*`


----------



## diddie17-1 (Jun 9, 2015)

Thanks for your quick help, that was fantastic and cleared the packages.

Unfortunately I was over optimistic about this being the issue, and it hasn't cleared the error.  I still get:

```
[137/169] Installing docbook-xml-4.5...
pkg: sqlite error while executing UPDATE deps SET origin=?1, version=?2 WHERE name=?3; in file pkgdb.c:1669: UNIQUE constraint failed: deps.name, deps.version, deps.package_id
DBG(1)[89871]> release an exclusive lock on a database
DBG(1)[89871]> release an advisory lock on a database
```
I'll keep looking, but any ideas in the meantime would be useful.  I spent several hours trying to find an issue that kpa answered in a few minutes.  Thanks kpa


----------



## kpa (Jun 9, 2015)

Try the usual first aid for these kinds of problems:

`# pkg update -f`

`# pkg check -aBds`

Answer yes if the second command asks to fix anything.


----------



## diddie17-1 (Jun 9, 2015)

Thanks for the quick reply again.  Lots of output, generally falling into 3 camps-

Regular duplicate dependencies around docbook.  For example -

```
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-xml-4.4_1, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-xml-4.3, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-xml-4.2_1, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.5_2, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.4_2, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.3, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.2, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.1_4, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-1.4, ignoring
```
Lots of checksum mismatches.  For example -

```
tiff-4.0.0_2: checksum mismatch for /usr/local/man/man3/TIFFVGetField.3tiff.gz
tiff-4.0.0_2: checksum mismatch for /usr/local/man/man3/TIFFVGetFieldDefaulted.3tiff.gz
```
Lots of No such file or directory errors such as -

```
pkg: fstat() failed for(/usr/local/lib/libx264.so.116): No such file or directory
pkg: fstat() failed for(/usr/local/share/licenses/x264-0.116.2076/GPLv2): No such file or directory
pkg: fstat() failed for(/usr/local/share/licenses/x264-0.116.2076/LICENSE): No such file or directory
```
The final summary looks like this -

```
>>> Missing package dependencies were detected.
>>> Found 19 issue(s) in the package database.

pkg: No packages available to install matching 'perl' have been found in the repositories
>>> Summary of actions performed:

perl dependency failed to be fixed
pkg-config dependency failed to be fixed
docbook-xsl dependency failed to be fixed
docbook-xml dependency failed to be fixed
docbook-sk dependency failed to be fixed
docbook dependency failed to be fixed
samba34-libsmbclient dependency failed to be fixed
gdk-pixbuf dependency failed to be fixed
libgee dependency failed to be fixed
apache dependency failed to be fixed
apr-ipv6-devrandom-gdbm-db42 dependency failed to be fixed
at-spi dependency failed to be fixed
opal3 dependency failed to be fixed
folks dependency failed to be fixed
libglut dependency failed to be fixed
p5-IO-Compress dependency failed to be fixed
xscreensaver-gnome-hacks dependency failed to be fixed
vte dependency failed to be fixed
avahi-gtk dependency failed to be fixed

>>> There are still missing dependencies.
>>> You are advised to try fixing them manually.
```
Ultimately though if I try to add the docbook package I still get the error -

```
Proceed with this action? [y/N]: y
[1/33] Installing docbook-2.4.1_1,1...
pkg: sqlite error while executing UPDATE deps SET origin=?1, version=?2 WHERE name=?3; in file pkgdb.c:1669: UNIQUE constraint failed: deps.name, deps.version, deps.package_id
```
I found the following thread which looks very similar -

https://github.com/freebsd/pkg/issues/1124

In that case they were talking about manipulating the pkg db using sqlite to remove the dependency -


> Solved by:
> sqlite> update deps set name='glib1' where origin='devel/glib12


and


> I deleted the offending docbook dep and it all worked fine.



I don't know how to update the pkg DB, but does this look like a reasonable solution?

Thanks


----------



## kpa (Jun 10, 2015)

What happens if you try to reinstall deskutils/superkaramba by force?

`# pkg install -f superkaramba`

Repeat that for the perl5 package.

You also follow this UPDATING entry about devel/pkg-config, it was replaced by devel/pkgconf a long time ago and is no longer required as a run-time dependency for anything:


```
20120726:
  AFFECTS: users of devel/pkg-config
  AUTHOR: bapt@FreeBSD.org

  devel/pkg-config has been replaced by devel/pkgconf

  # portmaster -o devel/pkgconf devel/pkg-config
    or
  # portupgrade -fo devel/pkgconf pkg-config-\*

  pkgng:
  # pkg set -o devel/pkg-config:devel/pkgconf
  # pkg install -f devel/pkgconf
```


----------



## diddie17-1 (Jun 10, 2015)

I've been playing with it a bit more today in spare time.

Unfortunately the superkaramba install didn't work.  Lots of errors around duplicate dependency for docbook again and some for missing dependency for perl (even after having installed perl5 as suggested)

The end of the listing which is probably the most important bit says -

```
pkg: json-glib has a missing dependency: perl
pkg: gtk-engines2 has a missing dependency: perl
pkg: gio-fam-backend has a missing dependency: perl
pkg: glibmm has a missing dependency: perl
pkg: desktop-file-utils has a missing dependency: perl
pkg: libgtop has a missing dependency: perl
pkg: cairomm has a missing dependency: perl
pkg: py27-orbit has a missing dependency: perl
pkg: atkmm has a missing dependency: perl
pkg: gstreamer-plugins-core has a missing dependency: perl
pkg: gstreamer-plugins-pango has a missing dependency: perl
pkg: pango has a missing dependency: perl
pkg: p5-Encode-Locale has a missing dependency: perl
pkg: gtk has a missing dependency: perl
pkg: p5-Text-Iconv has a missing dependency: perl
pkg: p5-Locale-gettext has a missing dependency: perl
pkg: help2man has a missing dependency: perl
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-xml-4.4_1, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-xml-4.3, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-xml-4.2_1, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.5_2, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.4_2, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.3, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.2, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-4.1_4, ignoring
pkg: superkaramba-4.10.5: duplicate dependency listing: docbook-1.4, ignoring
pkg: Cannot solve problem using SAT solver:
dependency rule: package kdeutils(l) depends on: superkaramba(r)superkaramba(l)
dependency rule: package kde(l) depends on: superkaramba(r)superkaramba(l)
upgrade rule: upgrade local superkaramba-4.10.5 to remote superkaramba-4.10.5
cannot install package superkaramba, remove it from request? [Y/n]: y
pkg: cannot find superkaramba in the request
pkg: cannot solve job using SAT solver
```
Perl5 installed successfully tough, although missing dependencies for perl still seem to appear and the UPDATING instructions cleared the pkg-config issue.

I've still got the same issue though in that docbook will not install with 

```
[12/39] Installing docbook-2.4.1_1,1...
pkg: sqlite error while executing UPDATE deps SET origin=?1, version=?2 WHERE name=?3; in file pkgdb.c:1669: UNIQUE constraint failed: deps.name, deps.version, deps.package_id
```
Looking at UPDATING info though, I did find the following, not in the file, but through a google search. 

```
20140219:
AFFECTS: users of textproc/docbook*
AUTHOR: mat@FreeBSD.org

The textproc/docbook-* ports have been consolidated into two ports
textproc/docbook-sgml and textproc/docbook-xml.

Before upgrading you should force the removal of the existing ports, they
will conflict with the new ones.

pkg users can run:

pkg delete -f docbook-xml\* docbook-sk\* docbook\[2345\]\?\?-\* docbook-4\*

the other users can run:

pkg_delete -f docbook-xml\* docbook-sk\* docbook\[2345\]\?\?-\* docbook-4\*
```
I've run the command, but get 0 packages to remove.

I'll keep going at it, but any further ideas would be greatly appreciated.

Thanks


----------



## e0je (Sep 18, 2015)

I resolved the textproc/docbook-xml installation issue by doing a `make delete` in each of the docbook ports, then reinstalling textproc/docbook.


----------

