Tried installing lutris in software, doesn't launch, and dnf no longer functions

I don’t know if both of these are related, but I tried to install Lutris in Software, and it would not open. I tried rebooting and still nothing. I uninstalled Lutris in Software, and tried to reinstall it using the terminal, with sudo dnf install lutris, only to be met with:

❯ sudo dnf install lutris
Traceback (most recent call last):
  File "/usr/bin/dnf", line 61, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.11/site-packages/dnf/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.11/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
ModuleNotFoundError: No module named 'libdnf'

~ 
❯ 

I tried just running the dnf command, and the same error was outputted. Anybody know what to do from here?

looks like its missing the libdnf module. Are you able to try to install it and see?

How do I install it without dnf?

I don’t know if there’s a “right” way, but one could download the package from https://pkgs.org/download/libdnf and rpm install it or build it from github.

I also can’t verify the safety of such approach. I’m confused, as it sounds you are too, about how you got here.

Also, do you happen to have two “competing” versions of python installed by any chance?

1 Like

Can you dnf anything?

Go here and download the fedora version of libdnf for your version of Fedora.
For example this is the link for F38 x86_64 version: https://kojipkgs.fedoraproject.org//packages/libdnf/0.70.1/1.fc38/x86_64/libdnf-0.70.1-1.fc38.x86_64.rpm

Then you can

rpm --install libdnf-0.70.1-1.fc38.x86_64.rpm

Now try dnf again and see if that fixes it.

But given that lindnf is missing do not be surprised if other system files have also been removed.

Sorry for the wait, I downloaded the RPM and tried to sudo rpm --install it, but it says it is already installed:

~/Downloads via ☕ v17.0.7 
❯ sudo rpm --install libdnf-0.70.1-1.fc38.x86_64.rpm 
[sudo] password for aero: 
	package libdnf-0.70.1-1.fc38.x86_64 is already installed

dnf still reports the same error.

No apologies needed… Perhaps this thread can help; the error you reference does seem to have something to do with python3 and, perhaps, when you uninstalled lutris it messed something up…

1 Like

I just checked what would be installed extra if I installed lutris and it wants to install 94 packages, including 6 additional python3 packages and a lot of i686 packages.

I am not sure why it should have messed up dnf with installing then removing lutris, but it seems possible that some of those packages may have used some of the same python modules as dnf and thus caused an issue.

1 Like

Unlikely to be related to Lutris.

Did you do anything related to Python recently? e.g.:

  • use pip globally to install/uninstall Python packages
  • change the system default version of Python
  • delete files from /usr/lib/python3.11/site-packages/

The Python module libdnf refers to the package python3-libdnf, not libdnf. So try reinstalling this.

https://packages.fedoraproject.org/pkgs/libdnf/python3-libdnf/

Use --reinstall:

sudo rpm --reinstall /path/to/rpm

No, I didn’t touch python, I have no idea what caused it. Running rpm with --reinstall to reinstall libdnf, had no output, so I’m pretty sure it worked. Unfortunately, dnf still spits out the same error.

As mentioned, the Python module named “libdnf” is in the package python3-libdnf, not libdnf. Did you try reinstalling python3-libdnf?

Sorry, when attempting to reinstall the python3-libdnf package, I get a few errors:

~/Downloads via ☕ v17.0.7 
❯ sudo rpm --reinstall '/home/aero/Downloads/python3-libdnf-0.70.1-1.fc38.x86_64.rpm' 
[sudo] password for aero: 
error: unpacking of archive failed on file /usr/lib64/python3.11/site-packages/libdnf: cpio: lstat failed - Directory not empty
error: python3-libdnf-0.70.1-1.fc38.x86_64: install failed
error: python3-libdnf-0.70.1-1.fc38.x86_64: erase skipped

Can you give the output of this:

ls -laZ /usr/lib64/python3.11/site-packages/libdnf
sudo rpm -V python3-libdnf

