Software⏱️ 3 min read📅 2026-06-19

How to Fix: Repeated error when adding packages

Error installing OpenBSD packages with pkg_add

Quick Answer: Check if the pkg_add command is up-to-date and try running it with the -U flag to update first.

The error message 'Fatal error: bad list v: No such file or directory' occurs when attempting to install packages using pkg_add on OpenBSD. This issue affects users who have recently installed OpenBSD and are trying to add new packages to their system.

This error can be frustrating, especially for first-time OpenBSD users. However, by following the steps outlined in this troubleshooting guide, you should be able to resolve the issue and successfully install packages.

🔍 Why This Happens

  • The primary cause of this error is a corrupted or missing /usr/lib/data/per15/OpenBSD/Pkg_Add.pm file. This file is required for pkg_add to function correctly. When the file is missing or corrupted, pkg_add cannot locate it, resulting in the 'bad list v' error.
  • An alternative reason for this error could be that the system's /usr/lib/data/per15/OpenBSD directory is not correctly configured or is missing necessary permissions.

✅ Best Solutions to Fix It

Resetting the pkg_add configuration

  1. Step 1: Step 1: Stop any running services and log out of all user sessions.
  2. Step 2: Step 2: Run the command 'pkg_delete -y all' to remove all installed packages and reset the system's package list.
  3. Step 3: Step 3: Reboot the system and attempt to install a new package using pkg_add again.
  4. Step 4: Step 4: If the issue persists, try reinstalling OpenBSD from scratch or seeking assistance from the OpenBSD community.

Configuring permissions for the /usr/lib/data/per15/OpenBSD directory

  1. Step 1: Step 1: Identify the ownership and permissions of the /usr/lib/data/per15/OpenBSD directory using the 'ls -l' command.
  2. Step 2: Step 2: Use the 'chown' command to set the owner and group of the directory to the root user, for example 'chown root:root /usr/lib/data/per15/OpenBSD'.
  3. Step 3: Step 3: Set the permissions of the directory to read-only using the 'chmod go-rwx /usr/lib/data/per15/OpenBSD' command.
  4. Step 4: Step 4: Reboot the system and attempt to install a new package using pkg_add again.

💡 Conclusion

If you have followed these steps and are still experiencing issues with installing packages on OpenBSD, it may be necessary to seek assistance from the OpenBSD community or consider reinstalling the operating system. Remember to always back up your data before making significant changes to your system configuration.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions