Broken ports via upgrade

I just broke a few things on my 10.0 install due to being lazy and not reading /usr/ports/UPDATING. Definitely learned my lesson, but now I need some help getting everything back to par.

The problem started when I ran pkg audit and saw that I need to patch something. Unfortunately I ran portmaster before checking the update file instructions and the update of the insecure port (I believe it was freetype?) quickly died when it needed to update devel/gettext. I now have a lot of broken dependencies I believe because when I try to run sudo it complains of a missing library. I have pasted the bulk of the shell history below for some context and will be happy to provide more details. In the past when I have foolishly ignored the updating file I was able to resolve by running libchk and then uninstalling and reinstalling the affected packages/ports. However since I can no longer run sudo and since it appears that libchk is no longer installed/supported (correct?) I am unable to proceed.

I tried booting to single-user mode however something is not as expected. I have two disks via a RAID 1 ZFS with disK encryption. When I boot into multi-user mode it asks twice for the passphrase (one time for each disk). Right now when booting into single-user mode it only asks one time and then mounts as read-only.

Any help is greatly appreciated. Thanks.


Code:
====> Compressing man pages (compress-man)
===>>> Starting check for runtime dependencies
===>>> Gathering dependency list for devel/gettext-runtime from ports
===>>> Dependency check complete for devel/gettext-runtime

===>>> freetype2-2.5.3 >> gmake-4.1 >> devel/gettext-runtime (2/4)

===>  Installing for gettext-runtime-0.19.3
===>  Checking if gettext-runtime already installed
===>  Registering installation for gettext-runtime-0.19.3 as automatic
pkg-static: gettext-runtime-0.19.3 conflicts with gettext-0.18.3.1_1 (installs files into the same place).  Problematic file: /usr/local/bin/envsubst
*** Error code 70

Stop.
make: stopped in /usr/ports/devel/gettext-runtime

===>>> Installation of gettext-runtime-0.19.3 (devel/gettext-runtime) failed
===>>> Aborting update

===>>> Update for devel/gettext-runtime failed
===>>> Aborting update

===>>> Update for gmake-4.1 failed
===>>> Aborting update

===>>> Killing background jobs
Terminated

===>>> You can restart from the point of failure with this command line:
  portmaster <flags> print/freetype2 devel/gmake devel/gettext-runtime devel/gettext-tools textproc/expat2

===>>> Exiting
mercury% sudo pkg remove gettext*
zsh: no matches found: gettext*
mercury% sudo pkg remove gettext
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 27 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
   gettext-0.18.3.1_1
   sudo-1.8.9.p5 (depends on gettext-0.18.3.1_1)
   shared-mime-info-1.1 (depends on gettext-0.18.3.1_1)
   gtk-update-icon-cache-2.24.22 (depends on gettext-0.18.3.1_1)
   gtk2-2.24.22_1 (depends on gettext-0.18.3.1_1)
   vim-7.4.192_1 (depends on gettext-0.18.3.1_1)
   lynx-2.8.7.2,1 (depends on gettext-0.18.3.1_1)
   glib-2.36.3_2 (depends on gettext-0.18.3.1_1)
   irssi-0.8.15_6 (depends on gettext-0.18.3.1_1)
   atk-2.8.0 (depends on gettext-0.18.3.1_1)
   cairo-1.10.2_7,2 (depends on gettext-0.18.3.1_1)
   harfbuzz-0.9.25_1 (depends on gettext-0.18.3.1_1)
   pango-1.34.1_1 (depends on gettext-0.18.3.1_1)
   gdk-pixbuf2-2.28.2 (depends on gettext-0.18.3.1_1)
   python27-2.7.6_4 (depends on gettext-0.18.3.1_1)
   python2-2_2 (depends on gettext-0.18.3.1_1)
   python-2.7_1,2 (depends on gettext-0.18.3.1_1)
   tdb-1.2.12,1 (depends on gettext-0.18.3.1_1)
   samba36-smbclient-3.6.22 (depends on gettext-0.18.3.1_1)
   talloc-2.0.8 (depends on gettext-0.18.3.1_1)
   tevent-0.9.18 (depends on gettext-0.18.3.1_1)
   p5-Locale-gettext-1.05_3 (depends on gettext-0.18.3.1_1)
   help2man-1.43.3_1 (depends on gettext-0.18.3.1_1)
   gmake-4.1 (depends on gettext-0.18.3.1_1)
   bison-2.7.1,1 (depends on gettext-0.18.3.1_1)
   libidn-1.29 (depends on gettext-0.18.3.1_1)
   wget-1.16 (depends on gettext-0.18.3.1_1)

