# Upgrade FreeBSD 7.2 to 8.0



## xy16644 (Nov 27, 2009)

I have just finished downloading the FreeBSD 8.0 RELEASE ISO after finding out it was released today. This will be my first ever attempt at upgrading a FreeBSD server from version 7.2 to 8.0.

Currently I am running:

```
FreeBSD 7.2-RELEASE-p2 #0: Wed Jun 24 00:57:44 UTC 2009     root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC
```

What is the best way to approach this? I have read the release notes and they mentioned two options:

1) freebsd-update utility

2) Using the upgrade option from the sysinstall DVD

I run the GENERIC kernel and have about 150 ports installed on my machine which I want to be taken across successfully after the upgrade!

I'd prefer to use the DVD upgrade option as then I don't have to wait hours as it downloads stuff from the net (when using the freebsd-update utilty).

Thanks for any input/suggestions! Can't wait to try version 8.0.

:e


----------



## vivek (Nov 27, 2009)

freebsd-update seems like good choice for GENERIC kernels. See http://www.freebsd.org/releases/8.0R/announce.html (look for freebsd-update  info).


----------



## xy16644 (Nov 27, 2009)

This may sound like a silly thing to ask but, can I run freebsd-update WHILE logged into the server via SSH to upgrade from 7.2 to 8.0? Or should I rather do this while logged in at the console?


----------



## icer (Nov 27, 2009)

you can do it from ssh )


----------



## xy16644 (Nov 29, 2009)

*Help!*

I just finished upgrading my server to 8.0 RELEASE and I have some serious problems I hope you wouldn't mind helping me with! This was my first upgrade so I was unsure of what I was doing...

Everything seemed to go fine until I rebooted the server.

If I run a uname -a it says:

```
FreeBSD myserver 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys
/GENERIC  i386
```

So I know it has upgraded it. However, many services won't start such as Apache and Postfix. SSH initially didn't start and when I looked at the config file (while logged on the console) there were some weird comments that 8.0 had put in the file as follows: <<<<<<< current version and >>>>>>> 8.0-RELEASE
. Anyway, I commented those out and SSH works fine like it used to.

When I try to start Apache it says:

```
alpha# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
httpd: Syntax error on line 110 of /usr/local/etc/apache22/httpd.conf: Cannot load /usr/local/libexec/apache22/libphp5.so into server: Shared 
object "libcrypt.so.4" not found, required by "libphp5.so"
```

I can start the Postfix service but when I look in the /var/log/maillog logfile it says:

```
Nov 29 09:11:44 alpha imapd-ssl: /libexec/ld-elf.so.1: Shared object "libz.so.4" not found, required by "libssl.so.5"
Nov 29 09:16:44 alpha imapd-ssl: /libexec/ld-elf.so.1: Shared object "libz.so.4" not found, required by "libssl.so.5"
Nov 29 09:21:44 alpha imapd-ssl: /libexec/ld-elf.so.1: Shared object "libz.so.4" not found, required by "libssl.so.5"
```

and

```
Nov 29 09:10:10 alpha authdaemond: /libexec/ld-elf.so.1: Shared object "libcrypt.so.4" not found, required by libcourierauthcommon.so"
```

and

```
Nov 29 09:05:14 alpha spamd[846]: logger: removing stderr method
Nov 29 09:05:16 alpha spamd[848]: Can't load '/usr/local/lib/perl5/site_perl/5.8.9/mach/auto/Crypt/OpenSSL/Bign
Nov 29 09:05:16 alpha spamd[848]:  at /usr/local/lib/perl5/site_perl/5.8.9/mach/Crypt/OpenSSL/RSA.pm line 17
Nov 29 09:05:16 alpha spamd[848]: Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.9/mach/Cr
Nov 29 09:05:17 alpha spamd[848]: Can't load '/usr/local/lib/perl5/site_perl/5.8.9/mach/auto/Crypt/OpenSSL/RSA/
Nov 29 09:05:17 alpha spamd[848]:  at /usr/local/lib/perl5/site_perl/5.8.9/Mail/DKIM/PublicKey.pm line 288
Nov 29 09:05:17 alpha spamd[848]: Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.9/Mail/DK
Nov 29 09:05:17 alpha spamd[848]: Can't load '/usr/local/lib/perl5/site_perl/5.8.9/mach/auto/Crypt/OpenSSL/RSA/
Nov 29 09:05:17 alpha spamd[848]:  at /usr/local/lib/perl5/site_perl/5.8.9/Mail/DKIM/PublicKey.pm line 288
Nov 29 09:05:17 alpha spamd[848]: Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.9/Mail/DK
Nov 29 09:05:17 alpha spamd[848]: BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.8.9/Mai
Nov 29 09:05:17 alpha spamd[848]: Compilation failed in require at /usr/local/lib/perl5/site_perl/5.8.9/Mail/DK
Nov 29 09:05:17 alpha spamd[848]: Can't load '/usr/local/lib/perl5/site_perl/5.8.9/mach/auto/Crypt/OpenSSL/RSA/
Nov 29 09:05:17 alpha spamd[848]:  at /usr/local/lib/perl5/site_perl/5.8.9/Mail/DKIM/PublicKey.pm line 288
```

