10.1-RELEASE -> ezjail + portmaster - issues with upgrades

Hello,

lately I have issues with upgrades with portmaster within the jail. I didn't had any issues on the same machine but without jail, but I do not have as many ports installed there as within my jails.

Almost daily I'm having issues, always with the same message:

Code:
===> <port> 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 <port>
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.

It's sometimes: textproc/libxml2 or devel/pcre or devel/gettext-runtime or textproc/expat2.

When I'm upgrading my ports I'm always checking the /usr/ports/UPDATING.

For example - I can't upgrade python, because it says that libffi is already installed. It fails even when I remove (by make deinstall from within port directory) and it installs it by itself as an dependency.

Code:
===>   libffi-3.2.1 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 libffi
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop.
make[3]: stopped in /basejail/usr/ports/devel/libffi
*** Error code 1

Stop.
make[2]: stopped in /basejail/usr/ports/devel/libffi
*** Error code 1

Stop.
make[1]: stopped in /basejail/usr/ports/lang/python27
*** Error code 1

Stop.
make: stopped in /basejail/usr/ports/lang/python27

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

===>>> Update for lang/python27 failed
===>>> Aborting update

===>>> The following actions were performed:
        Installation of devel/libffi (libffi-3.2.1)


===>>> You can restart from the point of failure with this command line:
       portmaster <flags> lang/python27

I can't find definite answer to my problem. I have even reinstalled ports-mgmt/portmaster, ran pkg2ng but none of these helps.

Any ideas what might be wrong?
 
Nothings wrong. Either you deinstall and reinstall the port(s) or you do make install clean FORCE_PKG_REGISTER=yes in the port.
 
I am also very unhappy with the stops of portmaster with the FORCE_PKG_REGISTER-Message. But I never figured out, why this happened.
 
If I am right, I think portmaster gets from the port
Code:
exit 1
. Needs a special return- oder exit-code to react right. (To know it's not any error and deinstall the port and reinstall it).

/usr/port/Mk/bsd.port.mk
Code:
3610  ${ECHO_MSG} "  You may wish to \`\`make deinstall'' and install this port again"; \
3611  ${ECHO_MSG} "  by \`\`make reinstall'' to upgrade it properly."; \
3612  ${ECHO_MSG} "  If you really wish to overwrite the old port of ${PKGBASE}"; \
3613  ${ECHO_MSG} "  without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
3614  ${ECHO_MSG} "  in your environment or the \"make install\" command line."; \
3615  exit 1; \
3616  fi

You see it gets
Code:
 exit 1
- means ANY error.
 
If I am right, I think portmaster gets from the port
Code:
exit 1
. Needs a special return- oder exit-code to react right. (To know it's not any error and deinstall the port and reinstall it).

/usr/port/Mk/bsd.port.mk
Code:
3610  ${ECHO_MSG} "  You may wish to \`\`make deinstall'' and install this port again"; \
3611  ${ECHO_MSG} "  by \`\`make reinstall'' to upgrade it properly."; \
3612  ${ECHO_MSG} "  If you really wish to overwrite the old port of ${PKGBASE}"; \
3613  ${ECHO_MSG} "  without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
3614  ${ECHO_MSG} "  in your environment or the \"make install\" command line."; \
3615  exit 1; \
3616  fi

You see it gets
Code:
 exit 1
- means ANY error.[/QUOTE
It's reacting to pkg delete failing because the port it's trying to delete is still required by other ports. The exit code 1 gets passed all the way up because it's not handled anywhere in between the pkg-delete(8) and portmaster(8)'s main loop.
 
Then that's the fault. Should not do pkg delete, but cd /usr/ports/category/portname && make deinstall clean.
Makes no difference portmaster do it or the user do it, or portmaster should ask if it should do it.
 
Then that's the fault. Should not do pkg delete, but cd /usr/ports/category/portname && make deinstall clean.
Makes no difference portmaster do it or the user do it, or portmaster should ask if it should do it.

The make deinstall command does the same actually, it just calls pkg delete on the installed port. It would be cleaner though if portmaster(8) didn't try to be too clever and use the knowledge of the ports internals to make shortcuts such as this one.
 
But it's a annoying issue, portmaster could do in this case, what the user at last has to do (In some cases it could save a lot of time).
 
In the other thread it was a problem with graphics/png. I also could not reproduce the error. But if the user could fix it with two simple commands, I think portmaster also can do it. It is not a problem if it is one port, but it is if you try recompile more ports recursively and the message appears more than one times.
 
I've never experienced any problems similar to described, I suspect it's local problem. However if there really is portmaster(8) problem, it should never be fixed by FORCE_PKG_REGISTER or make reinstall (which is the same as it uses FORCE_PKG_REGISTER internally).
 
I use portmaster routinely in jails, and have never needed to manually deinstall a port or use FORCE_PKG_REGISTER. Brute force can make immediate problems go away, but often results in long-term mysterious problems that are difficult to diagnose and cure.
 
Can't imagine that. With 9.3 portmaster often stops with this message. With 10.1 it is not so often. But if you recursively recompile, you can be sure it interrupts at least one time. Could anyone explain why this happened?. I don't understand. If I deinstall in the port and reinstall everything's okay. What's the difference, and why portmaster can't handle it. kpa wrote, make deinstall calls also pkg delete - this is not logical.
 
Well, I just tested that on another system (not within jail) and had no issues. Another step towards ezjail issue.
 
Something I've overlooked totally is that a port build now builds a package that is installed as an update or reinstallation of the port (you can tell I've used my own built binary packages only...). This is what allows make install to work even if the port is required by other installed ports. The crucial mechanism to enable this is the new staging system introduced some time ago.

To generic, can you post your /etc/make.conf from the jail where the build is failing if you have one.
 
With 9.3 portmaster often stops with this message. With 10.1 it is not so often. But if you recursively recompile, you can be sure it interrupts at least one time. Could anyone explain why this happened?

First guess: something is wrong with your system. You have posted many suggestions for overriding default behavior and forcing the system to do things in a nonstandard way. Doing things that way usually has repercussions sooner or later. If it were me, I would remove every custom setting possible from /etc/make.conf, then follow the portmaster procedure to get a list of installed ports, delete them all, then build them all. Rather than keep repeating those steps, I just created a thread for it: https://forums.freebsd.org/threads/rebuilding-all-ports-with-portmaster.51210/.
 
To generic, can you post your /etc/make.conf from the jail where the build is failing if you have one.

Sure, it's pretty generic ezjail /etc/make.conf:

Code:
WRKDIRPREFIX=  /var/ports
DISTDIR=  /var/ports/distfiles
PACKAGES=  /var/ports/packages
INDEXDIR=  /var/ports

As a test I have added:
Code:
WITH_PKGNG=YES
to it, even if it's not necessary, but that did not changed a thing (as expected).
 
Back
Top