Solved BerkeleyDB file missing after pkg upgrade

Well, I don't know exactly what happened, but a few hours ago I decided to run a pkg upgrade in order to update my web browser, but I was surprised to see that quite a few other packages also required updating as well.

Anyway, at the end of the process, I noticed the below message in the terminal.


The default BerkeleyDB implementation switched from deprecated
version 5 from ports to BerkeleyDB 1 from base libc. Any BerkeleyDB
databases created with apr-util MUST be rebuilt. Verify your database
files using

$ file file.dbm

and check they report

Berkeley DB 1.85 (Hash, version 2, native byte-order)

other database formats (GDBM etc.) are not affected.


Unfortunately, when I entered the above command to verify my database, below is the response I got back from my terminal.


file.dbm: cannot open `file.dbm' (No such file or directory)


Also, a while back I used rsync to copy my entire /usr directory to a backup folder located on another partition. Is is possible that I might be able to recover the missing file from my backup folder?

Any info greatly appreciated.
 
It's hard to tell what happened without seeing your pkg upgrade output. But db5 is still a package.

What is likely is an upgraded package depended on a package that conflicted with db5 resulting in db5's removal. Without looking at your pkg upgrade output it's impossible say.

Lesson to learn is only answer "y" to the continue question only after you have reviewed what pkg intends to do. To blindly reply with "y" can and does result in package removal. Always look before replying "y".
 
But db5 is still a package
Interestingly, when I enter the below command...
pkg info db5
...I get the below output.. . . . .
Code:
root@Asus:~ # pkg info db5
db5-5.3.28_9
Name           : db5
Version        : 5.3.28_9
Installed on   : Tue Mar 17 22:05:39 2026 EDT
Origin         : databases/db5
Architecture   : FreeBSD:15:amd64
Prefix         : /usr/local
Categories     : databases java
Licenses       : SLEEPYCAT
Maintainer     : ports@FreeBSD.org
WWW            : https://www.oracle.com/database/berkeley-db/db.html
Comment        : Oracle Berkeley DB, revision 5.3
Options        :
    CRYPTO         : on
    DEBUG          : off
    DOCS           : on
    JAVA           : off
    L10N           : off
    TCL            : off
Shared Libs required:
    libc++.so.1
    libc.so.7
    libcxxrt.so.1
    libgcc_s.so.1
    libm.so.5
    libthr.so.3
Shared Libs provided:
    libdb-5.3.so.0
    libdb_cxx-5.3.so.0
    libdb_stl-5.3.so.0
Annotations    :
    FreeBSD_version: 1500068
    build_timestamp: 2026-02-12T01:08:37+0000
    built_by       : poudriere-git-3.4.4-15-g61aba751
    deprecated     : EOLd, potential security issues, maybe use db18 instead
    expiration_date: 2022-06-30
    port_checkout_unclean: no
    port_git_hash  : 9514ac9990434680c9394df1a07b7b7469198293
    ports_top_checkout_unclean: no
    ports_top_git_hash: b40e1dd5580ce541b365e52f0b7c300f8156b1e7
Flat size      : 54.6MiB
Description    :
Oracle Berkeley DB is a family of open source embeddable databases
that allows developers to incorporate within their applications a
fast, scalable, transactional database engine with industrial grade
reliability and availability. As a result, customers and end-users
will experience an application that simply works, reliably manages
data, can scale under extreme load, but requires no ongoing database
administration. As a developer, you can focus on your application and
be confident that Oracle Berkeley DB will manage your persistence
needs.

Does this possibly mean that the missing DB file actually exists, but maybe there is some sort of permission or configuration error. Worse case I can always go to my last backup, but I hate to do that because it seemed like I was making progress with my gnome-keyring issue. Oh well, that is the price of pressing Y without thinking ahead.
 
[…] Unfortunately, when I entered the above command to verify my database, below is the response I got back from my terminal.

file.dbm: cannot open `file.dbm' (No such file or directory)
The file.dbm is a placeholder, it is not the name of an actual file. If you don’t know if and where you’ve stored any BDB5 databases, you’ll need to find(1) them:​
Bash:
find / -type f -exec file '{}' ';' | fgrep 'Berkeley' | fgrep -v '1.85'
[…] But db5 is still a package. […]
As the update message says, it has been deprecated. I guess it is only present to read BDB5 databases so you can convert them to base system BDB 1.85 format.​
 
