# can a rebuild of world be in parts



## roelof (Nov 21, 2012)

Hello, 

When I want to upgrade from 8.1 to 9.0 I have to rebuild all packages installed from ports. 
I think this will costs me around 2 a 3 days. 

Now I wonder if this can be done in parts. So a partly rebuild, then stop the machine and the next day go on where I have stopped. 

Roelof


----------



## SirDice (Nov 21, 2012)

You can install misc/compat8x, that will buy you some time.


----------



## roelof (Nov 21, 2012)

Thanks for the answer.
But I was looking for a answer at another problem.
`# portmaster -Raf` rebuilds all installed ports.
When I stop this and shutdown the machine and I would continue I could not do the command again because it's starts all over again. 

How can I take care that the ports who are rebuild not get rebuild when I continue. 

Roelof


----------



## arapaima (Nov 21, 2012)

what about specifying your specific ports? `# portmaster -Rf <port>`


----------



## roelof (Nov 21, 2012)

That could work if you have a few packages. The last time I had to rebuild there were some 400 - 500 packages to rebuild.

Edit 1 : If I use the output of pkg_libchk and feed it to portmaster. Could that work and how do I do that?


----------



## jb_fvwm2 (Nov 21, 2012)

```
x11/nvidia-driver     needs updating
ports-mgmt/portupgrade   needs updating
audio/cmus     needs updating
# step 1, the above file [FILE]grep[/FILE]ped from [FILE]pkg_version[/FILE]
# step 2  (Assuming twelve or so [FILE]devel[/FILE] ports in the file...
cat file.pkg_version | grep devel | awk '{print $1}' | xargs -J % portmaster -d -B -P -i -g --update-if newer %
```
That is just one way.  Others similar exist...


----------



## SirDice (Nov 21, 2012)

If you have that many packages installed it may be simpler just to *pkg_delete -a* and start over.


----------



## roelof (Nov 21, 2012)

And will `# pkg_delete -a` delete everything I installed by ports?


----------



## SirDice (Nov 21, 2012)

roelof said:
			
		

> And will `# pkg_delete -a` delete everything I installed by ports?



Yes, ports or packages will be removed. Any configuration files however will remain so if you install the port or package again you won't have to configure it as it will use the existing configuration file.


----------



## wblock@ (Nov 21, 2012)

roelof said:
			
		

> When I want to upgrade from 8.1 to 9.0 I have to rebuild all packages installed from ports.
> I think this will costs me around 2 a 3 days.
> 
> Now I wonder if this can be done in parts. So a partly rebuild, then stop the machine and the next day go on where I have stopped.



Careful with the terminology--this is not a rebuild of "world".

Depends on why you want to break this up.  If you are concerned about downtime for a server, the best way is to install the new system on a fresh disk, do all the upgrading on that offline system, then swap the disk into the server after all the upgrades are done.

If you have a dual-boot desktop and just need to be able to use the other operating system at the same time, convert the FreeBSD system into a VM.

Otherwise, breaking up the rebuild of ports is tricky.  When the system comes up with only some of the ports rebuilt, it may not all work.  The procedure at the end of the portmaster(8) man page works, and portmaster shows a list of ports remaining to be upgraded when you control-c out of it.  Save that, possibly by running the session inside script(1), and you can probably pick up where you left off.

Another approach is packages, but I don't use them so someone else can comment.


----------



## wblock@ (Nov 21, 2012)

SirDice said:
			
		

> Yes, ports or packages will be removed. Any configuration files however will remain so if you install the port or package again you won't have to configure it as it will use the existing configuration file.



Careful, ports are not supposed to remove customized config files, but it's not guaranteed.  Back up /usr/local/etc/ before deleting packages.


----------



## vand777 (Nov 22, 2012)

Portmaster's man:


> Using portmaster to do a complete reinstallation of all your ports:
> 
> portmaster --list-origins > ~/installed-port-list
> Update your ports tree
> ...


----------

