# Ports upgrade/update taking really long



## joplass (Aug 27, 2019)

It's been taking days to rebuild the ports directory.  I clear up the ports directory following another thread here that advised to so if the installation was done with DVD.  Unfotutanetly, it is taking quite a long time, I suspect because I am not always around to click ok when I am presented with screens like the one attached here.  My question is, is it normal for this process to take this long?

Regards,


----------



## Sevendogsbsd (Aug 27, 2019)

OK, so it's the options that are the issue. 

First, when you say "rebuild the ports directory", are trying to build every single port in the entire ports tree?


----------



## joplass (Aug 27, 2019)

Yes.


----------



## Sevendogsbsd (Aug 27, 2019)

Do not do that, at all, there is no point. Is this a desktop or a server?


----------



## joplass (Aug 27, 2019)

It's a desktop and I would like to have multimedia support as best as I can.


----------



## Sevendogsbsd (Aug 27, 2019)

OK, I see. I am right in the middle of something at the moment so will post back later with some links to threads on how to do this. Basically, you will need to use a tool like postmaster, synth or poudriere to build only ports you need. Dependencies will be handled automatically. What you will need is entirely up to you.

Is this your first FreeBSD system? If so, strongly suggest you use packages instead of ports.


----------



## joplass (Aug 27, 2019)

My second one but I am using this route because trying to install some packages wasn't working and I was getting an error message like "port outdated" or something in those lines.


----------



## Deleted member 30996 (Aug 28, 2019)

joplass said:


> All ports.  I read in another thread that one should always clear all ports in the ports directory after installing from a DVD.  I could not install anything because I was getting a message ports are outdated or something in those line.



You need to run `# portsnap fetch extract` after you install the base system. That updates your ports tree.

You might get a better idea how to go about things if you take a look at this:









						Beginners Guide - How To Set Up A FreeBSD Desktop From Scratch
					

I'm going to guide you though the process of getting a fully functional FreeBSD 13.0-RELEASE desktop up and running, complete with system files and security settings, step-by-step as if you've never used UNIX or the command line. Now let's get started:  Insert your boot media and at the Welcome...




					forums.freebsd.org


----------



## teo (Aug 28, 2019)

Sevendogsbsd said:


> Basically, you will need to use a tool like postmaster, synth or poudriere to build only ports you need. Dependencies will be handled automatically. What you will need is entirely up to you.



I never understood the poudriere port, I never understood its operation or its configuration. Always built the system in desktop with make config-recursive ports and binary packages of the latest, but it is very tortuous to compile heavy ports that sometimes ends in error.


----------



## joplass (Aug 28, 2019)

Trihexagonal said:


> You need to run `# portsnap fetch extract` after you install the base system. That updates your ports tree.
> 
> You might get a better idea how to go about things if you take a look at this:
> 
> ...


I will bookmark for my next installation.  I wanna I see how this one goes.


----------



## SirDice (Aug 28, 2019)

joplass said:


> My second one but I am using this route because trying to install some packages wasn't working and I was getting an error message like "port outdated" or something in those lines.


That's not an error you would get when installing packages. Please post the _exact_ error messages, not your interpretation of them.


----------



## joplass (Aug 28, 2019)

SirDice said:


> That's not an error you would get when installing packages. Please post the _exact_ error messages, not your interpretation of them.


SirDice, as previously mentioned, probably by my limited knowledge of all things BSD, I am rebuilding all ports on that machine.  When that is done I will attempt to proceed with installation of those packages that I need.  If all fail I will post anything that will show up.


----------



## Deleted member 30996 (Aug 28, 2019)

joplass said:


> I am rebuilding all ports on that machine.  When that is done I will attempt to proceed with installation of those packages that I need.




When you install the base system from a DVD, memstick.img or whatever there are _no_ ports installed on the machine.

Are you trying to rebuild the ports tree by compiling all programs in it?

Edit.: I should have read more carefully...



Sevendogsbsd said:


> First, when you say "rebuild the ports directory", are trying to build every single port in the entire ports tree?





joplass said:


> Yes.



That is what you're doing. That is not how it's done. 

If you'll take a look at the link I provided you'll probably save yourself a lot of time, trouble and diskspace. At this point I can't help you beyond that.


----------



## joplass (Aug 28, 2019)

Following this thread here


----------



## Phishfry (Aug 28, 2019)

Whatever you are following building all ports is ridiculous.
The entire package collection compressed takes up 80 Gigabytes. So you will probably need 250-300Gigabytes of free space.
Not only that it will probably take over 2 weeks and will FAIL on pkg-fallout (these are broken ports which need attention).

So please save yourself the hassle and the massive amount of bandwidth you are wasting for nothing.

