pkg database spoiled?

I installed much, much more than this!!!!

Code:
% pkg info
boehm-gc-8.0.4                 Garbage collection and memory leak detection for C and C++
gettext-runtime-0.19.8.1_2     GNU gettext runtime libraries and programs
indexinfo-0.3.1                Utility to regenerate the GNU info page index
libX11-1.6.7,1                 X11 library
libXau-1.0.9                   Authentication Protocol library for X11
libXdmcp-1.1.3                 X Display Manager Control Protocol library
libevent-2.1.8_3               API for executing callback functions on events or timeouts
libpthread-stubs-0.4           This library provides weak aliases for pthread functions
libxcb-1.13.1                  The X protocol C-language Binding (XCB) library
libxml2-2.9.8                  XML parser library for GNOME
nasm-2.14.02,1                 General-purpose multi-platform x86 and amd64 assembler
nsd-4.1.27                     Authoritative only non-recursive name server
perl5-5.28.1_1                 Practical Extraction and Report Language
rdesktop-1.8.4                 RDP client for Windows NT/2000/2003 Terminal Server
w3m-0.5.3.20190105             Pager/text-based WWW browser
xorgproto-2018.4               xorg protocol headers

% ll /var/db/pkg/
total 34562
-rw-r--r--  1 root  wheel       246 May 23 03:36 FreeBSD.meta
-rw-r--r--  1 root  wheel   1880064 May 24 15:46 local.sqlite
-rw-r--r--  1 root  wheel  54030336 May 23 03:36 repo-FreeBSD.sqlite
 
It seems that something deleted my database at some point. But I do not see dates in the tables of the DB I have.

Is such a problem known? I do not think that I deleted it with rm.

Now I must save my files. It seems that I will need to install FreeBSD again and tune my system again.
 
Now I must save my files. It seems that I will need to install FreeBSD again and tune my system again.
Well, if it's really messed up, you don't have to reinstall the whole system, just the packages. You might want to backup /usr/local/etc somewhere, then you could simply remove /usr/local and the pkg databases completely and start reinstalling your packages.
 
Well, if it's really messed up, you don't have to reinstall the whole system, just the packages.

Unfortunately that is not enough. I do not remember all what was installed. Upgrading means also deinstal files that are
not anymore necessary. The information of what files was installed by what package is lost.
 
Did you by any chance mix the installation of binary packages ( # pkg install ...) with ports? ( # make install clean)? Because that would explain quite a bit.
 
Unfortunately that is not enough. I do not remember all what was installed. Upgrading means also deinstal files that are
not anymore necessary. The information of what files was installed by what package is lost.
Almost all files installed by packages go into /usr/local (exception are kernel modules installed by packages). By removing that directory (or its contents), all packages
will be effectively uninstalled.
From that point on you can just pkg install -f ... whatever you need. No need to install more anyway, you'll know you need something when you notice it's not on your
system. A good starting point is probably xorg and the window manager you wanted to use (assuming it's a desktop).
 
There might be a copy of the local package database in the /var/backups directory. Specifically, /usr/local/etc/periodic/daily/411.pkg-backup will be executed at roughly 3 a.m. if it's not disabled and the computer is powered up (I only mention that because at that time desktops usually aren't).

( # make install clean)? Because that would explain quite a bit.

Isn't that supposed to work through pkg anyway?
 
Now I understand: I can delete /usr/local and install all again. And yes, there is something in /var/backups. :)

But I hope once to know how the database shrank.
 
But I hope once to know how the database shrank.
Agreed. I wouldn't be surprised if it happens again, although I have no idea what might cause such a thing. Nonetheless, you'll probably have an 'Aha' moment followed by an urge
to headslap yourself when it does ;)
 
Have you removed any packages by chance? If you have, you might have also removed all packages that depend on it recursively (which is default behaviour and intended).
e.g. if I were to pkg remove wayland - which I currently don't use - then almost all graphical ports on my system will be removed including even nvidia-driver.
 
Have you removed any packages by chance?

I had a lot of packages and only remain 16. Firefox that I installed not as dependency and I am using, also disappeared from the db. Dependencies are taken away when they are not anymore used.
My backups seems to contain a lot of packages, but are from end of 2017.

I will keep the calm, backup my data. I bought I a new hd, I will install FreeBSD 12.0, or 12.1 if it comes soon, and then try to repair this disk.

Is FreeBSD 12.0 as stable as 11.2?
 
Back
Top