Solved Ruby21 libyaml issue

Trying to update Ruby to address security issue, update fails on libyaml dependency. Although it declares that libyaml.so is not found - it does exist in /usr/local/lib

I don't see anything helpful in UPDATING - is the Ruby port at fault here?
 
Please post the entire error you're getting. And it would be good to know what the current, installed, versions are of the packages that are causing the problem.
 
Code:
===>  ruby-2.1.6,1 depends on package: libffi>=0 - found
===>  ruby-2.1.6,1 depends on package: libedit>=0 - found
===>  ruby-2.1.6,1 depends on file: /usr/local/bin/autoconf-2.69 - found
===>  ruby-2.1.6,1 depends on shared library: libyaml.so - not found
===>  Verifying for libyaml.so in /usr/ports/textproc/libyaml
===>  Installing for libyaml-0.1.6_2
===>  Checking if libyaml already installed
===>  libyaml-0.1.6_2 is already installed
  You may wish to ``make deinstall'' and install this port again
  by ``make reinstall'' to upgrade it properly.
  If you really wish to overwrite the old port of libyaml
  without deleting it first, set the variable "FORCE_PKG_REGISTER"
  in your environment or the "make install" command line.
*** [check-already-installed] Error code 1
Code:
caleaw03# pkg info libyaml
libyaml-0.1.6_2

caleaw03# pkg info ruby
ruby-2.1.5_4,1
 
FORCE_PKG_REGISTER the next...

I don't really understand why the follow lines in /usr/ports/Mk/bsd.port.mk not changed:

Code:
3591 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
  3592 check-already-installed:
  3593  @${ECHO_MSG} "===>  Checking if ${PKGBASE} already insta  3593 lled"; \
  3594  pkgname=`${PKG_INFO} -q -O ${PKGBASE}`; \
  3595  if [ -n "$${pkgname}" ]; then \
  3596  v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
  3597  if [ "$${v}" = "<" ]; then \
  3598  ${ECHO_CMD} "===>  An older version of  3598 ${PKGBASE} is already installed ($${pkgname})"; \
  3599  else \
  3600  ${ECHO_CMD} "===>  ${PKGNAME} is alread  3600 y installed"; \
  3601  fi; \
  3602  ${ECHO_MSG} "  You may wish to \`\`make dein  3602 stall'' and install this port again"; \
  3603  ${ECHO_MSG} "  by \`\`make reinstall'' to up  3603 grade it properly."; \
  3604  ${ECHO_MSG} "  If you really wish to overwri  3604 te the old port of ${PKGBASE}"; \
  3605  ${ECHO_MSG} "  without deleting it first, se  3605 t the variable \"FORCE_PKG_REGISTER\""; \
  3606  ${ECHO_MSG} "  in your environment or the \"  3606 make install\" command line."; \
  3607  exit 1; \
  3608  fi
  3609 .endif
  3610 .endif

Not to exit, but to query if it should deinstall and reinstall. And add some lines, so it do it after the query (automatically) or exit. Possibly with an other warning.
 
Last edited:
FORCE_PKG_REGISTER the next...

I don't really understand why the follow lines in /usr/ports/Mk/bsd.ports.mk not changed:

Code:
3591 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
  3592 check-already-installed:
  3593  @${ECHO_MSG} "===>  Checking if ${PKGBASE} already insta  3593 lled"; \
  3594  pkgname=`${PKG_INFO} -q -O ${PKGBASE}`; \
  3595  if [ -n "$${pkgname}" ]; then \
  3596  v=`${PKG_VERSION} -t $${pkgname} ${PKGNAME}`; \
  3597  if [ "$${v}" = "<" ]; then \
  3598  ${ECHO_CMD} "===>  An older version of  3598 ${PKGBASE} is already installed ($${pkgname})"; \
  3599  else \
  3600  ${ECHO_CMD} "===>  ${PKGNAME} is alread  3600 y installed"; \
  3601  fi; \
  3602  ${ECHO_MSG} "  You may wish to \`\`make dein  3602 stall'' and install this port again"; \
  3603  ${ECHO_MSG} "  by \`\`make reinstall'' to up  3603 grade it properly."; \
  3604  ${ECHO_MSG} "  If you really wish to overwri  3604 te the old port of ${PKGBASE}"; \
  3605  ${ECHO_MSG} "  without deleting it first, se  3605 t the variable \"FORCE_PKG_REGISTER\""; \
  3606  ${ECHO_MSG} "  in your environment or the \"  3606 make install\" command line."; \
  3607  exit 1; \
  3608  fi
  3609 .endif
  3610 .endif

Not to exit, but to query if it should deinstall and reinstall. And add some lines, so it do it after the query (automatically) or exit. Possibly with an other warning.
talsamon, there's really no need to use FORCE_PKG_REGISTER or edit Makefiles and such.

