Solved How to Upgrade FreeBSD 8.2 to 10.1?

Hi all,
My first question in FreeBSD community, sorry my poor English.

I have 2 FreeBSD servers left by previous admin, both running FreeBSD 8.2. I want to upgrade them to 10.1, and already finished one, the process was full of difficulties, but all fixed at last.

Now I am ready to begin the last one, here is the list of steps. I hope you can help me check if they are OK, if the order is OK. I have little experience to upgrade FreeBSD like that.

1, use freebsd-update(8) tool upgrade base system to 9.x
2, use freebsd-update(8) tool upgrade base system to 10.x
3, run the pkg2ng command
4, rebuild all ports software only once, and done.

If the order correct for me? Thanks for your help advanced.
 
Looks correct. If the ports were built with the default options, you could instead use # pkg upgrade -f to update all of the packages.
 
There is one complication with packages that you may care about. The old-style package list did not distinguish between directly-installed (non-automatic) packages and dependency-installed (automatic) packages. So when you convert using pkg2ng it assumes all packages were directly-installed (non-automatic). This inhibits pkg autoremove from working and may prove confusing further down the line.

When I look at my list of packages it correctly tells me which I installed and which were installed as dependencies.

Code:
# pkg query -e "%a == 0" "DIRECT %n-%v" | wc -l
  60
# pkg query -e "%a == 1" "DEPENDENCY %n-%v" | wc -l
  187

When I upgraded from 8 to 9, I took the route of dumping the list of packages and manually pruning the list down to exclude the dependencies. Then I used portmaster to specifically install the packages I wanted under the pkgng world.

But if you use pkg2ng, you can manually adjust the direct/dependent (non-auto/auto) setting by using pkg set, here is an example.

Code:
pkg query -a 'pkg set -A %a %n'

Just change 0 to 1 for anything that should be a dependent (auto) package and then run the resulting script.
 
Thanks both. Yestreday evening base system update is OK. When I run pkg2ng command, there was always error like this, I remember it was there when I upgraded the first FreeBSD 8.2 server, but looks not serious.

After running pkg2ng, it showed:
Code:
Checking all packages:  92%Assertion failed: (name != NULL && name[0] != '\0'), function pkg_addshlib_provided, file pkg.c, line 1311.
Child process pid=76881 terminated abnormally: Abort trap
 
That is probably some bad data in /var/db/pkg/...

I seem to recall there was a way to sanity check or rebuild that data (maybe pkgdb? (no its not, see following post) -- be SURE to back up your pkg.db before fiddling with it!

The other option is to just take a list of the installed packages (from /var/db/pkg) and reinstall everything fresh via portmaster. The conversion process is annoying, but once you're done pkgng works very nicely.
 
That is probably some bad data in /var/db/pkg/...

I seem to recall there was a way to sanity check or rebuild that data (maybe
pkgdb -Ffuv
? -- see https://forums.freebsd.org/threads/pkgdb-problem.28903/
but be SURE to back up your pkg.db before fiddling with it!

The other option is to just take a list of the installed packages (from /var/db/pkg) and reinstall everything fresh via portmaster. The conversion process is annoying, but once you're done pkgng works very nicely.

The pkgdb command is not part of the ports-mgmt/pkg suite. It's from ports-mgmt/portupgrade and shouldn't be used to fix pkg(8) problems at all. For the OP commando, the command you want to run is # pkg check -Bds -av, this will hopefully correct at least some of the dependency and shared library problems.
 
The pkgdb command is not part of the ports-mgmt/pkg suite. It's from ports-mgmt/portupgrade and shouldn't be used to fix pkg(8) problems at all. For the OP commando, the command you want to run is # pkg check -Bds -av, this will hopefully correct at least some of the dependency and shared library problems.
Hi dear,
Before see your post, I have finished rebuilding all ports software, a little difficulty, but all done.
I tried to run your command, only one line not good like this,
Code:
[37/295] Checking db42-4.2.52_5: dependencies... checksums...db42-4.2.52_5: checksum mismatch for /usr/local/bin/berkeley_db_svc-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_archive-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_checkpoint-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_deadlock-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_dump-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_dump185-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_load-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_printlog-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_recover-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_stat-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_upgrade-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/bin/db_verify-4.2
db42-4.2.52_5: checksum mismatch for /usr/local/lib/db42/libdb-4.2.so
db42-4.2.52_5: checksum mismatch for /usr/local/lib/db42/libdb-4.so
db42-4.2.52_5: checksum mismatch for /usr/local/lib/db42/libdb.so
db42-4.2.52_5: checksum mismatch for /usr/local/lib/db42/libdb_cxx-4.2.so
db42-4.2.52_5: checksum mismatch for /usr/local/lib/db42/libdb_cxx-4.so
db42-4.2.52_5: checksum mismatch for /usr/local/lib/db42/libdb_cxx.so
db42-4.2.52_5: checksum mismatch for /usr/local/lib/libdb-4.2.so
db42-4.2.52_5: checksum mismatch for /usr/local/lib/libdb-4.2.so.2
db42-4.2.52_5: checksum mismatch for /usr/local/lib/libdb_cxx-4.2.so
db42-4.2.52_5: checksum mismatch for /usr/local/lib/libdb_cxx-4.2.so.2
 shared libraries... done

Is it serious?

First question in FreeBSD official forum, learnt a lot :D

Thanks everyone~!
 
Back
Top