# Trying to upgrade 12 to 13



## blind0ne (Nov 5, 2021)

Hello, I've tryed to install new major version by typing command 'freebsd-update -r 13.0-RELEASE upgrade'

But after few hours of waiting the vi qusest apear and after few screens of entering :wq this step was prefformed:

```
/var/db/freebsd-update/merge/new//etc/syslog.conf: 45 lines, 1675 characters.

The following file will be removed, as it no longer exists in
FreeBSD 13.0-RELEASE: /etc/motd
Does this look reasonable (y/n)? n
```
The whole process stopped? Have I been updated, or I need to start all over again? Please explain what have I done? Am I on a new version?


----------



## SirDice (Nov 5, 2021)

The upgrade phase only downloads and asks a few questions about the changes, it doesn't make any actual changes yet. The actual updating of files is done during the 'install' phases. So just run `freebsd-update -r 13.0-RELEASE upgrade` again.

The first time you run `freebsd-update install` only the kernel is updated. The second run of `freebsd-update install` will update the userland. The third and final `freebsd-update install` will remove any old libraries and other files that need to be removed.


----------



## blind0ne (Nov 5, 2021)

SirDice said:


> The upgrade phase only downloads and asks a few questions about the changes, it doesn't make any actual changes yet. The actual updating of files is done during the 'install' phases. So just run `freebsd-update -r 13.0-RELEASE upgrade` again.
> 
> The first time you run `freebsd-update install` only the kernel is updated. The second run of `freebsd-update install` will update the userland. The third and final `freebsd-update install` will remove any old libraries and other files that need to be removed.


I also would like to delete vi completle, thanks now I understand how to update.


----------



## Geezer (Nov 5, 2021)

Remember to reinstall all your packages.



blind0ne said:


> I also would like to delete vi completle, thanks now I understand how to update.



I also dislike `vi`, so I use export `EDITOR=/usr/bin/ee` . There are a few other threads on this.


----------



## blind0ne (Nov 5, 2021)

Geezer said:


> Remember to reinstall all your packages.
> 
> 
> 
> I also dislike `vi`, so I use export `EDITOR=/usr/bin/ee` . There are a few other threads on this.


I've done install 3 times and loced myself without shell, it wants libncursesw so 8, already tryed to login in single user hoping to change users shell to sh in /etc/passwd, but can't edit it. Even vi is not available, su shell don't no where is it. How can I back on the track. What to do?


----------



## SirDice (Nov 5, 2021)

blind0ne said:


> but can't edit it.


In single user mode only the root filesystem is mounted and read-only. 

For UFS:

```
fsck -y
mount -t ufs -a
swapon -a
```

For ZFS:

```
zfs set readonly=off zroot/ROOT/default
zfs mount -a
swapon -a
```


----------



## blind0ne (Nov 5, 2021)

Finally, mounted ufs and used /usr/bin/ee to edit passwd. Thank you all, helped a lot


----------



## blind0ne (Nov 5, 2021)

Yes, the passwd file was edited, but on multi user boot it tries fish shell, don't know what to do. Could some one help me plz?


----------



## SirDice (Nov 5, 2021)

After a major version upgrade you have to reinstall all your ports/packages. You probably skipped that step. So, login as root (you didn't change root's shell right?), then run `pkg-static upgrade`. Everything should get reinstalled and updated from 12.x versions to 13.0 versions. Then reboot again. Now your fish shell should be working again.


----------



## blind0ne (Nov 5, 2021)

blind0ne said:


> Yes, the passwd file was edited, but on multi user boot it tries fish shell, don't know what to do. Could some one help me plz?


Finally used chsh -s /bin/sh root under single user. Why passwd is usless?


----------



## SirDice (Nov 5, 2021)

blind0ne said:


> Why passwd is usless?


Did you edit /etc/passwd directly? Never do that. The actual account information is stored in a database (/etc/pwd.db).


----------



## blind0ne (Nov 5, 2021)

SirDice said:


> After a major version upgrade you have to reinstall all your ports/packages. You probably skipped that step. So, login as root (you didn't change root's shell right?), then run `pkg-static upgrade`. Everything should get reinstalled and updated from 12.x versions to 13.0 versions. Then reboot again. Now your fish shell should be working again.


yeps looks like I missed this point, already started it, Thank you.


----------



## SirDice (Nov 5, 2021)

blind0ne said:


> Finally used chsh -s /bin/sh root under single user.


Just a friendly tip, never change root's shell. At least not to shell from ports/packages, you will run into problems, as you've found out, if you don't take some special precautions.


----------



## blind0ne (Nov 5, 2021)

SirDice said:


> Did you edit /etc/passwd directly? Never do that. The actual account information is stored in a database (/etc/pwd.db).


Why packgs should be reinstalled? What is difference for major versions?


----------



## SirDice (Nov 5, 2021)

blind0ne said:


> Why packgs should be reinstalled?


Everything.


blind0ne said:


> What is difference for major versions?


You upgraded the base OS. That means newer versions of various system libraries. Executables need to be linked to the correct versions. That's why there are separate repositories for 12 and for 13. Executables specifically built for 12 will not work on 13. They can be made to work by using COMPAT_FREEBSD12 and misc/compat12x but the best way is to install packages that are specifically compiled for 13.


----------



## covacat (Nov 5, 2021)

different versions of system libraries
e.g.
12.x provides libncurses.so.8 and 13.x provides libncurses.so.9
so if you delete the 12.x libs /usr/local/bin/joe won't work anymore if you don't rebuild/reinstall it


----------



## blind0ne (Nov 5, 2021)

finally, evrything seems to work, but I have 1 more question : 
[root@OffGateway /usr/local/monitor]# uname -a
FreeBSD OffGateway 13.0-RELEASE-p4 FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

what is this builder.aemonology.net? That refere for the compiled kernel that was donloaded from somewhere?


----------



## SirDice (Nov 5, 2021)

It's the hostname of the server that built that kernel.


```
FreeBSD molly.dicelan.home 13.0-STABLE FreeBSD 13.0-STABLE #40 stable/13-n247959-f8b998c7305: Tue Nov  2 19:55:52 CET 2021     root@molly.dicelan.home:/usr/obj/usr/src/amd64.amd64/sys/MOLLY  amd64
```
Mine says something else because I've built the kernel myself.


----------

