Need help restoring Qubes4.2.1 dom0 python3.11

An attempt to install python-tkinter resulted in upgrading python3.13-tkinter
along with python3.13 and python3.13-libs
I inadvertently removed /usr/bin/python3.11, but not the libraries.

Since this was done, access to qubes apps have been lost.
qubes-apps no longer available include qrexec, qvm-prefs, qvm-start, etc.
sys-usb was implemented prior to this mishap so access to the usb ports was
also lost.
I do not know how to regain access to sys-net, sys-firewall, sys-whonix.
Dom0 starts and a terminal and thunar work.
I can provide some error messages from attempting to issue qvm commands if it will help.

Can someone provide help to restore python3.11 and access qubes apps?

Thanks

Is there a python3 package installed?

What commands did you run (approximately if you do not have history) to break it?

python3.13 was installed as well as the python3.13-libs and python3.13-tkinter packages.

The command was:
sudo qubes-dom0-update python3.13-tkinter.x86_64

/lib/python3.11/site-packages has many files while
/lib/python3.13/sitepackages has an empty directory _pycache_

Would you know if the references can be reset to use python3.13 without having access to the network and USB ports?
For example, if the files in /lib/python3.11 were copied to /lib/python.3.13 could the filenames be modified from 3.11 to 3.13 and these files/scripts be updated to the new version?
I have a very superficial knowledge of the inner workings of qubes and its interaction with python.
The install of tkinter was to add a feature to xfce4 thunar, and was not intended to change qubes itself.

python3.13 was installed as well as the python3.13-libs and python3.13-tkinter packages.

The command was:
sudo qubes-dom0-update python3.13-tkinter.x86_64

Resolutioin: copied /bin/python3.11 from installation drive and changed softlink /bin/python3 from /bin/python3.13 to /bin/python3.11.
Steps:

  1. Changed BIOS to use installation drive as the boot device
  2. Reboot
  3. Chose rescue drive, exitted to prompt
  4. lsblk (to locate qubes block device (ex. nvme#np#))
  5. cryptsetup luksOpen /dev/nvme#np#
  6. mkdir /mnt/luks_root
  7. vgscan (to identify root lvm, ex. qubes_dom0_lvm)
  8. vgchange -ay qubes_dom0_lvm
  9. mount /def/qubes_dom0_lvm/root /mnt/luks_root
  10. cp -af /usr/bin/python3.11 /mnt/luks_root/home/user01/
  11. umount /dev/qubes_dom0_lvm/root
  12. vgchange -an qubes_dom0_lvm
  13. cryptsetup luksClose luksroot
    NOTE: nvme#np# and qubes_dom0_lvm are made up but should be enough to get the meaning of the step.
  14. Reboot
  15. Opened a dom0 terminal
  16. sudo cp -af ~/python3.11 to /usr/bin
  17. sudo rm /usr/bin/python3
  18. sudo ln -s /usr/bin/python3.11 /usr/bin/python3
  19. Reboot, qubes applications and scripts once again available.

@solene, Thanks for showing a prompt interest is my plight.

1 Like