FreeBSD DVD Installation has packages for a minimal desktop.
Please consider the DVD install if you absolutely need packages included with base.


----------



## Deleted member 30996 (Aug 29, 2019)

Phishfry said:


> Whatever you are following building all ports is ridiculous.



I feel so much better now about asking where to find `portsnap` in the ports tree back in the day.

Wait, that wasn't me. That was whatshizname...


----------



## Phishfry (Aug 29, 2019)

After reading the thread you referenced I have only one piece of advice.
`portsnap auto` is all you need to run these days to update the entire ports tree.
It will work in all environments, from no ports tree installed to updating an existing ports tree.
There is no need to compile all ports. Only the program you want installed needs to be compiled.
For example Xorg has many dependencies, but you only need to `make install` Xorg. Not all the dependencies.
The dependencies will be automatically compiled. So no need to compile everything. The ports system handles it for you.








						Chapter 4. Installing Applications: Packages and Ports
					

FreeBSD provides two complementary technologies for installing third-party software: the FreeBSD Ports Collection, for installing from source, and packages, for installing from pre-built binaries




					www.freebsd.org


----------



## joplass (Aug 29, 2019)

oh dear...
	
	



```
portupgrade -a
```
 just came to an end.


----------



## Sevendogsbsd (Aug 29, 2019)

I don't remember how portmaster works but is this with you trying to build all ports or just the ones you need?


----------



## joplass (Aug 29, 2019)

Sevendogsbsd said:


> I don't remember how portmaster works but is this with you trying to build all ports or just the ones you need?


All of them.  It was that or re-install.  I rather fight through a bad installation.  Learning is never a problem.  I have to make friend with the FreeBSD handbook.


----------



## Sevendogsbsd (Aug 29, 2019)

Yes, and you should not do that per several posts in this thread. Only build the ports you need, not all of them. I have no idea how to do that using portmaster but there are plenty of folks who do that can help, or you can read the handbook. I use poudriere but it is more complex to use than portmaster.

First make a list of ports you actually need, but do not include dependencies. I mean ports like Xorg, a file manager, a text editor, etc, or a desktop environment such as xfce4, KDE, etc. Make sense?


----------



## SirDice (Aug 29, 2019)

joplass said:


> All of them.


There might be some misconception here. Did you mean "all ports I have installed" or "all 37000+ ports in the ports tree"? If you really meant the latter, don't. Seriously. It's such a waste of time and resources.


----------



## Sevendogsbsd (Aug 29, 2019)

OP meant all 37k in the tree.  At least that's the consensus I think we came to...


----------



## SirDice (Aug 29, 2019)

I don't think it's even possible to do, lots of ports conflict with other ports. Poudriere or Synth can do it but only because they build each port individually in a clean environment.


----------



## Sevendogsbsd (Aug 29, 2019)

joplass said:


> All of them.  It was that or re-install.  I rather fight through a bad installation.  Learning is never a problem.  I have to make friend with the FreeBSD handbook.



I missed this because I was focused on the ports issue. When you "reinstall", do you mean the OS or ports? Ports, and packages for that matter, have nothing to do with the core OS so if a port or package causes an issue, you can uninstall the offending package without hurting the OS. FYI: when you build ports, they end up as packages, they just have customized options, if you customized them. If you are not customizing ports, building them is pointless and you should stick. with packages.


----------



## SirDice (Aug 29, 2019)

Sevendogsbsd said:


> you can uninstall the offending package without hurting the OS


As a matter of fact, if/when things really go sour you can just do `pkg delete -af` to delete everything without having to reinstall the OS.


----------



## joplass (Aug 29, 2019)

Going by memory I believe I did this first 
	
	



```
# portsnap fetch extract
```
 follow by 
	
	



```
#portupgrade -a
```
.  I have to be in front of that machine to trace back my steps.  Prior to that I deleted everything in /ports.


----------



## SirDice (Aug 29, 2019)

`portsnap fetch extract` only creates a local copy of the ports tree (everything in /usr/ports)

`portsupgrade -a` ; only updates/upgrades your installed ports.

The way you were describing your situation it sounded like you were trying to build all 37000+ ports from /usr/ports.


----------



## joplass (Aug 29, 2019)

SirDice said:


> `portsnap fetch extract` only creates a local copy of the ports tree (everything in /usr/ports)
> 
> `portsupgrade -a` ; only updates/upgrades your installed ports.
> 
> The way you were describing your situation it sounded like you were trying to build all 37000+ ports from /usr/ports.


Into my madness it seems your post suggests I am on the right track.  Again all this came about because I was unable to install some packages.  One of them clearly was the nvidia driver.


----------