You should be able to fix this issue by running # pkg delete -f libyaml-0.1.6_2 and then updating again. textproc/libyaml will be pulled in an installed as a dependency when lang/ruby21 is updated. If this doesn't work, there is a different problem and we can go from there.
 
protocelt I have no problem with textproc/libyaml. But I don't understand, that port-system could not do it, like I write before. In this case port-system wouldn't do anything other as the user - deinstall and reinstall the specific port - but nearly automatically.
 
protocelt I have no problem with textproc/libyaml. But I don't understand, that port-system could not do it, like I write before. In this case port-system wouldn't do anything other as the user - deinstall and reinstall the specific port - but nearly automatically.
Because it's an error. And because the port should detect its already installed. So something went wrong somewhere. Sure, you can waltz right over it but that doesn't change the fact that there's something wrong. The mantra is, fix the issue not the symptoms.
 
What you do if this error appears. You deinstall and reinstall in the port, for me that's ever solved it. Where should be the error? The only error is, there a existing dependencies, and they are fixed with the reinstall.
Is it really so hard to understood what I want. If I could fix it with reinstall, the port-system can do it.
It's not a problem, if you compile three or four ports, but it is if you install a bulk of ports. If you work with portmaster, and it interrupts it never starts from this point again. It compiles ports, it has compiled just before. It is double work, or sometimes more of this. I only try to prevent portmaster to interrupt (senseless).
(And why there is a function or command like FORCE_PKG_REGISTER or make reinstall nobody should use. If it is so, remove it from the error-message, and write it only - as last possibility - in the handbook).
 
For the sake of argument, I did a portsnap fetch update and tried again:
Code:
===>>> The following actions will be taken if you choose to proceed:
   Upgrade ruby-2.1.5_4,1 to ruby-2.1.6,1
   Upgrade pkg-1.4.12 to pkg-1.5.0
   Re-install ruby21-bdb-0.6.6_4
Unfortunately, it still seems unable to reconcile the libyaml issue. I agree that there might be workarounds, but as SirDice pointed out, this does indicate an issue and a root cause fix is required.
Code:
===>  ruby-2.1.6,1 depends on package: libffi>=0 - found
===>  ruby-2.1.6,1 depends on package: libedit>=0 - found
===>  ruby-2.1.6,1 depends on file: /usr/local/bin/autoconf-2.69 - found
===>  ruby-2.1.6,1 depends on shared library: libyaml.so - not found
===>  Verifying for libyaml.so in /usr/ports/textproc/libyaml
===>  Installing for libyaml-0.1.6_2
===>  Checking if libyaml already installed
===>  libyaml-0.1.6_2 is already installed
  You may wish to ``make deinstall'' and install this port again
  by ``make reinstall'' to upgrade it properly.
  If you really wish to overwrite the old port of libyaml
  without deleting it first, set the variable "FORCE_PKG_REGISTER"
  in your environment or the "make install" command line.
*** [check-already-installed] Error code 1

Stop in /usr/ports/textproc/libyaml.
*** [lib-depends] Error code 1

Stop in /usr/ports/lang/ruby21.
*** [build] Error code 1

Stop in /usr/ports/lang/ruby21.

===>>> make build failed for lang/ruby21
===>>> Aborting update

===>>> Update for ruby-2.1.5_4,1 failed
===>>> Aborting update
 
Full disclosure - I did also try to remove libyaml and let it get rebuilt along with the Ruby update - that also fails.
 
Hi,

I just updated my system and didn't run into this problem when updating lang/ruby21. Could you please show the output of # pkg -BCa on your system? Also just to cover the bases, did you follow entry #20150301 in /usr/ports/UPDATING?
 
Hmm, it's not really clear to me what's going on here. Do you have anything that may possibly be relevant to this in your make.conf file?
 
Not that this adds a whole lot of useful information, but I am getting this exact behaviour on many hosts presently. So, at least in this environment, it is not a singular issue.

Bit of a head-scratcher.
 
I have not been through all hosts yet, but this might be related to concurrent installs of ruby20 and ruby21, so what I am doing which seems to fix the issue is:

  • Remove Ruby entry from make.conf
  • Deinstall ruby20
  • Deinstall ruby21
  • Deinstall libyaml
  • Deinstall libexecinfo
  • do a make && make install && make clean for ruby21
  • make deinstall / make reinstall for db5
  • Followup with portmaster -R -r ruby-2.1
 
Last edited by a moderator:
This makes sense, and may have been apparent by looking at the entry in your make.conf file. It suggests at least to me as well that the instructions in /usr/ports/UPDATING entry #20150301 wasn't followed or at least not completely followed, which should have prevented this problem. You may of course have had a reason/need for doing things this way but it wasn't apparent from the information provided here. Anyway, hopefully the solution you've found works and the issue is fixed. :)
 
Back
Top