Can anyone help me please? I'm feeling quite lost (and embarressed! :r) that this went really wrong! I'm guessing I need to (re)install some shared libraries to get all my services to work correctly?

Thank you! :e


----------



## xy16644 (Nov 29, 2009)

I'm really battling with this ;-(

Tried to google the error message for Apache but I haven't come up with anything helpful so far.

Has anyone come across this error message before?

Postfix is still receiving and processing email but I can't access them with Thunderbird or with Squirrelmail/Roundcube as IMAP/authlib and Apache is broken!


----------



## ohauer (Nov 29, 2009)

> Nov 29 09:21:44 alpha imapd-ssl: /libexec/ld-elf.so.1: Shared object "libz.so.4" not found, required by "libssl.so.5"
> Nov 29 09:10:10 alpha authdaemond: /libexec/ld-elf.so.1: Shared object "libcrypt.so.4" not found, required by libcourierauthcommon.so"


I guess you have not rebuild your ports or still using RC/7.x packages.

There was a version bump for the libs and I guess you have done a `# make delete-old-libs`

Best way is to rebuild all ports.


----------



## xy16644 (Nov 29, 2009)

So do I just run the command you mentioned:

```
make delete-old-libs
```

I just want to be sure as I don't want to make it worse lol

PS: I did run portupgrade -af, I thought this did rebuild all my ports?!


----------



## knarf (Nov 29, 2009)

Install misc/compat7x and everything will work again.

I use sysutils/libchk and pkg_which in order to identify which packages are linked against libs in /usr/local/lib/compat. I rebuild those using [cmd=]portupgrade -f[/cmd].


----------



## xy16644 (Nov 29, 2009)

knarf said:
			
		

> Install misc/compat7x and everything will work again.
> 
> I use sysutils/libchk and pkg_which in order to identify which packages are linked against libs in /usr/local/lib/compat. I rebuild those using portupgrade -f.



Is this the only way to get everything working again? Just install the compat7x port? Do I need to do anything else once the port is installed?


----------



## knarf (Nov 29, 2009)

xy16644 said:
			
		

> So do I just run the command you mentioned:
> 
> ```
> make delete-old-libs
> ...



He said you ran '[font="Lucida Console"]make delete-old-libs[/font]' already, which deleted your old libs and caused the problem.

If you ran '[font="Lucida Console"]portupgrade -af[/font]' successfully, the problem should be gone. I don't like '[font="Lucida Console"]portupgrade -af[/font]' because it has to run through at once. If it fails, you will have to run the whole process again or find a way to find out which ports are already linked against the new libs and which not.

Maybe you want to try sysutils/libchk.


----------



## xy16644 (Nov 29, 2009)

Thanks for the help. I am busy installing misc/compat7x port. Really hope this does the trick.

Will look at sysutils/libchk too.

Give me a few minutes and I will report back after misc/compat7x is installed!


----------



## knarf (Nov 29, 2009)

xy16644 said:
			
		

> Is this the only way to get everything working again? Just install the compat7x port? Do I need to do anything else once the port is installed?



We should bring our communication in sync. 

[font="Lucida Console"]portinstall misc/compat7x[/font] will fix your problem at once. Nothing else has to be done.

BUT: You said you already did a [font="Lucida Console"]portupgrade -af[/font]. IF it ran through you should no longer see these problems and there should be no need to install the compat7x libraries.


----------



## xy16644 (Nov 29, 2009)

knarf said:
			
		

> We should bring our communication in sync.
> 
> [font="Lucida Console"]portinstall misc/compat7x[/font] will fix your problem at once. Nothing else has to be done.
> 
> BUT: You said you already did a [font="Lucida Console"]portupgrade -af[/font]. IF it ran through you should no longer see these problems and there should be no need to install the compat7x libraries.



You so the man, it works!!!!! :e:e:e:e

Thank you!

I really panicked after I rebooted the machine as I didn't know what was happening (its my first FreeBSD upgrade and have only been running FreeBSD 7.2 for about 4mths).


----------



## xy16644 (Nov 29, 2009)

I am still really baffled why the upgrade process added:
<<<<<<< current version

and

>>>>>>> 8.0-RELEASE

to my sshd_config file? It prevented the sshd service from starting!


----------



## xy16644 (Nov 29, 2009)

I'm still not sure where I went wrong so I thought I would post the commands I ran. I follwed the instructions at the following two web sites:

http://www.freebsd.org/releases/8.0R/announce.html

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

Commands (in order):

```
freebsd-update upgrade -r 8.0-RELEASE

