# freebsd 11 locale problem



## mururoa (Oct 19, 2016)

Hi there,

Already 2 times I try to update from latest 10.3 to 11.0 but I can't get it ok. There is a problem with the PostgreSQL database. Something about locale. This is a zabbix server. Fortunatly it's a vmware VM so it ends with revert to snapshot.
Before I try a 3rd time to get exact error messages, does someone had the same problem and solved it ? I mean upgrade 10.3 --> 11 and then PostgreSQL not available any more ?


----------



## marino (Oct 19, 2016)

mururoa said:


> There is a problem with the postgreSQL database. Something about locale.
> This is a zabbix server.


"something about locale" ?  Are we supposed to guess?


----------



## mururoa (Oct 19, 2016)

marino@ said:


> "something about locale" ?  Are we supposed to guess?


Yes !
Ok, I'm gone for a 3rd upgrade trial.


----------



## mururoa (Oct 20, 2016)

At the very end of ugrade I get things like that :


```
sudo su -
sudo: error in /usr/local/etc/sudo.conf, line 0 while loading plugin `sudoers_policy'
sudo: unable to load /usr/local/libexec/sudo/sudoers.so: Shared object "libpam.so.5" not found, required by "sudoers.so"
sudo: fatal error, unable to load plugins
```

And about postgres and locale :


```
632:20161019:223929.275 watchdog: database is down
   614:20161019:223941.665 Got signal [signal:15(SIGTERM),sender_pid:28160,sender_uid:0,reason:65537]. Exiting ...
   614:20161019:223943.710 [Z3001] connection to database 'zabbix' failed: [0] FATAL:  database locale is incompatible with operating system
DETAIL:  The database was initialized with LC_CTYPE "en_US.UTF-8",  which is not recognized by setlocale().
HINT:  Recreate the database with another locale or install the missing locale.

   614:20161019:223943.710 Cannot connect to the database. Exiting...
```

Ofc, sudo postgres and the rest were ok in 10.3.


----------



## marino (Oct 20, 2016)

so it's not a postgresql issue, it's a `sudo` issue.

The upgrade procedure says to rebuild / reinstall all packages after a major release upgrade.  It sounds like you didn't do it.  Either that or you are failing while trying to do it.
Can't you just remove all packages and reinstall them?


----------



## Remington (Oct 20, 2016)

You should not use `sudo` in FreeBSD.  You should login as root or superuser but not sudo as it is not part of the base system.

To upgrade your pkg to FreeBSD 11 pkg, issue this command `pkg-static install -f pkg`

Login as root and then do `pkg upgrade -f` to reinstall everything.


----------



## mururoa (Oct 20, 2016)

marino@ said:


> so it's not a postgresql issue, it's a `sudo` issue.
> 
> The upgrade procedure says to rebuild / reinstall all packages after a major release upgrade.  It sounds like you didn't do it.  Either that or you are failing while trying to do it.
> Can't you just remove all packages and reinstall them?


Just rebuilt the Zabbix server port and upgraded all the packages.
And the result is ok.
I think I just did it at the wrong time. Maybe rebuilt too soon or rebooted before pkg upgrade or something like that.
Thanks anyway.


----------

