# Uninstalled port - how to rebuild all dependencies



## vizion (Mar 14, 2013)

Hi

For a port to be installed how do I force a rebuild of all ports upon which it depends without attempting to build the port?

Thanks
David


----------



## wblock@ (Mar 14, 2013)

Why are you trying to do that?

ports-mgmt/portupgrade and ports-mgmt/portupgrade-devel can be forced to rebuild all the ports on which the given port depends, but then they will rebuild the given port also.  Usually that is the desired behavior.

If you have to do this, `% pkg_info -R [i]portname[/i]` will give a list of ports on which _portname_ depends.  The list can be fed to portupgrade or ports-mgmt/portmaster.


----------



## SirDice (Mar 14, 2013)

I was looking for an -R switch on portmaster(1) but I think it simply defaults to always update the dependencies.

With portupgrade(1) something like this should be possible:
`# portupgrade -Rf someport -x someport`
(force upgrade of all dependencies of "someport" and exclude "someport" itself)

Although I don't know if this works if "someport" isn't installed.


----------



## vizion (Mar 14, 2013)

The reason is I am having trouble trying to build editors/openoffice-3 on FreeBSD 8.2 but it is constantly failing to build. So I cannot rebuild something that is not installable!

I want to satisfy myself that none of the ports on which it depends have been built using libraries that are incompatible with openoffice-3.

The failure of openoffice is taking place very late in the build cycle (i.e. after about 2 hours!). The maintainer is at a loss.

 David


----------



## SirDice (Mar 14, 2013)

FreeBSD 8.2 has been end-of-life since July 2012. Update to at least 8.3.

http://www.freebsd.org/security/#unsup


----------



## Beeblebrox (Mar 14, 2013)

In /usr/ports
`# make all-depends-list -C editors/openoffice-3 > somename.txt`
Then you can sort through the file as you like and feed the list to portmaster, or copy-paste into terminal.

You could also try editors/libreoffice


----------



## wblock@ (Mar 14, 2013)

SirDice said:
			
		

> I was looking for an -R switch on portmaster(1) but I think it simply defaults to always update the dependencies.



It checks that everything the port being updated depends on is up to date, rebuilding them only if they are out of date.  I don't know whether -r affects that for depends-on versus depended-on.



> With portupgrade(1) something like this should be possible:
> `# portupgrade -Rf someport -x someport`
> (force upgrade of all dependencies of "someport" and exclude "someport" itself)
> 
> Although I don't know if this works if "someport" isn't installed.



I believe both portupgrade and portmaster will accept an origin format in addition to a port name glob, but have not tested: `# portupgrade -Rf editors/openoffice-3 -x editors/openoffice-3`


----------



## wblock@ (Mar 14, 2013)

vizion said:
			
		

> The reason is I am having trouble trying to build editors/openoffice-3 on FreeBSD 8.2 but it is constantly failing to build. So I cannot rebuild something that is not installable!



Other than time, that will not be a problem.  All the dependencies must be installed before the ports system or an upgrade tool like portmaster will try to rebuild or install the main port.  So `# portupgrade -Rf editors/openoffice-3` will rebuild everything it depends on before attempting to build openoffice-3.

It is worth switching to LibreOffice.  Although it has even more dependencies, it is more polished and functional.


----------

