Installing port - skip required port

Matthew Seaman m.seaman at
Tue May 4 02:36:38 PDT 2004

On Mon, May 03, 2004 at 04:42:07PM -0600, Brent Macnaughton wrote:
> Is there any way to install a port and tell it NOT to install one or more of
> it's required ports? For example: I installed the mysqlcc port, and it
> wanted to install mysql-client. I already have mysql-client installed, but I
> did not do it from the ports tree. Another port wanted to install Apache as
> a requirement. I already have Apache installed, but I did so from source. Is
> there some command line option to tell the system not to install certain
> ports? Or better yet, a config file I where can list ports not to install.

This should happen automatically.  When you go to install a port it
doesn't look in the database of installed ports to see if its
dependencies have been met.  Rather it checks directly that particular
files or shlibs are installed on the system.  For instance, in the
mysqlcc port, the line:

    BUILD_DEPENDS=  qmake:${PORTSDIR}/devel/qmake

says that the devel/gmake port should be installed if the qmake
program is not available at build time.

Dealing with MySQL itself is rather harder since there are 4 different
versions available in the ports and most of the mysql dependent
software will work just fine with any of them.  That's what the
'USE_MYSQL' line in the Makefile is for.  If you look at
/usr/ports/Mk/ you will find the following words of wisdom:

    # USE_MYSQL                     - Add MySQL client dependency.
    #                                         If no version is given (by the maintainer via the port or
    #                                         by the user via defined variable), try to find the
    #                                         currently installed version.  Fall back to default if
    #                                         necessary (MySQL4.0 = 40).

and later on in the file you'll see that it eventually resolves down
to a dependency statement like:

    LIB_DEPENDS+=   mysqlclient.${MYSQL${MYSQL_VER}_LIBVER}:${PORTSDIR}/databases/mysql${MYSQL_VER}-client

with all the version numbers filled in.  This tests for the existance
of (where X is either 10, 12 or 14) and that it is
known to -- so long as you get output from

    % ldconfig -r | grep mysqlclient

then you should be OK.  If not, you should add whatever directory
you've installed the MySQL client lib to the shared library search

    # ldconfig -m /usr/local/lib/mysql

and use the 'ldconfig_paths' variable in /etc/rc.conf to make that
persistent across reboots.

Similarly for the programs you have that depend on apache.
> Is there also a way to tell portupgrade to skip certain ports? Next time I
> do a portupgrade -aRr i do not want it to install mysql-client or Apache.

You need to run 'pkgdb -F' -- this will find that the dependent ports
(like mysqlcc) claim to depend on whichever mysql-client port, but
there's no record of that port being installed.  In this case, just
hit Ctrl-D to delete that listed dependency -- if you're curious as to
what actually happens, take a before and after look at the +CONTENTS
file in /var/db/pkg/{portname}.

On the whole though, it's much easier just to install everything via



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP:         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list