# I have 1471 package and want upgrade all of them



## mfaridi (Feb 7, 2009)

I have 1417 packages  all of them install by port tree and I want upgrade them , I use FreeBSD 7 
but I do not want upgrade Xorg to 7.4 , I hear this version has many problem , 
How I can upgrade all packages with portupgrade or portmaster but I do not want upgrade Xorg ?


----------



## intr (Feb 7, 2009)

portupgrade(1).
Option -x - "Exclude packages matching the specified glob pattern" .
Or adding in pkgtools.conf in HOLD_PKGS array.

portupgrade -x 'xorg*' -a

PS: glob(3).


----------



## DutchDaemon (Feb 7, 2009)

man portupgrade 


```
-x GLOB
     --exclude GLOB         Exclude packages matching the specified glob pat-
                            tern.  Exclusion is performed after recursing
                            dependency in response to -r and/or -R, which
                            means, for example, the following command will
                            upgrade all the packages depending on XFree86 but
                            leave XFree86 as it is:

                                  portupgrade -rx XFree86 XFree86
```

I have no idea how this will impact your X environment, though. If you upgrade every X-dependent port (expecting 7.4) but not X itself .. I don't know. You could try pkg_info -r xorg-7.3 and write a script that will not upgrade any of those ports, while upgrading all others. Good luck with that ..


----------



## intr (Feb 7, 2009)

DutchDaemon said:
			
		

> You could try pkg_info -r xorg-7.3 and write a script that will not upgrade any of those ports, while upgrading all others.



Don't use the scripts, portupgrade(1) automatically sorts the packages in dependency order before updating.


----------



## kamikaze (Feb 7, 2009)

This would certainly break everything. X depends on lots of libraries and all your Xorg 7.3 (or earlier?) stuff would be linked to lots of libraries that do not exist any more.

I suggest you instead turn off the HAL support for Xorg before building it and you'll hardly notice a change with Xorg 7.4. You'll just have to remove some lines from your xorg.conf.


----------



## mfaridi (Feb 7, 2009)

I need very safe way for upgrade .


----------



## ale (Feb 7, 2009)

kamikaze said:
			
		

> I suggest you instead turn off the HAL support for Xorg before building it and you'll hardly notice a change with Xorg 7.4. You'll just have to remove some lines from your xorg.conf.


I did it that way and I've only added the _Option "AllowEmptyInput" "off"_.
All it's working as before.

Another suggestion is to remove xorg and xorg-apps, so you can easily remove xclock, xphelloworld and xorg-protos packages (if my memory is not failing). At the end of the upgrade just add xorg and xorg-apps again.

Something I would like to ask you is: do you really need 1471 packages installed? Do you use all of them?


----------



## mfaridi (Feb 7, 2009)

When I run

```
portmaster -L
```
I see this result 

```
===>>> 1412 total installed ports
	===>>> 415 have new versions available
```
I must update 415 pacakges 
what must I DO with this is alot of packages 
which way is safer ?


----------



## kamikaze (Feb 7, 2009)

Well, the safest way is to duplicate the machine, do the update on the duplicate and test it there. If it works, use the duplicate and update the original. How safe you can get all depends on how much time/money/work you are willing to invest.


----------



## mfaridi (Feb 7, 2009)

I do not have another machine , I think I must spend many time for upgrade all packages


----------



## ale (Feb 7, 2009)

mfaridi said:
			
		

> I think I must spend many time for upgrade all packages


This is just one among the reasons of my question.


----------



## mfaridi (Feb 7, 2009)

I wish FreeBSD developer and other person work and try for FreeBSD , can make or find good way for problem like this .
I wish we have package install it and by this package we upgrade all packages installed in our system , without problem and without worry about our systems


----------



## gilinko (Feb 7, 2009)

mfaridi said:
			
		

> I wish FreeBSD developer and other person work and try for FreeBSD , can make or find good way for problem like this .
> I wish we have package install it and by this package we upgrade all packages installed in our system , without problem and without worry about our systems



Not to be rude here but I think you should be looking for another operating system with some type of commercial support, as this would probably suit your needs better than FreeBSD. FreeBSD is mainly a source based distribution with the ports tree, and although packages can be built the main idea is to use ports and 99% of the time they work flawlessly. To assign the hard working people who keep FreeBSD the top notch OS that it is to solve everything for you is not a reasonable request. At the end of the day it's still your system and your responsibility to keep it up to date and in working order as it is made available to you at no cost.


