# pkg-static upgrade -f  pkg fails with Abort trap



## ProServ (Sep 21, 2020)

Hi, after running FreeBSD-update install (to get to 12.1-RELEASE), then running *pkg-static upgrade -f  *pkg fails....

Running "pkg bootstrap -f" recommended
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (488 candidates):   7%
ruby24 has no direct installation candidates, change it to ruby? [Y/n]: y
Checking for upgrades (488 candidates): 100%
Processing candidates (488 candidates): 100%
pkg-static: sqlite error while executing UPDATE packages SET name=?1  WHERE name=?2; in file pkg_jobs.c:1734: UNIQUE constraint failed: packages.name
Checking integrity...Assertion failed: (strcmp(uid, p->uid) != 0), function pkg_conflicts_check_local_path, file pkg_jobs_conflicts.c, line 386.
Child process pid=81813 terminated abnormally: Abort trap

Then tried the recommended  ..
# pkg bootstrap -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.14.6...
package pkg is already installed, forced install
Extracting pkg-1.14.6: 100%
#

Re-run # pkg-static upgrade -f
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
Checking for upgrades (488 candidates):   7%
ruby24 has no direct installation candidates, change it to ruby? [Y/n]: Y
Checking for upgrades (488 candidates): 100%
Processing candidates (488 candidates): 100%
pkg-static: sqlite error while executing UPDATE packages SET name=?1  WHERE name=?2; in file pkg_jobs.c:1734: UNIQUE constraint failed: packages.name
Checking integrity...Assertion failed: (strcmp(uid, p->uid) != 0), function pkg_conflicts_check_local_path, file pkg_jobs_conflicts.c, line 386.
Child process pid=81843 terminated abnormally: Abort trap

How to get past this?
Thanks.


----------



## a6h (Sep 21, 2020)

`pkg-static update -f`


----------



## ProServ (Sep 22, 2020)

Hi Vigole, 
that worked to fix pkg .. thanks.
Ran #portmaster -af --packages 
that ends up removing pkg and of course it just keeps failing.


----------



## a6h (Sep 22, 2020)

ProServ I'm happy to here!! hear that. On portmaster: unfortunately I'm not familiar with that utility.


----------



## Mjölnir (Sep 22, 2020)

The name port_master_ is misleading.  Don't use it, it's broken...  Please see this thread & the related Howto build ports with ports-mgmt/poudriere & the mini-FAQ.

ports-mgmt/synth is a reasonable alternative to ports-mgmt/poudriere.
It is ok to use ports-mgmt/portmaster (or just run `make` from inside the ports tree) for ports with very few or no dependencies at all (scripts), but building a large number of ports on the host (un-jail(8)'ed) is just asking for trouble.


----------



## ProServ (Sep 22, 2020)

After upgrading to 12.1 the system has problems. For example, trying to install (pkg install vim) will produce stop in colord. 

[1/1] Installing colord-1.3.5...
===> Creating groups.
Using existing group 'colord'.
===> Creating users
Creating user 'colord' with uid '970'.
pw: user 'colord' disappeared during update
pkg: PRE-INSTALL script failed

# vipw
vipw: pw_edit(): No such file or directory

Any idea's are welcome.
Thanks.


----------



## a6h (Sep 22, 2020)

Run `/usr/sbin/pwd_mkdb -p /etc/master.passwd` and also check that `$EDITOR` is set to vi: run `echo $EDITOR`


----------



## ProServ (Sep 22, 2020)

That really helped. Thank you.


----------



## Mjölnir (Sep 23, 2020)

If you don't like vi(1), you may find ee(1) (easy editor), edit(1) (the same), editors/aee or editors/nano more user-friendly & put that into the EDITOR environment variable (in login.conf(5) or /etc/csh.cshrc).


----------

