# portupgrade problem



## RedErick (Aug 15, 2013)

Hello!

During performing of the command `portupgrade -arR` I have the following output:

```
portupgrade -arR
[Updating the portsdb <format:bdb_btree> in /usr/ports ... - 24388 port entries found 
.........1000.........2000.........3000.........4000.........5000.........6000.........
7000.........8000.........9000.........10000.........11000.........12000.........13000.........14000
.........15000.........16000.........17000.........18000.........19000....[B]/usr/ports/INDEX-9:19
438:rrdmerge-0.0_b05d69bfac64: 0.0_b05d69bfac64: Not in due form: '<version>
[_<revision>][,<epoch>]'[/B]......20000.........21000.........22000.........23000.........24000... 
..... done
```

I tried to solve this by:
`rm /var/db/portsnap/tag &&`
`rm -rf /var/db/portsnap/files &&`
`rm -rf /usr/ports`

And then: `portsnap fetch extract`. But still no result.

Please, help


----------



## wblock@ (Aug 15, 2013)

Don't use "pirate mode".  -arR is the same as -a.

For the problem, try updating the ports tree again (sometimes there is a lag).  Or just switch to ports-mgmt/portmaster, which does not need a separate ports database.


----------



## RedErick (Aug 15, 2013)

Thank you for recommendations! I will use portupgrade with only the -a key in the future. Unfortunately, a re-update of the ports tree again has no effect. I'm still stuck with this database. But `portmaster -a` works fine so I think there are no problems for me to switch to this application

Thanks a lot! My problem is solved


----------



## RedErick (Aug 16, 2013)

P.S. My last attempt was to delete /var/db/pkg/pkgdb.db and use `pkgdb -F` but that was also useless... OK, I will use `portmaster -a`


----------



## wblock@ (Aug 16, 2013)

Remember to always check /usr/ports/UPDATING first.  Upgrading FreeBSD Ports shows the whole upgrade process.


----------



## RedErick (Aug 16, 2013)

Thank you again


----------



## SirDice (Aug 16, 2013)

Looks like the original error message showed some problems with the /usr/ports/INDEX-9 file. You can remove it and rebuild it with [cmd=]make -C /usr/ports index[/cmd].


----------



## RedErick (Aug 16, 2013)

Done 

```
make -C /usr/ports index
Generating INDEX-9 - please wait...[B]Warning: Duplicate INDEX entry: mtr-nox11-0.85_1[/B]
Done.
```
And then again:

```
portupgrade -a
[Updating the portsdb <format:bdb_btree> in /usr/ports ... - 24389 port entries found
.........1000.........2000.........3000.........4000.........5000.........6000.........
7000.........8000.........9000.........10000.........11000.........12000.........13000
.........14000.........15000.........16000.........17000.........18000.........19000
....[B]/usr/ports/INDEX-9:19438:rrdmerge-0.0_b05d69bfac64: 0.0_b05d69bfac64: Not in due 
form: '<version>[_<revision>][,<epoch>]'[/B]......20000.........21000.........22000.....
....23000.........24000... ..... done]
```


----------



## wblock@ (Aug 16, 2013)

Could be an error in the index, but INDEX-9 here does not have the string rrdmerge on line 19438.  Could very well be a bug with portsdb, a program that is part of portupgrade.


----------



## RedErick (Aug 16, 2013)

Anyway, now without `portupgrade â€“a` Iâ€™m using this sequence of commands in a script in crontab for periodic software updates:

```
portsnap cron update
portmaster -aBd
portaudit -Fda
```


----------



## wblock@ (Aug 17, 2013)

Again: automatic port upgrades without checking /usr/ports/UPDATING for changes first will inevitably lead to problems.


----------



## RedErick (Aug 17, 2013)

You are about /usr/sbin/pkg_updating?


----------



## wblock@ (Aug 17, 2013)

Not directly, no.  /usr/ports/UPDATING is a file of notes about changes in ports and the ports system.  Some upgrade steps have to be done manually.  If you skip those steps and just upgrade every package without taking those special steps, you'll end up with some ports depending on missing libraries or other problems.  So before upgrading or installing new ports, always, yes always, check the new entries in /usr/ports/UPDATING.


----------



## RedErick (Aug 17, 2013)

Thank you!


----------



## SirDice (Aug 22, 2013)

RedErick said:
			
		

> You are about /usr/sbin/pkg_updating?



It simply shows the entries (if there are any) in UPDATING for the packages you have installed.


----------



## wblock@ (Aug 22, 2013)

SirDice said:
			
		

> It simply shows the entries (if there are any) in UPDATING for the packages you have installed.



Well, it tries.  There was an example recently of it not finding an entry due to wildcards being used in the entry.

Also, occasionally there are general instructions in UPDATING that don't apply to any specific port.


----------



## RedErick (Aug 23, 2013)

Hello! 
`portupgrade -a` works fine again!  May be, thanks to `portsnap cron update` and `portmaster -a` ...


----------

