Overwrite FreeBSD ports

Upgrade ports is easy, using portupgrade. Even portupgrade can upgrade it’s own program 🙂

The problem come with error message ‘xxxx already installed’, how to overcome this problem?

Answer: read the guide 🙂

kongja# portupgrade p5-libwww-5.79_1

—> Upgrading ‘p5-libwww-5.79_1’ to ‘p5-libwww-5.803’ (www/p5-libwww)
—> Building ‘/usr/ports/www/p5-libwww’
===> Cleaning for p5-Compress-Zlib-1.33
bla…bla..bla

===> Checking if net/p5-URI already installed
===> p5-URI-1.35 is already installed
You may wish to “make deinstall” and install this port again
“make reinstall” to upgrade it properly.
If you really wish to overwrite the old port of net/p5-URI
without deleting it first, set the variable “FORCE_PKG_REGISTER”
in your environment or the “make install” command line.
*** Error code 1
Stop in /usr/ports/net/p5-URI.
*** Error code 1
Stop in /usr/ports/www/p5-libwww.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade30900.0 make
** Fix the problem and try again.
** Listing the failed packages (*:skipped / !:failed)
! www/p5-libwww (p5-libwww-5.79_1) (unknown build error)
—> Packages processed: 0 done, 0 ignored, 0 skipped and 1 failed

wow, check if the ports already installed

kongja# pkg_info | grep p5-URI

p5-URI-1.35 Perl5 interface to Uniform Resource Identifier (URI) refere
ouch, its real the ports aleady installed
try edit make file

kongja# cd /usr/ports/www/p5-libwww/
kongja# ee Makefile

found this stuff :
BUILD_DEPENDS= ${SITE_PERL}/URI.pm:${PORTSDIR}/net/p5-URI \
${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \
${SITE_PERL}/${PERL_ARCH}/Compress/Zlib.pm:${PORTSDIR}/archivers/p5-Compress-Zlib
{SITE_PERL}/${PERL_ARCH}/MIME/Base64.pm:${PORTSDIR}/converters/p5-MIME-Base64 \
${SITE_PERL}/Net/FTP.pm:${PORTSDIR}/net/p5-Net \
${SITE_PERL}/${PERL_ARCH}/HTML/Parser.pm:${PORTSDIR}/www/p5-HTML-Parser
RUN_DEPENDS= ${BUILD_DEPENDS}

try to edit after making backup first

kongja# cp Makefile Makefile_old
kongja# ee Makefile
coba lagi portupgrade
kongja# portupgrade p5-libwww-5.79_1

still same error message

after reading and bit googling, this command issued :

kongja# portupgrade -m FORCE_PKG_REGISTER=1 p5-libwww-5.79_1

……
………………
……………………..
===> Cleaning for p5-HTML-Tagset-3.04
===> Cleaning for p5-libwww-5.803
—> Cleaning out obsolete shared libraries
[Updating the pkgdb
in /var/db/pkg … – 106 packages found (-0 +1) . done]

-m = option for ports, in this case FORCE_PKG_REGISTER=1

read…read 🙂