Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: After updating to dnf-3.0.3-2, dnf always fails with a '/usr/bin/dnf: line 21: from: command not found" message and just hangs indefinitely. When I hit Ctrl+C to kill it, it then says "/usr/bin/dnf: line 25: syntax error near unexpected token `(' /usr/bin/dnf: line 25: `def suppress_keyboard_interrupt_message():'". This happens no matter what I try to do with dnf. Version-Release number of selected component (if applicable): dnf-3.0.3-2.fc29.noarch libdnf-0.15.2-1.fc29.x86_64 python3-dnf-3.0.3-2.fc29.noarch How reproducible: Always Steps to Reproduce: 1. run 'dnf update' or 'dnf install vim' or even 'dnf --version' 2. 3. Actual results: $ dnf update /usr/bin/dnf: line 21: from: command not found import: unable to open image `sys': Permission denied @ error/blob.c/OpenBlob/2761. /usr/bin/dnf: line 25: syntax error near unexpected token `(' /usr/bin/dnf: line 25: `def suppress_keyboard_interrupt_message():' Expected results: Additional info:
Hi, it looks like that the dnf command is executed by bash instead of python. Please, can you paste here an output of the command: $ head /usr/bin/dnf The first line of the output should point to python interpreter and look like this: #!/usr/bin/python3
$ head /usr/bin/dnf -n 1 #!/usr/bin/python3 $ ls -l /usr/bin/python3 lrwxrwxrwx 1 root root 9 Jul 23 17:51 /usr/bin/python3 -> /usr/bin/python3.7 Changing python3 to point to python3.6 gives me a more python looking traceback. Then dnf update gives me Traceback (most recent call last): File "/usr/bin/dnf", line 57, in <module> From dnf.cli import main ModuleNotFoundError: No module named 'dnf'
This is strange and at the moment I have no idea what's going on. Other python scripts are running OK? You can try to invoke dnf like: $ /usr/bin/python3 dnf
`/usr/bin/python3.7 /usr/bin/dnf --version` gives me no output. `/usr/bin/python3.7 helloworld.py` gives me no output. Python3.6 works for a simple print statement but gives me ModuleNotFoundError: No module named 'dnf'
Hm, probably your python interpreter is somehow broken. You can try to upgrade/reinstall it by using directly the rpm command.
I tried to update/reinstall python through yum-deprecated, rpm, and compiling by source. None of which worked. yum-deprecated and rpm wouldn't let me update python3.6 or 3.7 because they both had packages that depended on them. Compiling Python3.7 from source didn't change anything and neither did 3.6. I know this won't help us figure out the bug, but what would happen if I booted into a live Fedora 28 CD and ran `dnf distro-sync --enablerepo=rawhide --releasever=rawhide --installroot=/dev/whateverMyRootIsOn dnf python3`? Are there any other packages I should specify?
So I got it to work by booting into a live cd, mounting my root partition to /mnt, then running `dnf install --disablerepo=* --enablerepo=rawhide --releasever=29 --installroot=/mnt dnf python3`. After rebooting, I am on dnf version 3.0.4, python verion 3.6.6 and everything is working as normal. This also seems to be related to Bug 1599069.