# FreeBSD can't Exec /bin/sh for /etc/rc : Exec format error, after upgrade freeBSD version



## arsyam (Oct 7, 2018)

Dear Master or Developer FreeBSD,

I have a problem after upgrade version freeBSD from 10.0-RELEASE to 10.4-RELEASE.

I have run the following command:

*# freebsd-update -r 10.4-RELEASE upgrade*

And the result is like this (attached)

So what should i do ? 

Run this command : 
*# nextboot -k GENERIC*

Or run this command :
# *shutdown -r now*

# *freebsd-update install*

These are the steps I've done:

*# /sbin/fsck -y

# mount -a 

# mount -a -t ufs

# cp -R /boot/kernel.old /boot/kernel

# reboot*

But still error 

Please help.


Best Regards,
Please help me.


Best Regards,


----------



## SirDice (Oct 8, 2018)

Does this still work? And if it does, what does it output? `file /bin/sh`


----------



## arsyam (Oct 8, 2018)

SirDice said:


> Does this still work? And if it does, what does it output? `file /bin/sh`



Dear SirDice ,

This is the output (attached).

Please help.


Best Regards,


----------



## ShelLuser (Oct 8, 2018)

I think it's time to grab a rescue CD and fix your system that way because that doesn't really look good.  No idea what could have caused this but I highly doubt that this was just the result of running freebsd-upgrade.

So I'd grab a rescue CD for 10.4, boot using that and then see if you can fully access your system. Be sure to make a solid backup of your /etc directory and then you could consider to forcefully re-install the base system by extracting the proper archives from /usr/freebsd-dist.

The down side to this approach is that many config files in /etc are part of the base system and thus would be overwritten, hence the required backup. It's a crude method for sure but at least it'll fix your binary problems.


----------



## SirDice (Oct 8, 2018)

ShelLuser said:


> I think it's time to grab a rescue CD and fix your system that way because that doesn't really look good.


Agreed. I have no idea what went wrong. It looks like some botched 32 bit vs. 64 bit installation (64 bit kernel but 32 bit userland). But this will not happen with freebsd-update(8), it uses the exact same architecture to update. So I have no idea how it got into this state.


----------