The operation will free 197 MB.

Proceed with deinstalling packages? [y/N]: n 
mercury% sudo pkg remove gettext-runtime
Checking integrity... done (0 conflicting)
Package(s) not found!
mercury% sudo pkg install gettext-runtime
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%  944 B  0.9k/s  00:01 
Fetching digests.txz: 100%  2 MB  2.1M/s  00:01 
Fetching packagesite.txz: 100%  5 MB  5.3M/s  00:01 
Removing expired repository entries: 100%
Processing new repository entries: 100%
FreeBSD repository update completed. 23741 packages processed:
  23173 updated, 230 removed and 395 added.
The following 1 packages will be affected (of 0 checked):

New packages to be INSTALLED:
   gettext-runtime: 0.19.3

The process will require 783 KB more space.
144 KB to be downloaded.

Proceed with this action? [y/N]: y
Fetching gettext-runtime-0.19.3.txz: 100%  144 KB 147.2k/s  00:01 
Checking integrity... done (1 conflicting)
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 4 packages will be affected (of 0 checked):

New packages to be INSTALLED:
   gettext-runtime: 0.19.3
   gettext-tools: 0.19.3

Installed packages to be UPGRADED:
   gettext: 0.18.3.1_1 -> 0.19.3

The process will require 161 KB more space.
2 MB to be downloaded.

Proceed with this action? [y/N]: y
Fetching gettext-0.19.3.txz: 100%  496 B  0.5k/s  00:01 
Fetching gettext-tools-0.19.3.txz: 100%  2 MB  2.1M/s  00:01 
[1/4] Deleting gettext-0.18.3.1_1: 100%
[2/4] Installing gettext-runtime-0.19.3: 100%
[3/4] Installing gettext-tools-0.19.3: 100%
pkg: unlinkat(usr/local/lib/libasprintf.la): No such file or directory
pkg: unlinkat(usr/local/lib/libgettextlib-0.18.3.so): No such file or directory
pkg: unlinkat(usr/local/lib/libgettextlib.la): No such file or directory
pkg: unlinkat(usr/local/lib/libgettextpo.la): No such file or directory
pkg: unlinkat(usr/local/lib/libgettextpo.so.5): No such file or directory
pkg: unlinkat(usr/local/lib/libgettextsrc-0.18.3.so): No such file or directory
pkg: unlinkat(usr/local/lib/libgettextsrc.la): No such file or directory
pkg: unlinkat(usr/local/lib/libintl.la): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/csharpdoc/GNU_Gettext.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/csharpdoc/GNU_Gettext_GettextResourceManager.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/csharpdoc/GNU_Gettext_GettextResourceSet.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/csharpdoc/begin.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/csharpdoc/index.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/csharpdoc/namespaces.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/csharpcomp.m4): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/csharpcomp.sh.in): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/csharpexec-test.exe): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/csharpexec.m4): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/csharpexec.sh.in): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/gcj.m4): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/javacomp.m4): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/javacomp.sh.in): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/javaexec.m4): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/examples/build-aux/javaexec.sh.in): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/allclasses-frame.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/deprecated-list.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/gnu/gettext/GettextResource.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/gnu/gettext/package-frame.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/gnu/gettext/package-summary.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/gnu/gettext/package-tree.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/help-doc.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/index-all.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/index.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/overview-tree.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/package-list): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/packages.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/serialized-form.html): No such file or directory
pkg: unlinkat(usr/local/share/doc/gettext/javadoc2/stylesheet.css): No such file or directory
pkg: unlinkat(usr/local/share/doc/libasprintf/autosprintf_all.html): No such file or directory
pkg: unlinkat(usr/local/share/gettext/intl/ChangeLog): No such file or directory
[4/4] Upgrading gettext from 0.18.3.1_1 to 0.19.3: 100%
mercury% sudo portmaster freetype 
Shared object "libintl.so.9" not found, required by "sudo"
 