freebsd-update install

shutdown -r now

freebsd-update install
```

Everything worked great up until here.

Then:

```
portupgrade -f ruby\*

rm /var/db/pkg/pkgdb.db

portupgrade -af (this took ages as I have 153 ports)

freebsd-update install

shutdown -r now
```

After this reboot is when I started getting all the weird SSH, Apache and IMAP errors.

Does anyone know what I did wrong? I'm guessing I shouldn't have followed the portupgrade steps?

Funny thing is before I ran the portupgrade commands, I was upgraded to FreeBSD 8.0 RELEASE and everything worked!


----------



## knarf (Nov 29, 2009)

xy16644 said:
			
		

> I am still really baffled why the upgrade process added:
> <<<<<<< current version
> 
> and
> ...



You were using `# freebsd-update`? I hate this tool and will not use it unless it uses `# mergemaster` instead of this strange merge "utility". I hope you did not make the same mistake for all of your files in /etc... Try to run `# mergemaster -Ui` now.


----------



## xy16644 (Nov 29, 2009)

knarf said:
			
		

> You were using freebsd-update? I hate this tool and will not use it unless it uses mergemaster instead of this strange merge "utility". I hope you did not make the same mistake for all of your files in /etc... Try to run mergemaster -Ui now.



I am not familiar with this tool at all so I did a man mergemaster and it highly recommended that I backup my /etc directory which I have done.

I'm feeling a bit nervous about running this...


----------



## knarf (Nov 29, 2009)

xy16644 said:
			
		

> I am not familiar with this tool at all so I did a man mergemaster and it highly recommended that I backup my /etc directory which I have done.
> 
> I'm feeling a bit nervous about running this...



mergemaster is a very good highly interactive tool. Just give it a try. Snapshot and/or backup /etc and /var/namedb before. But you will see, you can trust it and it does nothing you do not want. You can skip all the changes if you do not want them. You can run it as often as you like.

Anyone has an idea why freebsd-update does not use mergemaster?


----------



## xy16644 (Nov 29, 2009)

When I tried to run it now it said:

```
alpha# mergemaster -Ui

*** Creating the temporary root environment in /var/tmp/temproot
 *** /var/tmp/temproot ready for use
 *** Creating and populating directory structure in /var/tmp/temproot

make: don't know how to make distrib-dirs. Stop

  *** FATAL ERROR: Cannot 'cd' to /usr/src and install files to
      the temproot environment
```


----------



## DutchDaemon (Nov 29, 2009)

knarf said:
			
		

> Anyone has an idea why freebsd-update does not use mergemaster?



freebsd-update doesn't install the base system's source code in /usr/src/ by default, and that's what mergemaster relies on for its comparisons.


----------



## knarf (Nov 29, 2009)

xy16644 said:
			
		

> When I tried to run it now it said:
> 
> ```
> alpha# mergemaster -Ui
> ...



As DutchDeamon said, mergemaster relies on /usr/src - just extract it from CD/DVD using `# sysinstall` or `# install.sh` in the src directory.


----------



## xy16644 (Nov 29, 2009)

knarf said:
			
		