Well, it was an example. It's up to you to find where are the dbm files depending the softwares that actually uses it.

The important thing is: all is working correctly or not?
Seems to be working correctly with no noticeable issues.
 
If you don’t know if and where you’ve stored any BDB5 databases, you’ll need to find(1) them
Well, it seems that a couple of text files and also a few pdfs were found, but nothing else. Hmmm....

Code:
root@Asus:/ # find / -type f -exec file '{}' ';' | fgrep 'Berkeley' | fgrep -v '1.85'
/usr/share/sendmail/cf/domain/Berkeley.EDU.m4: sendmail m4 text file
/usr/share/sendmail/cf/domain/CS.Berkeley.EDU.m4: sendmail m4 text file
/usr/share/sendmail/cf/domain/EECS.Berkeley.EDU.m4: sendmail m4 text file
/usr/share/sendmail/cf/domain/S2K.Berkeley.EDU.m4: sendmail m4 text file
/usr/local/share/doc/db5/collections/tutorial/BerkeleyDB-Java-Collections.pdf: PDF document, version 1.4, 3 page(s)
/usr/local/share/doc/db5/gsg/C/BerkeleyDB-Core-C-GSG.pdf: PDF document, version 1.4, 3 page(s)
/usr/local/share/doc/db5/gsg/CXX/BerkeleyDB-Core-Cxx-GSG.pdf: PDF document, version 1.4, 3 page(s)
/usr/local/share/doc/db5/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf: PDF document, version 1.4, 3 page(s)
/usr/local/share/doc/db5/gsg_txn/CXX/BerkeleyDB-Core-Cxx-Txn.pdf: PDF document, version 1.4, 3 page(s)

Hmmm....looks like I will have to think about this one...
 
The file.dbm is a placeholder, it is not the name of an actual file. If you don’t know if and where you’ve stored any BDB5 databases, you’ll need to find(1) them:​
Bash:
find / -type f -exec file '{}' ';' | fgrep 'Berkeley' | fgrep -v '1.85'
As the update message says, it has been deprecated. I guess it is only present to read BDB5 databases so you can convert them to base system BDB 1.85 format.​
It the DEPRECATED= variable is set in the port's Makefile but it hasn't been removed yet. It's been deprecated for a long time, probably because a good enough replacement hasn't been found yet.

As to this being the cause it was removed, I doubt that.
 
It the DEPRECATED= variable is set in the port's Makefile but it hasn't been removed yet. It's been deprecated for a long time, probably because a good enough replacement hasn't been found yet.

As to this being the cause it was removed, I doubt that.
I never noticed the message before doing the pkg upgrade, so I just assumed that the two things must be linked. Also, I tried pkg upgrade again, but the message didn't show up again. Of course this time around there weren't any packages which needed upgrading. If I can't make the message reappear again, then I guess that I don't have to worry about it too much.
 
Here is something else very strange I just noticed. Yesterday my installation of FreeBSD could easily mount and unmount USB thumb drives formatted with the NTFS file system. However, this afternoon I noticed that I keep getting a popup notification stating that the thumb drive is already mounted, but this only occurs with thumb drives formatted to use NTFS, and it does not occur with thumb drives using FAT32 or UFS. Very strange.
 
Well, I restored my installation of FreeBSD with a backup I had earlier created using rsync, and now my system is back to where it was a few days ago. Rsync has saved my life so many times, but now I'm afraid to do another pkg upgrade for a while. Also, at the moment I seem to have a reasonably stable installation, but I sure have a lot to learn. Just wool gathering.
 
Back
Top