[SOLVED]mkdir: /var/cache/opnsense-update: No such file or directory

Started by neilb, April 06, 2023, 07:31:11 PM

Previous topic - Next topic
I have just upgraded (successfully?) to 22.7_4 and there are 90 packages to upgrade to take me to 22.7_11. However, I unable to upgrade packages due to the following error:
mkdir: /var/cache/opnsense-update: No such file or directory

Listing the cache directory gives:
root@OPNsense:/var/cache # ls -las
total 24
8 drwxr-xr-x   3 root  wheel  512 Apr  6 16:00 .
8 drwxr-xr-x  28 root  wheel  512 Apr  6 16:20 ..
8 drwx------   2 www   www    512 Jan 25  2021 lighttpd
0 lrwxr-xr-x   1 root  wheel    0 Apr  6 16:00 opnsense-patch ->
0 lrwxr-xr-x   1 root  wheel    0 Apr  6 16:00 opnsense-update ->
0 lrwxr-xr-x   1 root  wheel    0 Apr  6 16:00 pkg ->


... it would appear there is no link destination.

Where should opnsense-update and opnsense-patch link to?

With thanks

First time for everything.. the links used to point to a similar location in /root but that was scrapped along with some other things and /var/cache is no longer on a memory file system.

You can just

# rm /var/cache/opnsense-update /var/cache/opnsense-patch /var/cache/pkg

But I'd recommend to see if the system updates at all:

# pkg info | wc -l

If the count is zero you need to opnsense-bootstrap again for safety.

If not continue as usual. :)


Cheers,
Franco

Thanks Franco,

# pkg info | wc -l returned 152... so all good there.

Removed the directories and all continued as expected.

I don't claim to understand *why* that worked... but it did.

Many thanks

The mystery is how you ended up with dangling links when these should have been migrated by the update, but as I said this is the first time I've seen it. So not enough incentive to fix this in the tooling to look for stale links (if you could update anyway that is... hehe).

Glad that worked and the system does seem to have no other issue in that regard. :)


Cheers,
Franco

PS: The directories are created on the fly by the tools but if you test for existence and there is a link that wasn't cleaned up or repaired the directory can't be used. In those cases a link test would have to be done as well to make sure the existing "directory" can be used.