# FreeBSD 12 Upgrade - Failed to delete folders/files



## Mayhem30 (Jan 11, 2019)

I just finished my upgrading to FreeBSD 12.

After rebuilding all ports and doing the last `freebsd-update install` command, it shows :

```
$ sudo freebsd-update install
Installing updates...rmdir: ///var/db/etcupdate/current/usr/share/openssl/man/en.ISO8859-1: Directory not empty
rmdir: ///var/db/etcupdate/current/usr/share/openssl/man: Directory not empty
rmdir: ///var/db/etcupdate/current/usr/share/openssl: Directory not empty
rmdir: ///var/db/etcupdate/current/usr/share/man/en.UTF-8: Directory not empty
rmdir: ///var/db/etcupdate/current/usr/share/man/en.ISO8859-1: Directory not empty
rmdir: ///var/db/etcupdate/current/usr/share/man: Directory not empty
done.
```

Should I just go ahead and manually delete those directories? Also, should I delete the "nls" directory in there as well?


----------



## malavon (Jan 11, 2019)

I've seen the same while I was upgrading my VMs today. I didn't see it on another machine that I upgraded earlier (but also today).
While I can't help you, I'm going to keep an eye on this thread since I didn't want to remove these files until I knew more.


----------



## Mayhem30 (Jan 14, 2019)

Is the FreeBSD development team aware of this issue? Are these file safe to delete?


----------



## SirDice (Jan 14, 2019)

Those directories are part of etcupdate(8), which is typically only used with installworld. Was this previously a -CURRENT or -STABLE that got converted to a -RELEASE?


----------



## Mayhem30 (Jan 14, 2019)

No, I've only ever installed / upgraded using RELEASE.


----------



## SirDice (Jan 14, 2019)

Run `etcupdate diff` and `etcupdate status` to see if there's anything still left to be done. If both don't result in anything you can probably remove those directories.


----------



## malavon (Jan 14, 2019)

Well, I can update for my situation as well. I updated from 11.2-RELEASE(-p?) to 12.0-RELEASE-p2.
I've performed in total 11 updates: 9 VMs running on 2 servers, 1 physical server and one physical desktop.
7 VMs (on ESXi, the other 2 on BHyve - probably not related) and the desktop  had this issue and I might simply not have noticed on the other two.

It is possible that I did an update to the latest 11.2 before I upgraded to 12.0 on the first two that I did not do on the later ones.
I still have one desktop to do, I'll try to verify that if possible.

`etcupdate diff` results in a big diff, curiously as far as I can see it's all been applied already.
`etcupdate status` returns nothing

Is there a possibility to verify that everything has been applied already? I can do it manually, but I'm guessing this can be done automatically as well.


----------



## Mayhem30 (Jan 16, 2019)

I have manually verified the diff file and all changes were applied.

What should I be removing? `rm -rf /var/db/etcupdate/*` ?


----------



## SirDice (Jan 16, 2019)

Yes, that looks good. If you're still somewhat unsure you can always rename the directory. That will move it out of the way, if you happen to get errors with some updates you can then rename it back or look through the data to see what's missing.


----------



## proton1234 (Nov 5, 2019)

Mayhem30 said:


> I just finished my upgrading to FreeBSD 12.
> 
> After rebuilding all ports and doing the last `freebsd-update install` command, it shows :
> 
> ...



Trying to upgrade to 12.1 from 11.2 version and having same problem. Also I tried to upgrade 11.2 to 11.3 and then to 12.1. Upgrade from 11.2 to 11.3 was Ok but from 11.3 to 12.1 or 12.0 got same problems. I even don't know how to check whether the update went correctly or not.


malavon said:


> etcupdate diff results in a big diff, curiously as far as I can see it's all been applied already.
> etcupdate status returns nothing


etcupdate diff returns many text lines
etcupdate status returns nothing


----------



## trev (Nov 6, 2019)

Same issue upgrading 11.3-RELEASE-p3 to 12.1-RELEASE.

I deleted the /var/db/etcupdate directory and all seems well enough thus far


----------



## proton1234 (Nov 8, 2019)

trev said:


> and all seems well enough thus far


how can you be sure about that?


----------



## Mayhem30 (Nov 8, 2019)

trev said:


> I deleted the /var/db/etcupdate directory and all seems well enough thus far



That directory needs to exist before your next OS upgrade or else it will produce errors during the install.


----------



## trev (Nov 8, 2019)

Mayhem30 said:


> That directory needs to exist before your next OS upgrade or else it will produce errors during the install.



I better put it back then... thanks for the advice.


----------



## Mayhem30 (Nov 9, 2019)

Anytime! I found out the hard way on my backup box. Without the directory, you can expect results like this :


```
sudo freebsd-update install
Installing updates...install: ///var/db/etcupdate/current/etc/devd/iwmbtfw.conf: No such file or directory
install: ///var/db/etcupdate/current/etc/rc.d/ippool: No such file or directory
...
...
```


----------



## proton1234 (Nov 12, 2019)

Ok so what can we do next? Just wait for next version of 11.3 where this issue will be fixed?


----------



## trev (May 3, 2020)

Just had the issue again after upgrading a cloud server from 11.3-REL to 12.1-REL.

On checking, all the files left had already been updated, so I deleted the files leaving the directory empty for next time


----------



## Tim L (May 12, 2021)

I saw those same errors.  Luckily I have a clean install of 12.2 which I can check. It doesn't have:

```
/var/db/etcupdate/current/usr/share/man
/var/db/etcupdate/current/usr/share/openssl
```
So it's most likely safe to delete them.   In any case that's what freebsd-update was trying to do.

But the 12.2 clean install has /var/db/etcupdate/current/usr/share/  and a nls subdir.  So you should probably leave those.


----------