Well this is odd…

~/Downloads via ☕ v17.0.7 
♥ ❯ ls -laZ /usr/lib64/python3.11/site-packages/libdnf
ls: cannot access '/usr/lib64/python3.11/site-packages/libdnf': Input/output error

~/Downloads via ☕ v17.0.7 
❯ sudo rpm -V python3-libdnf
missing     /usr/lib64/python3.11/site-packages/libdnf (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__init__.py (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__ (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/__init__.cpython-311.opt-1.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/__init__.cpython-311.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/common_types.cpython-311.opt-1.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/common_types.cpython-311.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/conf.cpython-311.opt-1.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/conf.cpython-311.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/error.cpython-311.opt-1.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/error.cpython-311.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/module.cpython-311.opt-1.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/module.cpython-311.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/repo.cpython-311.opt-1.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/repo.cpython-311.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/smartcols.cpython-311.opt-1.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/smartcols.cpython-311.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/transaction.cpython-311.opt-1.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/transaction.cpython-311.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/utils.cpython-311.opt-1.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/__pycache__/utils.cpython-311.pyc (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/_common_types.so (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/_conf.so (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/_error.so (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/_module.so (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/_repo.so (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/_smartcols.so (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/_transaction.so (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/_utils.so (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/common_types.py (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/conf.py (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/error.py (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/module.py (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/repo.py (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/smartcols.py (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/transaction.py (Input/output error)
missing     /usr/lib64/python3.11/site-packages/libdnf/utils.py (Input/output error)

:fearful:

In my experience, those i/o errors are usually hardware related. Does dmesg throw any odd results?

Uhhhhhhhhhhhhhhhhhh, yeahhhhh. could this be my ssd failing?

[  205.317359] BTRFS error (device sda3): bad tree block start, mirror 1 want 645152768 have 15060037153926840191
[  205.317728] BTRFS error (device sda3): bad tree block start, mirror 2 want 645152768 have 3211534
[  205.318039] BTRFS error (device sda3): bad tree block start, mirror 1 want 645152768 have 15060037153926840191
[  205.318310] BTRFS error (device sda3): bad tree block start, mirror 2 want 645152768 have 3211534
[  205.318588] BTRFS error (device sda3): bad tree block start, mirror 1 want 645152768 have 15060037153926840191
[  205.318849] BTRFS error (device sda3): bad tree block start, mirror 2 want 645152768 have 3211534
[  205.333833] BTRFS error (device sda3): bad tree block start, mirror 1 want 645152768 have 15060037153926840191
[  205.334201] BTRFS error (device sda3): bad tree block start, mirror 2 want 645152768 have 3211534
[  205.334507] BTRFS error (device sda3): bad tree block start, mirror 1 want 645152768 have 15060037153926840191
[  205.334769] BTRFS error (device sda3): bad tree block start, mirror 2 want 645152768 have 3211534

I’ve backed up and restored Fedora using Clonezilla, so that could have also caused it. However it should have kept all the data, and partitions the way they were backed up.

I have not tried clonezilla with a btrfs file system. Is it possible that clonezilla does not properly manage the partition & file system for btrfs?

I’m not sure, it says it’s supported on their website. I’ll be getting some important files off of my drive now, just in case this is an SSD failure.

I’m absolutely not an expert of any kind, but a quick search around different distros fora seems to suggest the bad tree block start warning in and of itself isn’t horrible, but the differences you have between what btrfs is “wanting” and what it “has” in its log is; that is, it sounds like that size discrepancy—for example, your first line of btrfs looking at location “645152768” but finding the data at “15060037153926840191”—seems to only happen when a system is shutdown prior to being able to complete a large operation.

Every thread pretty much suggests the best bet is to copy whatever you can from the system and start over from scratch.

The good news is it doesn’t sound as though this is actually a hardware issue…

Interestingly, in most of the cases like yours, it seems like the users weren’t even able to mount the drive…