# 8.0 portupgrade -af: CONTINUE



## Seeker (Nov 30, 2009)

So, I have around 678 ports installed.
I've run:

```
portupgrade -af
```
, to rebuild them all, as I migrated from 7.2 to 8.0

It stopped at *ruby18-bdb-0.6.5_1* port as it complained about some bad ports db format.
I've rebuilt it by hand.

Now I need to continue from port 216, which was ruby18-bdb!

Luckily for me I did used *script* command to record progress.
From generated file I did:

```
cat progress_file | grep "===>  Installing for " > built_ports.txt
```

Then I replaced string *"===>  Installing for "* with *""*(empty string), in order to get file, with list of already rebuilt ports.
Format is one port_version on each line, like:

```
...
gnome-menus-2.28.0.1
patch-2.6
exiv2-0.18_1,1
automake-1.9.6_3
gawk-3.1.6_1
qt4-xml-4.5.3
...
```
So how would I use that file to continue where I stopped?

Something like using exclude option? :stud

```
portupgrade -af -x ... something
```


----------



## DutchDaemon (Nov 30, 2009)

Get the list of ports you _still need to build_ from that progress file, put those in another file, and then run

[cmd=]cat thatfile | tr '\n' ' ' > newfile[/cmd]

Edit newfile, put [cmd=]portmaster -f [/cmd] before that single long line, and run it as a shell script


----------



## mickey (Nov 30, 2009)

If you know the approximate time, when you started updating your ports, you may also use this as a _pkg_glob_ to portupgrade, for example:

```
portupgrade --batch -f "<= 2009-11-29 00:00:00 +0800"
```


----------



## MissileSilo (Nov 30, 2009)

http://www.daemonology.net/blog/2009-07-11-freebsd-update-to-8.0-beta1.html

The upgrade instructions say to follow these instructions when upgrading to 8.0.

Part of the instructions say to do this:

Step 7: Update ruby and delete portupgrade's package database (UPDATE 2009-09-08: this is not required when updating from 8.0-BETA3 or later to newer betas, release candidates, or 8.0-RELEASE):


```
portupgrade -f ruby\*
...
rm /var/db/pkg/pkgdb.db
```
I'm not entirely certain why this is necessary; but when performing major base system upgrades, portupgrade tends to get confused and think that its package database is corrupt. Rebuilding the ruby and ruby-bdb ports and then deleting the package database (which forces portupgrade to rebuild it) seems to make the problem go away.


----------



## Seeker (Dec 1, 2009)

DutchDaemon said:
			
		

> Get the list of ports you _still need to build_ from that progress file, put those in another file, and then run
> 
> [cmd=]cat thatfile | tr '\n' ' ' > newfile[/cmd]
> 
> Edit newfile, put [cmd=]portmaster -f [/cmd] before that single long line, and run it as a shell script



portupgrade refuses(well it ignores), more than 1 port as argument
Same applies for exception *"-x"*, where from *...-x portA portB portC*, only portA will actually get excluded.

What I did was looking at man of portupgrade and done this:

```
# portupgrade -afy -x '>=2009-11-29 14:00'
```
After thinking, a bit, I knew I started upgrading ports around 2009-11-29 15:00, so used -1 hour as a safety measure.
That is exclude *"-x"*, all ports built *after* 2009-11-29 14:00
And Voila!

_PS: Sorry for a late reply, but it took more than a day, to rebuild all ports and use browser and it is not like I could post with lynx(I could actually) _


----------



## Seeker (Dec 1, 2009)

mickey said:
			
		

> If you know the approximate time, when you started updating your ports, you may also use this as a _pkg_glob_ to portupgrade, for example:
> 
> ```
> portupgrade --batch -f "<= 2009-11-29 00:00:00 +0800"
> ```



Yeah, applied _'date approach'_ , day and a half ago.
Thanks anyway!



			
				MissileSilo said:
			
		

> http://www.daemonology.net/blog/2009-07-11-freebsd-update-to-8.0-beta1.html
> 
> 
> The upgrade instructions say to follow these instructions when upgrading to 8.0.
> ...



I upgraded from 7.2, so yes, this is exactly where it stopped.
I then manually deleted *.db and rebuilt ruby, and then continued to build as replied above.


----------



## mickey (Dec 1, 2009)

Seeker said:
			
		

> portupgrade refuses(well it ignores), more than 1 port as argument
> Same applies for exception *"-x"*, where from *...-x portA portB portC*, only portA will actually get excluded.


You will have to use multiple -x options, like _-x portA -x portB -x portC_.
Specifying _-x portA portB portC_ could actually exclude portA, but include portB and portC, as they are not associated to the -x switch, when separated by whitespace.

But portupgrade should handle more than one pkg_glob being specified on the commandline, and I remember having used it with xargs already.


			
				Seeker said:
			
		

> What I did was looking at man of portupgrade and done this:
> 
> ```
> # portupgrade -afy -x '>=2009-11-29 14:00'
> ...


This should be equivalent to:

```
portupgrade -fy "< 2009-11-29 14:00"
```


----------



## Seeker (Dec 1, 2009)

mickey said:
			
		

> You will have to use multiple -x options, like _-x portA -x portB -x portC_.


Trust me, that is exactly what I've been trying!
*Only* portA is excluded.




			
				mickey said:
			
		

> This should be equivalent to:
> 
> ```
> portupgrade -fy "< 2009-11-29 14:00"
> ```


Yeah, it would.

And..., as I see, you are good with portupgrade, so tell me...
What effect...,  and how would it behave, if I would add:

```
--batch
```
, I also saw that it requires setting BATCH var in shell.


----------



## mickey (Dec 1, 2009)

Seeker said:
			
		

> Trust me, that is exactly what I've been trying!
> *Only* portA is excluded.


Did you by any chance specify the -x options *after* the list of packages to update? For that will not work.



			
				Seeker said:
			
		

> And..., as I see, you are good with portupgrade, so tell me...
> What effect...,  and how would it behave, if I would add:
> 
> ```
> ...



