# FreeBSD10 - keeping "up to date" SNAFU's!



## markb (Apr 22, 2014)

Good day,
Fresh install FreeBSD10.  Used `portsnap fetch extract update` to get current.  `pkg install (fill in the blank)` to install portmaster, xorg, nvidia-driver, nvidia-xconfig, mate, firefox, and vnc.

/usr/ports/UPDATING: I updated anything after 20140101 that needed updating (pkg delete, then portmaster -r yada, or as directed in /UPDATING).

I use the "Warren Block" approach to keeping ports updated/upgraded, and have no issues.  
http://www.wonkity.com/~wblock/docs/html/portupgrade.html

Everything runs wonderfully.  UNTIL...  (who to believe??)

`pkg audit -F`  ....0 problems in installed packages
`pkg version | grep '<'`....nothing here, either
`pkg version -vIL=`.....has a half dozen programs that need updating
`pkg upgrade` has 25 programs listed with 'direct dependency changed' issues.

If I address the programs that need to be updated I bork my system and need to rebuild due to the slew of errors that appear when trying to run Mate or vncserver.  Most errors had to do with libpixman-1.so.30 or libxcb.so.2 dependencies and I ran 
`pkg shlib -R libpixman-1.so.30` (or libxcb.so.2) to find these dependencies and rebuild these ports.

HELP!  What's a highly educated (but not in FreeBSD) individual to do in order to keep a system up, running, and most importantly, current?  How do I know which commands lead me down the wrong rabbit hole and consume my free time (and TUMS!).

Thanks,
MarkB


----------



## wblock@ (Apr 22, 2014)

*Re: BSD10 - keeping "up to date" SNAFU's!*

You are mixing ports and packages.  `pkg upgrade` says "take all these custom ports I have carefully built to work in my environment, and wipe them out with pre-built binary packages".

If you want to use ports, don't install binary packages over them.


----------



## markb (Apr 22, 2014)

*Re: BSD10 - keeping "up to date" SNAFU's!*



			
				wblock@ said:
			
		

> You are mixing ports and packages.  `pkg upgrade` says "take all these custom ports I have carefully built to work in my environment, and wipe them out with pre-built binary packages".
> 
> If you want to use ports, don't install binary packages over them.



When you put it that way, it makes perfect sense <G>.
Thank you for clarifying!
Regards,
MarkB


----------



## wblock@ (Apr 22, 2014)

Just to clarify, it's fine to use pkg(8) commands that check or manage the database.  The ones that overwrite locally-built ports are the ones to avoid.


----------



## markb (Apr 23, 2014)

Good morning,
After sleeping on your response, I have additional thoughts:

USING PORTS vs PKG INSTALL
I initially use `pkg install` (fill in the blanks) to get a BSD system up and running as it's less bandwidth and lots faster vs using ports and changing to each directory, issuing `make -DBATCH install clean`.  Ipso facto, if a system is built with `pkg install` I should stick to the `pkg install` commands* approach to keep things up to date, unless there's some glaring issue in /usr/ports/UPDATING.

*My initial post in this thread shows 4 different accepted commands( `pkg version` or `pkg audit` ) with different results varying from 'nothing to do here' vs 25 programs that need to be upgraded.  Which do I believe?

I appreciate your insight and guidance,
MarkB


----------



## ShelLuser (Apr 23, 2014)

Apart from the above comments there is another noteworthy thing.



			
				markb said:
			
		

> Used `portsnap fetch extract update` to get current.


That's overdoing it a little and costs more time than needed.

You're mixing two options which are somewhat opposite where functionality is concerned. extract is used to _fully_ populate the ports collection. As such, as the name suggests, it'll extract the whole collection and place it (normally under /usr/ports).

update on the other hand does just that as well; it updates (or _patches_) your current ports collection with the new information, thus making sure that only the changed parts get updated. See also portsnap(8).

This could make a huge difference because only patching the relevant parts or extracting your ports collection every time can be quite the time saver.


----------



## wblock@ (Apr 23, 2014)

markb said:
			
		

> USING PORTS vs PKG INSTALL
> I initially use `pkg install` (fill in the blanks) to get a BSD system up and running as it's less bandwidth and lots faster vs using ports and changing to each directory, issuing `make -DBATCH install clean`.  Ipso facto, if a system is built with `pkg install` I should stick to the `pkg install` commands* approach to keep things up to date, unless there's some glaring issue in /usr/ports/UPDATING.



It depends on what you want.  Packages should generally be used as a set.  Assumptions about the default options are kind of built in, and mixing packages with custom-built ports can cause problems.

I prefer ports.  Getting to choose the options and having the binaries built on the local system, for the local processor, and with the actual dependencies present is worth it to me.  Most ports do not take that long to compile, and leaving build dependencies present speeds up building subsequent ones.



> *My initial post in this thread shows 4 different accepted commands( `pkg version` or `pkg audit` ) with different results varying from 'nothing to do here' vs 25 programs that need to be upgraded.  Which do I believe?



The ones that look at the ports tree for current versions, and not the ones that compare installed ports to remote binary packages.  `pkg audit` is fine, `pkg version` should work, but I don't use it.  Instead, I use portmaster(8) as shown in the script in the article:
`portmaster -L --index-only | egrep '(ew|ort) version|total install`


----------



## markb (Apr 23, 2014)

Well.....just for giggles - I used virtualbox and installed two versions of FreeBSD10:
-FreeBSD_PORTS
-FreeBSD_PKG
The PKG version is up and running (all the PKG listed in 1st posting) PLUS vbox (to resize the window to fit my screen rather than the small default screen).  FreeBSD_PORTS completed the compile of Portmaster and is still compiling XORG...
.02,
Mark (doing an intellectual exercise)


----------



## wblock@ (Apr 23, 2014)

Binary packages win on speed of installation, lose on customization and versatility.


----------



## ShelLuser (Apr 24, 2014)

And in addition to @wblock@'s comment; the binary package repository also isn't fully up to date (last time I checked anyway). For example; trying to install an environment such as kde4 (as mentioned in the handbook) will currently still fail.

Although the ports collection (parts of it anyway) also have their share of problems it's usually more easily solved.


----------