----------



## DutchDaemon (Feb 7, 2009)

intr said:
			
		

> Don't use the scripts, portupgrade(1) automatically sorts the packages in dependency order before updating.



That was not the type of script I was talking about. More like a 'grep -v' of all X-related ports, substracting those from the list of 1400+ ports he wants to update, and tossing those remaining ports to the portupgrade process (which will, indeed, sort out the right order). Just biting the bullet and getting a working Xorg 7.4 environment would be a much better way of tackling this situation. Having desert islands in your installed ports will come back to haunt you.


----------



## graudeejs (Feb 7, 2009)

mfaridi said:
			
		

> I do not have another machine , I think I must spend many time for upgrade all packages


Backup data


I would use portmaster
portmaster -r x11/xorg
it would rebuild X and all dependencies. I repeat All dependencies.
Yes, it will be slow, yes, there might be problems.

But if it comes to problems you have your backup, that you can restores....

btw, you didn't tell if you have physical access to machine, which is very important thin, to know....


----------



## DutchDaemon (Feb 7, 2009)

mfaridi said:
			
		

> I wish FreeBSD developer and other person work and try for FreeBSD , can make or find good way for problem like this .
> I wish we have package install it and by this package we upgrade all packages installed in our system , without problem and without worry about our systems



Which is exactly what FreeBSD has been delivering to me since version 2.2.5. The ports tree is an awesome resource, but it doesn't install _itself_, maintain _itself_ or troubleshoot _itself_. 

All the tools to do that are there for you, even in competing flavours, but you will have to learn what they are and how to use them. 

If you are constantly overwhelmed by these issues (and you appear to be), learn harder, or give up and walk away. That's really all there is to this decision. You cannot ask people to work harder and do more for _you_ (or any of us, really).

It's a miracle that these people are doing it for _FreeBSD_, actually, and that there are forums where people help one another, for free. Now _you_ must try going the extra mile, and learn (more/harder), and help the rest of the community.


----------



## jb_fvwm2 (Feb 7, 2009)

mfaridi said:
			
		

> I wish FreeBSD developer and other person work and try for FreeBSD , can make or find good way for problem like this .
> I wish we have package install it and by this package we upgrade all packages installed in our system , without problem and without worry about our systems



consider each port unique
.........
I suggest a binder or ledger paper (large)
divide your ports which *must* be upgraded into:
1... issues with upgrading
2... meta-ports, dependencies need upgrade first
3... ports which break a lot of other ports *when* upgraded
4...  "sets" of ports (GL > xorg-server, etc)
5...  ports with conflicts
6... ports which could be deinstalled
ETC ETC... you can thus concentrate on the more
important ones, figure out methods, and let, say,
1/2 of them slide since they would be "accounted for"
on paper, still working fine if installed and out-of-date.
..........
Easier that way, once one has a lot of ports, in my opinion.


----------



## hydra (Feb 8, 2009)

@mfaridi
I believe that each FreeBSD developer is willing to make the system the best available. Don't forget that this project is provided as is, for free. Are you trying to say, that you never make mistakes ?


----------



## intr (Feb 8, 2009)

DutchDaemon said:
			
		

> That was not the type of script I was talking about. More like a 'grep -v' of all X-related ports, substracting those from the list of 1400+ ports he wants to update, and tossing those remaining ports to the portupgrade process (which will, indeed, sort out the right order).



Yes, its possible.

Something like:

```
portupgrade `pkg_info -r xorg-7.3 | awk /Dependency:/'{system(sprintf("echo -n \"-x %s \"", $2))}'` -a
```


----------



## jb_fvwm2 (Feb 8, 2009)

sorry to post again, but if like in the post above you have a 
ledger of "types of ports", you can do stuff like this:
..
"ports which fail with config.h and/or defines.h errors"
# cd /usr/ports/category/port
# mmv /usr/local/include/defines.h .
# mmv /usr/local/include/config.h .
# /bin/rm -rf work
# make build && make deinstall && make install && yell
# mmv config.h /usr/local/include
# mmv defines.h /usr/local/include
#  (you need /yell/ and /mmv/ for those to work)
...........................
your specific problem on each page of the mini-book
might be more specific to a subset rather than a 
majority of bsd-users, so the ledger would save you
hours, probably, weekly, of re-inventing solutions.
..............


----------