Actually, specifying the _--batch_ option to portupgrade should set the BATCH environment variable whilst performing the upgrades.

The effect is, that no configuration menus will pop up and require user intervention. The ports being upgraded will either use their default configuration options, or the ones previously saved during [cmd=""]make config[/cmd].

I quite dislike it, when I instruct my machine to perform a ports upgrade, go to sleep, get up 8 hrs later and have to face the fact, that my machine was sitting idle since 10 minutes after I got to sleep, cause it was waiting for me to choose some configuration options


----------



## DutchDaemon (Dec 1, 2009)

One more reason to switch to portmaster, which gets the config screens out of the way right at the start


----------



## Seeker (Dec 1, 2009)

mickey said:
			
		

> Did you by any chance specify the -x options *after* the list of packages to update? For that will not work.


Well like this:

```
# portupgrade -af -x portA -x portB -x portC
```
and

```
# portupgrade -af -x portA portB portC
```
None worked. 


			
				mickey said:
			
		

> Actually, specifying the _--batch_ option to portupgrade should set the BATCH environment variable whilst performing the upgrades.
> 
> The effect is, that no configuration menus will pop up and require user intervention. The ports being upgraded will either use their default configuration options, or the ones previously saved during [cmd=""]make config[/cmd].
> 
> I quite dislike it, when I instruct my machine to perform a ports upgrade, go to sleep, get up 8 hrs later and have to face the fact, that my machine was sitting idle since 10 minutes after I got to sleep, cause it was waiting for me to choose some configuration options


Yeah, that is why for meta ports I use:

```
# make config-recursive
```
Well I'll use _--batch_, just as a safety measure for a massive portupgrade, then


----------



## DutchDaemon (Dec 1, 2009)

Have you tried `# portupgrade -x portA -x portB -x portC -af`?


----------



## mickey (Dec 1, 2009)

Seeker said:
			
		

> Well like this:
> 
> ```
> # portupgrade -af -x portA -x portB -x portC
> ...


The first form should work... i use something like this regularly:

```
portupgrade --batch -arR -x "*openoffice*" -x "*jdk*"
```
Currently my other machine does:

```
portupgrade --batch -O -f -x "*openoffice*" -x "jdk-*" "<= 2009-12-01 00:00:00"
```



			
				Seeker said:
			
		

> Yeah, that is why for meta ports I use:
> 
> ```
> # make config-recursive
> ...



In the end, updating a port is another thing as installing a port. When I install something, I probably want to see the compile time options. When I am upgrading, it is safe to assume, I've already been there.

@Dutch Daemon:

portupgrade, portmaster, ... I don't see much of a difference here, other than different commandline flags and oh well ruby of course :e But I think none of these tools will solve the problems with the ports system that keep bothering me.


----------



## ecables (Dec 3, 2009)

This exact same thing happened to me (upgrading from 7.2 -> 8.0) yesterday.  It failed out at ruby with a corrupt pkgdb.db.  I rebuilt the pkgdb.db, and it seemed to continue on just fine, although now that the installation is complete I'm having all kinds of missing library problems (application references the old libs which were removed with the final iteration of 'freebsd-update install').  I've been using portupgrade slowly but surely to get things back to working order...

Not to hijack your thread, but is there a way to identify which installed ports have failed library dependencies (for example: 'libcrypt.so.4 not found, php needs libcrypt.so.4" type errors)?


----------



## jb_fvwm2 (Dec 3, 2009)

Change to several subdirectories
(/usr/local/lib, /usr/local,bin etc)
in each one run

```
ldd A* 
then
ldd B*
etc...
then ldd a*
ldd b* 
etc...
```
A bit tedious but that would find "?" binaries 
that are stray, (so.) files too, and probably
"not founds" for ports that need upgrading.  You
only have then to find out the portname for
the particular file 

```
pkg_which (file)
```

That is how I remember the process anyway.  I vaguely
recall someone posting a quicker way.


----------



## DutchDaemon (Dec 3, 2009)

I think I saw sysutils/libchk mentioned.


----------



## Seeker (Dec 4, 2009)

DutchDaemon said:
			
		

> Have you tried `# portupgrade -x portA -x portB -x portC -af`?


No I did not tried that.  :stud


----------



## Seeker (Dec 4, 2009)

ecables said:
			
		

> ...
> Not to hijack your thread, but is there a way to identify which installed ports have failed library dependencies (for example: 'libcrypt.so.4 not found, php needs libcrypt.so.4" type errors)?


You are more than welcome to hijack my thread.
Feel yourself like at home.


----------



## SIFE (Dec 5, 2009)

> I quite dislike it, when I instruct my machine to perform a ports upgrade, go to sleep, get up 8 hrs later and have to face the fact, that my machine was sitting idle since 10 minutes after I got to sleep, cause it was waiting for me to choose some configuration options


i do this and it is work fine for me :

```
portsnap -arC
```
switch -C will force to run menu config .
i was wonder if can i specify some config for some ports that they have not menu config like mysql-server in portupgrade or make.conf ?


----------



## PlatinumKing (Dec 5, 2009)

> Yeah, applied 'date approach' , day and a half ago.
> Thanks anyway!



What kind of approaches are there besides date approach?
I updated from FreeBSD 7.2R-p4 to 8.0R and have tried to rebuild all installed packages.


----------

