# freebsd/ports basic questions



## k2msmith (Apr 12, 2009)

I'm moving to a straight Freebsd 7.1 system after using PC-BSD for a year.  Question, once I install 7.1 from the installation disks (in progress as we speak) could I do a "rm -rf" on the /usr/ports tree (I requested one on sysinstall) and do a fresh "portsnap fetch extract upgrade" before I do anything else ? - or should I start with the ports tree that was installed from the disks.

My initial requirements for the system will be:

- window manager (xmonad)
- Firefox3 (don't need flash, but probably will install the flash9 emulator in case)
- emacs
- ghc compiler
- nvidia driver + openGL
- cdrom burning for backup

Does portsnap give me a ports tree which is based on ports of software on 7.1 release freebsd codebase ?  I am looking for reliability and I want to minimize a lot of maintenance fixing dependencies with port upgrades and the likes.

Thanks


----------



## graudeejs (Apr 13, 2009)

yes, you can rm -r /usr/ports and then portsnap fetch extract
later when you need to update ports do
portsnap fetch update

i suggest using ports-mgmt/portmaster for compilling/updating ports
and ports-mgmt/pkg_cutleaves to remove ports and unessacery dependencies

bought are easy to use

portsnap gives you latest (up to date) ports tree


----------



## k2msmith (Apr 13, 2009)

I just did a make on the portmaster command.  It's interesting because I just used it to compile firefox3 and as it says in the man page, it's recursively rebuilding any dependent ports  (including libX11) - and I'm sure that sometime in the next 48 hours it will finish compiling. 

So my next question, now that I have all fresh libraries that are recursively depended on by firefox3, do I need to recompile all everything else on the systems the depends on those new libraries ?   For example, what if I have a new shared library that X depends on - do I need to recompile Xorg ?

I guess it's hard not to start a chain reaction on this


----------



## k2msmith (Apr 13, 2009)

Maybe I answered my own question.   I did a "portmaster -L" and it shows that out of 290 ports I have installed 99 have new versions available.  But that number is going down as I run the portmaster www/firefox3 in the background.

I suppose after the firefox3 and all it's dependencies are updated, I should go back and re-run portmaster -L to see if anything is left and do portmaster -a to upgrade  ??

It does look like in the process though I will implicitly go from Xorg-7.3-1 to X-org-7.4-2.   I am not sure that is a good thing though.  I'm not doing any real xwindows-dependent development - so I guess upgrading won't hurt.


----------



## graudeejs (Apr 13, 2009)

When you want to update firefox3 for example, not all dependencies will be updated
Only dependencies that are out of date will be updated (unless you specify some switch to update ALL dependencies)

also to check ports out of date I use
*pkg_version -vL "="*


----------



## k2msmith (Apr 13, 2009)

thanks for the advice on this.  I began a long session last night with the recommended portmaster script.  It's a nice tool. Short story is that I ended up synchronizing very port on my system with the lastest ports tree.  After a few false starts, with a new Xorg sever  (requiring me to run HAL and dbus at system startup now), everything seems to be working beautifully and any new port I have been building as of late has worked flawlessly.

Back to the original issue.  I decided to install firefox3 with pkg_add because I needed a browser fast on the install system to look at documentation.  Only issue is that the packages that have been pre-built (and ones that firefox needs that I don't have) are never going to be as new as my systems.

Output from portmaster -L   (I like this command !

===>>> firefox-3.0.5,1
        ===>>> New version available: firefox-3.0.8,1
===>>> shared-mime-info-0.51
        ===>>> New version available: shared-mime-info-0.60

So, moving forward- and I'm wondering how other people work with freebsd.  I am probably not wanting to build very package from source (or maybe I should ?).  If I don't, I will always run the risk of having out of date interdependencies.  In this case, I half want to to remote firefox and rebuild from source - on the other hand I don't know if I want to bloat  my system with additional libraries it require to build (but maybe not require at runtime). The dilemma.


----------



## SirDice (Apr 13, 2009)

The way I do it is to pre-build everything inside a jail. I keep an eye on freshports and update my ports tree when needed. When enough things are out of date I rebuild everything and package it. Then you can keep working on your machine until everything is done. Once everything is complete I just pkg_delete everything and install my own packages. That last step only takes about an hour or so.


----------



## graudeejs (Apr 13, 2009)

SirDice said:
			
		

> The way I do it is to pre-build everything inside a jail. I keep an eye on freshports and update my ports tree when needed. When enough things are out of date I rebuild everything and package it. Then you can keep working on your machine until everything is done. Once everything is complete I just pkg_delete everything and install my own packages. That last step only takes about an hour or so.



Nice, I will have to try this 
On other hand, now I make snapshots before I do anything....


----------



## jb_fvwm2 (Apr 13, 2009)

Lately I've pkg_add'd seamonkey, and built gnash, that
gives usable flash (_7 stable from last year).  Compiling
the former takes too long most days...
...........
OTOH I don't use portsnap because it would probably obliterate
a few custom .sh I have to rebuild ports with.  For instance
in the latest gnome bump, midway through the update of a /port/
I was warned by a file in the /port/ that the newer port
had added the dependency /json-glib/, so before the actual
build I installed it in another tty.     Slower maybe
but eventually maybe faster if I figure out more tweaks...
...........
I also put README's in the /port/, .texi that are not installed
by the port but built (#makeinfo) (for example in gtar) 
and +REQUIRED_BY so I can check it easily.    And sometimes even
output files from the initial run of the port.


----------



## tangram (Apr 14, 2009)

k2msmith said:
			
		

> Question, once I install 7.1 from the installation disks (in progress as we speak) could I do a "rm -rf" on the /usr/ports tree (I requested one on sysinstall) and do a fresh "portsnap fetch extract upgrade" before I do anything else ? - or should I start with the ports tree that was installed from the disks.



Tip: Remove all installed packages and ports on FreeBSD


----------



## phoenix (Apr 14, 2009)

k2msmith said:
			
		

> I'm moving to a straight Freebsd 7.1 system after using PC-BSD for a year.  Question, once I install 7.1 from the installation disks (in progress as we speak) could I do a "rm -rf" on the /usr/ports tree (I requested one on sysinstall) and do a fresh "portsnap fetch extract upgrade" before I do anything else ?



No need to remove the existing ports tree.  Just run *portsnap fetch extract*.  That will write overtop of the existing tree, bringing it up to date.

Or, start with that tree, and use csup to bring it up to date.



> Does portsnap give me a ports tree which is based on ports of software on 7.1 release freebsd codebase ?  I am looking for reliability and I want to minimize a lot of maintenance fixing dependencies with port upgrades and the likes.



There is only one ports tree.  Every version of FreeBSD uses the same ports tree.


----------

