# FreeBSD 12.1 Upgrade FreeBSD 13.0-RELEASE error



## Alucn (Jan 29, 2022)

Upgrade steps：
# rm -rf /var/db/freebsd-update/*
# freebsd-update fetch
# freebsd-update install
# freebsd-update upgrade -r 13.0-RELEASE
# freebsd-update install
# freebsd-update install
# shutdown -r now
There is an error when you restart

No access to the system


----------



## grahamperrin@ (Jan 29, 2022)

Do you have 12.1 in a ZFS boot environment?

bectl(8)

Perform the minor update to 12.3-RELEASE-p1 before the major upgrade to 13.0-RELEASE-p6.

Under <https://bokut.in/freebsd-patch-level-table/#releng/12.2>, amongst the most significant patches was *FreeBSD-EN-21:08.freebsd-update* (a fix for freebsd-update itself). At a glance, I don't associate the bug with what's in your screenshots, but the minor update is good practice in this case.


Maybe more immediately relevant, <https://www.google.com/search?q="/lib/libmd.so.6:+invalid+file+format"&tbs=li:1#unfucked> ▶ various things of possible interest, including:

three FreeBSD Forums topics, all involving major upgrades.
<https://pastebin.com/crR6WFCG> was me around eleven months ago, experimenting with an upgrade to FreeBSD-based helloSystem.


----------



## grahamperrin@ (Jan 29, 2022)

Alucn said:


> Upgrade steps：
> # rm -rf /var/db/freebsd-update/*
> # freebsd-update fetch
> # freebsd-update install
> ...



At a glance, you either:

omitted a restart; or
omitted to mention use of chroot(8).
Please, is either point true?


----------



## Alucn (Jan 29, 2022)

grahamperrin said:


> At a glance, you either:
> 
> omitted a restart; or
> omitted to mention use of chroot(8).
> Please, is either point true?


thank you! The upgrade was successful again


----------



## grahamperrin@ (Jan 29, 2022)

That's good news. 

Which was it, *1* or *2*?

When you're ready, add the _Solved_ prefix. Thanks.


----------



## SirDice (Jan 31, 2022)

grahamperrin said:


> omitted a restart; or


You don't actually _need_ to reboot after the kernel has been upgraded. So rebooting _after_ you're done is perfectly fine. 

What I am missing here is the reinstallation of all the installed ports/packages. This _must_ be done after a major version upgrade.


----------



## VladiBG (Jan 31, 2022)

Here is short info how i perform major upgrade.

### download update files
`freebsd-update upgrade -r XXX-RELEASE`
## merge the new config files (newsyslog, motd, cron ...)

### Install new kernel and disable old kernel modules like virtualbox kernel module or drm-kmod in /boot/loader.conf and /etc/rc.conf commend out _kld_list_
`freebsd-update install
ee /boot/loader.conf
ee /etc/rc.conf
shutdown -r now`

### Install new userland programs (/usr/bin /usr/sbin ...) and clear the old shared lib. Temporary disable all other services loaded from /usr/local/etc/rc.d/ (apache,MySQL, PostgreSQL) otherwise they will fail to load before rebuilding them against the new shared libraries. (SSH is in the base so don't disable it )

`freebsd-upgrade install
ee /etc/rc.conf
shutdown -r now`

### Reinstall *ALL* userland application so they can be build against new shared libs
### for packages you need first to reinstall the new pkg using pkg-static OR  if pkg still works you can use `pkg bootstrap -f`
`pkg-static upgrade -f pkg`
`pkg update -f`
or if you are using ports
#note you will need to reinstall portupgrade first from the ports tree
`portupgrade -af`
or
`portmaster -af`
Enable the kernel modules which has been disabled after the first install and now are updated for the new kernel (drm-kmod, virtualbox or other custom build modules)
`ee /boot/loader.conf
ee /etc/rc.conf`
`shutdown -r now`


----------



## grahamperrin@ (Jan 31, 2022)

SirDice said:


> reinstallation of all the installed ports/packages.



I can imagine attempting that with what was pictured in the opening post. If I'm taking you out of context, sorry.


----------

