i think portage was modifying the cache when the system rebooted, but now the corrupt cache has wedged it, and portage doesn't automatically recover, nor does it even say what file is the problem. it really should just ignore/delete invalid caches in cases like this with a warning. $ emerge --version Portage 3.0.56 (python 3.10.13-final-0, default/linux/amd64/17.1/developer, gcc-13, glibc-2.38-r7, 6.6.3 x86_64) Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/portage/cache/sqlite.py", line 129, in _db_init_connection self._db_init_cache_size(config["cache_bytes"]) File "/usr/lib/python3.10/site-packages/portage/cache/sqlite.py", line 240, in _db_init_cache_size cursor.execute("PRAGMA cache_size = %d" % cache_size) sqlite3.DatabaseError: database disk image is malformed During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python-exec/python3.10/emerge", line 57, in main retval = emerge_main() File "/usr/lib/python3.10/site-packages/_emerge/main.py", line 1314, in emerge_main x["porttree"].dbapi.close_caches() File "/usr/lib/python3.10/site-packages/portage/dbapi/porttree.py", line 426, in close_caches self.auxdb[x].sync() File "/usr/lib/python3.10/site-packages/portage/cache/template.py", line 188, in sync self.commit() File "/usr/lib/python3.10/site-packages/portage/cache/sqlite.py", line 326, in commit self._db_connection.commit() File "/usr/lib/python3.10/site-packages/portage/cache/sqlite.py", line 102, in _db_connection self._db_init_connection() File "/usr/lib/python3.10/site-packages/portage/cache/sqlite.py", line 133, in _db_init_connection raise cache_errors.InitializationError(self.__class__, e) portage.cache.cache_errors.InitializationError: Creation of instance <class 'portage.cache.sqlite.database'> failed due to database disk image is malformed after clearing with `rm -rf /var/cache/edb/dep/*`, emerge --version works again. i could recreate the error with: find /var/cache/edb/dep/ -type f -name '*.sqlite' -exec truncate -s1600 {} +