I'm not saying sudo is a bad thing, just that su could be used since the OP mentioned that sudo wasn't working at the moment.
 
As for the read only, that's standard. Generally, one then runs mount -urw /; mount -a. Hopefully, that will solve your issue of it being read only.

I do recollect an entry in UPDATING about gettext and that while fixing it, sudo would break, so, assuming you can get back into the system, (and haven't yet found the problem) look for a very recent entry about gettext. (Sorry, writing this from a CentOS machine so can't give you the exact date).
 
Thanks SirDice. Where do I do that though? Should I do that from the bootloader menu or just run that directly in single-user mode?

As for the sudo advice, thanks but I have root login disabled so the first thing I need to do is get my disks mounted in r/w mode.

Does anyone know of a good utility I should use to check broken dependencies? libchk had served me well on an 8.x system but not sure what is recommended for 10.x.

Thanks
 
Thanks SirDice. Where do I do that though? Should I do that from the bootloader menu or just run that directly in single-user mode?
If you boot a ZFS system to single user mode the filesystem will be read-only. Similar to an UFS system. The commands to enable write access are slightly different however. You'd use the commands mentioned by scottro for UFS and the zfs set readonly=off command for ZFS.

Does anyone know of a good utility I should use to check broken dependencies? libchk had served me well on an 8.x system but not sure what is recommended for 10.x.
Try pkg check -Ba first, this will check libraries. There's also pkg check -da which will check all package dependencies. Those two usually work for me.
 
Hi,

SOLVED - realized pkg remove gettext-runtime needed the entire name. Ran #pkg remove gettext-0.18.3.1

Followed by # portmaster freetype libxml2
Code:
.
===>>> The following actions were performed:
   Installation of devel/gettext-runtime (gettext-runtime-0.19.3)
   Upgrade of expat-2.1.0 to expat-2.1.0_2
   Installation of devel/gettext-tools (gettext-tools-0.19.3)
   Installation of devel/gmake (gmake-4.1_1)
   Upgrade of freetype2-2.5.3 to freetype2-2.5.4
   Installation of devel/pkgconf (pkgconf-0.9.7)
   Upgrade of libxml2-2.8.0_3 to libxml2-2.9.2_2

Below is BEFORE the fix above.

I tried what SirDice wrote, pkg check -Ba then pkg check -da. Did not fix the problem. Tried mv envsubst envsubst.old in /usr/local/bin and no help either. Pormaster complains about installing in the same location.

Tried pkg install gettext-runtime
Code:
->
Checking integrity...Assertion failed: (pkgdb_ensure_loaded(j->db, p2, PKG_LOAD_FILES|PKG_LOAD_DIRS) == EPKG_OK), function pkg_conflicts_need_conflict, file pkg_jobs_conflicts.c, line 211.
Child process pid=52843 terminated abnormally: Abort trap: 6

Code:
# portmaster freetype libxml2
.
.
.

Installing gettext-runtime-0.19.3...
pkg-static: gettext-runtime-0.19.3 conflicts with gettext-0.18.3.1 (installs files into the same place).  Problematic file: /usr/local/bin/envsubst
*** [fake-pkg] Error code 70
 
20141130:
AFFECTS: users of devel/gettext (close to everyone)
AUTHOR: tijl@FreeBSD.org

The devel/gettext port has been split up in devel/gettext-runtime, a
lightweight package containing runtime libraries, and devel/gettext-tools,
a package containing developer tools. The devel/gettext port still exists
as a metaport.

You must first delete the existing installation of gettext and then
reinstall it. This will break sudo, so you *must* do this in a root
shell (sudo -i) if you use sudo.

# pkg delete -f gettext
# portmaster devel/gettext

Or for portupgrade users:

# pkg delete -f gettext
# portinstall devel/gettext

Or for binary users:

# pkg delete -f gettext
# pkg upgrade
 
I found the same problem (same get text error 70) while iI was installing xorg. I solved it with this line:
# pkg remove gettext-runtime
 
Back
Top