> As DutchDeamon said, mergemaster relies on /usr/src - just extract it from CD/DVD using `# sysinstall` or `# install.sh` in the src directory.



I tried running install.sh from /usr/src but I just get a command not found. What is the correct way of doing this?

I could run sysinstall but wasn't sure where to go from there!

Update: I managed to copy all the source code from the DVD using sysinstall. When running mergemaster -Ui
 it has asked me:

```
*** Beginning comparison

   *** Checking /etc/rc.d for stale files

   *** The following files exist in /etc/rc.d but not in
       /var/tmp/temproot/etc/rc.d/:

 sshd

       The presence of stale files in this directory can cause the
       dreaded unpredictable results, and therefore it is highly
       recommended that you delete them.

   *** Delete them now? [n]
```

Is it safe to say yes?


----------



## knarf (Nov 30, 2009)

xy16644 said:
			
		

> I tried running install.sh from /usr/src but I just get a command not found. What is the correct way of doing this?
> 
> I could run sysinstall but wasn't sure where to go from there!
> 
> ...



No. You see, mergemaster is a tool you can trust.

Something went wrong. Have a look at /usr/src. Does /usr/src/etc/rc.d/sshd exist? If not, remove /usr/src and try again.

Regarding [CMD="@"]install.sh[/CMD]. It's somewhere on the disc, I think it was something like /dist/8.0-RELEASE/src, I have no idea if you have mounted your cdrom there, maybe under /cdrom. You have to run `# ./install.sh all` there.

If you have internet, you can also run `# csup -h cvsup.freebsd.org -g -L 2 /usr/share/examples/cvsup/standard-supfile`. This will take a while but it will give you security patches in the future. Okay, freebsd-update will do the same, but the option of mergemaster is so much better than the unuseable version of freebsd-update.


----------



## ecables (Dec 3, 2009)

I ran into the same problem as xy with the shared libraries.  The final iteration of 'freebsd-update install' removes all the "old" libraries, and the subsequent reload creates havoc.

I followed the instructions, as did xy, but somewhere along the way something must have broke that wasn't apparent.  This isn't the first post I've seen where this has happened, and I doubt it will be the last.

I'm in the process of using libchk (thanks for the tip) to identify which installed ports need to be updated, I think I've identified most of them, but I know there are a few stragglers left in hiding.


----------



## xy16644 (Dec 10, 2009)

I have to say, I'm still not 100% sure what mergemaster -Ui does or WHY I need to run this. I understand why I needed to install the 7.x libraries (to get all my ports/software working again).

Does mergemaster just clean up my system after the upgrade from 7.2 to 8.0?

One other thing, whenever a security alert is announced, if I run:

```
freebsd-update fetch
freebsd-update install
```
Does this install the latest security patches that are available to resolve the issues released in the security announcements?


----------



## Beastie (Dec 10, 2009)

xy16644 said:
			
		

> I have to say, I'm still not 100% sure what mergemaster -Ui does or WHY I need to run this.


As the name implies, it merges configuration files when you upgrade your system. To find out what the options do, you should really, really, start reading some man pages (mergemaster(8)). Please!



			
				xy16644 said:
			
		

> ```
> freebsd-update fetch
> freebsd-update install
> ```
> Does this install the latest security patches that are available to resolve the issues released in the security announcements?


Yes, it installs *binary* security and errata patches. Try it and see for yourself. When you'll run `% uname -a`, you'll see there's now a patch level or the existing patch level was increased (X.Y-RELEASE-pN, N being the patch level).


----------



## phospher (Dec 12, 2009)

i ran into some of these same problems but my question is where did my docs go after the upgrade from 7.2 to 8.0? there are no more docs in /usr/share/doc/en_US.ISO8859-1/

anyone know how upgrade handles this?

thanks,


----------



## DutchDaemon (Dec 12, 2009)

If you have the source tree, you should be able to find them in /usr/src/release/doc/en_US.ISO8859-1. They're probably not installed because a 'make' in there produces a fatal error. I'll see if that warrants a PR.


----------



## DutchDaemon (Dec 13, 2009)

The docs people replied thusly:



> This seems to be a misunderstanding. The docs under the src/release are
> not supposed to be built during "make buildworld" ("make installworld"
> does not build anything anyway.) Nor are are they supposed to build just by
> typing "make" in one of the directories. (In fact, much of the FreeBSD
> ...


----------

