Howdy mates!
Recently I was upgrading one box, which previously was running 7.2 to 8.0. I was reading through FreeBSD’s handbook section “24.2 FreeBSD Update†and encountered these lines, which needed to be executed in order to rebuild and reinstall all 3-party programs form ports collection:
Since I am technologically curious person I was wondering can anyone give me more inside about what actually these command do and why they are needed. Duh I know that first line forces rebuild of port “rubyâ€, the second deletes /var/db/pkg/pkgdb.db file, third forces rebuild of “ruby18-bdb†port, fourth again deletes /var/db/pkg/pkgdb.db and /usr/ports/INDEX-*.db (all files which begin with INDEX- and end with “.dbâ€) and fifth forces rebuild of all ports installed.
What I am asking is:
1. Elaborate please why port ruby needs to be rebuilt (as I understand this is because all or part of it was destroyed when upgrade was performed)?
2. What is the inner reason of deleting /var/db/pkg/pkgdb.db file at this stage on line two?
3. Elaborate please why port ruby18-bdb needs to be rebuilt at this stage? As far as I understand this is ruby’s interface to some database engine.
4. What is the inner reason of deleting again /var/db/pkg/pkgdb.db file and all INDEX-*.db files on line four?
5. Well fifth line orders the rebuilt of all ports, which is obvious…
No need to explain why. 
Thank YOU all guys (and girls) for taking your time to read and hopefully answer my questions!
I wish you all a very nice day!
Best regards to all,
Paulius
P.S.
Correct me if I am wrong but all these steps need to be taken if portupgrade was installed on the old OS, which got upgraded. Not from the ports collection after upgrade was made, with the help of portsnap fetch update ports were updated and then portupgrade installed?
Now I know I’ve put here very lot of questions... :stud
Recently I was upgrading one box, which previously was running 7.2 to 8.0. I was reading through FreeBSD’s handbook section “24.2 FreeBSD Update†and encountered these lines, which needed to be executed in order to rebuild and reinstall all 3-party programs form ports collection:
Code:
# portupgrade -f ruby
# rm /var/db/pkg/pkgdb.db
# portupgrade -f ruby18-bdb
# rm /var/db/pkg/pkgdb.db /usr/ports/INDEX-*.db
# portupgrade -af
What I am asking is:
1. Elaborate please why port ruby needs to be rebuilt (as I understand this is because all or part of it was destroyed when upgrade was performed)?
2. What is the inner reason of deleting /var/db/pkg/pkgdb.db file at this stage on line two?
3. Elaborate please why port ruby18-bdb needs to be rebuilt at this stage? As far as I understand this is ruby’s interface to some database engine.
4. What is the inner reason of deleting again /var/db/pkg/pkgdb.db file and all INDEX-*.db files on line four?
5. Well fifth line orders the rebuilt of all ports, which is obvious…


Thank YOU all guys (and girls) for taking your time to read and hopefully answer my questions!
I wish you all a very nice day!
Best regards to all,
Paulius
P.S.
Correct me if I am wrong but all these steps need to be taken if portupgrade was installed on the old OS, which got upgraded. Not from the ports collection after upgrade was made, with the help of portsnap fetch update ports were updated and then portupgrade installed?
Now I know I’ve put here very lot of questions... :stud