Kali Linux Update Recovery Log: Post‐I O Error & Dependency Deadlock - kdaisho/Blog GitHub Wiki

date: 2026-04-11

Overview

System encountered a Read-Only (RO) file system error during a full-upgrade, leading to a corrupted dpkg database and broken dependencies. This was further complicated by a file conflict in the pyinstaller-hooks-contrib package.


Phase 1: Filesystem & Graphical Reset

When the SSD locks into Read-Only mode due to kernel-detected errors, the system must be forced back to Read-Write to allow repairs.

  • Remount Filesystem: sudo mount -o remount,rw /
  • Clear X11 Locks: (Fixed the issue where the GUI wouldn't start) sudo rm /tmp/.X11-unix/X0 sudo rm ~/.Xauthority
  • Set Boot Target: Ensured the system boots to the desktop. sudo systemctl set-default graphical.target

Phase 2: Resolving the Dependency Deadlock

The upgrade stalled on a file conflict where two packages claimed the same Python __init__.py file.

  • Manual Metadata Cleanup: Removed the "ghost" directory preventing the new package from installing. sudo rm -rf /usr/lib/python3/dist-packages/pyinstaller_hooks_contrib-*.dist-info/
  • Database Purge: Forced the dpkg database to forget the conflicting old package. sudo dpkg --purge --force-all python3-pyinstaller-hooks-contrib
  • Repair Command: sudo apt --fix-broken install

Phase 3: Finalizing the Upgrade

Once the "knot" was untied, the standard update path was cleared.

  1. Finish Configurations: sudo dpkg --configure -a
  2. Complete Upgrade: sudo apt full-upgrade -y
  3. Ensure Desktop Integrity: sudo apt install kali-linux-default
  4. Hardware Sync: sync (Ensures all data is physically written to the SSD before reboot).

Phase 4: Post-Repair Verification

Before proceeding with high-load projects like Project Nomad, verify the environment:

  • Package Health: dpkg -l | grep ^iU (Should return nothing).
  • GPU Status: nvidia-smi (Must show Driver 550.x and the RTX 3060).

Note: If dpkg complains about "unknown options" like -o despite not typing them, check for single-dash vs. double-dash typos (e.g., -configure vs --configure). If errors persist, check the SSD for hardware failure using journalctl -p 3 -xb.