Solved Upgrading to 13.0-RELEASE; locked out of ssh



Reaction score: 12
Messages: 23


I upgraded to 13.0-RELEASE, and now it looks like the upgrade process broke a dependency, and I am locked out of the server:

FreeBSD 13.0-RELEASE (GENERIC) #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021
Welcome to FreeBSD!

Release Notes, Errata:
Security Advisories:
FreeBSD Handbook:
Questions List:
FreeBSD Forums:

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

To change this login announcement, see motd(5). Shared object "" not found, required by "zsh"

Then since the shell can't start, the SSH connection closes.

Why did this happen? How can I resolve it?



Reaction score: 37
Messages: 98

I'd attempt booting with a recovery media (i.e. using an ISO if it's a VM or USB media otherwise); then you can mount your root partition and chroot into it. If you're using a regular install media, it should give you an option to run a shell.

Check which disk you need to mount (i.e. use geom disk list). Then mount your root partition. For example, if your root partition is on ada0p1:

mount /dev/ada0p1 /mnt

Then chroot:

chroot /mnt /bin/sh

Then, you should be able to use pw like usual to change your user's shell to one in core, i.e. sh or csh:

pw usermod <user> -s /bin/sh

For future upgrades, I highly recommend having a backup user that uses one of the built-in shells. Or, if you're building your shell from ports - maybe check, if you can do a static build. I believe bash offers that. Not sure about zsh though.

Forgot in intial reply: as to why this happend... upgrading your system updates relevant base libraries that were linked when you installed zsh. The updated libraries may have changed their version numbers, hence the file that your zsh is referencing, no longer exists.
That's why it's quite important to also reinstall all your packages/ports, once you've finished your upgrade.


Active Member

Reaction score: 59
Messages: 147

Looks like that you did not reinstall all packages before the last freebsd-update install step.
Did you follow

And the related part about reinstalling all the packages ?

So to answer: Why did this happen ?
The last freebsd-update install command will remove old libraries, but since zsh was not reinstalled it still links to /lib/ instead of /lib/


Well-Known Member

Reaction score: 116
Messages: 282

Looks like cmoerz and monwarez were faster, just follow their advice. The problem is your zsh shell, it is not part of the base system. It needs to be reinstalled to function.


Well-Known Member

Reaction score: 219
Messages: 463

if you can login at console (you have physical access) just login as root and change your shell to sh or [t]csh
then you can fix missing libs
chsh -s /bin/sh user

or just fix libs as root



Reaction score: 12
Messages: 23

Here's what I did to upgrade:

sudo freebsd-update -r 13.0-RELEASE upgrade
It asked me to merge some config files, then
sudo freebsd-update -r 13.0-RELEASE install
It said:
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates.
But I hadn't installed any ports, so I just went ahead and ran again:
sudo freebsd-update -r 13.0-RELEASE install

I'm guessing that I missed Upgrading Packages After a Major Version Upgrade​

in the handbook and I should have run "pkg upgrade" after the first "install" and before the second "install." I think I thought I only needed to do anything if ports were installed, not pkg.


Active Member

Reaction score: 199
Messages: 244

Well, a package is nothing else than a pre-built port, so if you have packages installed, you do have ports installed :)



Reaction score: 12
Messages: 23

I ended up fixing it by rebooting into single-user mode via the cloud provider's web console. Then I re-mounted the root filesystem as read/write, changed my user shell to sh, and rebooted back into multi user mode. Then I was able to ssh in and do a pkg upgrade. After than zsh started properly. Thank you for the help, everyone.



Reaction score: 901
Messages: 2,049

As the thread originator, you can mark the thread solved. Go to the first post, click the edit button and you'll see there's an option to put in a prefix. One of the prefixes is Solved.