Ask Your Question
0

How to resolve traceback(most recent call last): issue ? please help

asked 2018-10-25 03:29:50 -0500

updated 2018-10-29 00:48:57 -0500

[root@hello-world sayandeep]# yum update

Traceback (most recent call last):

File "/usr/bin/yum", line 57, in <module> from dnf.cli import main

ModuleNotFoundError: No module named 'dnf'

[root@hello-world sayandeep]#

edit retag flag offensive close merge delete

Comments

1

Welcome to ask.fedora! What version of fedora are you using, because yum was replaced by dnf several years ago?

sideburns gravatar imagesideburns ( 2018-10-25 12:08:16 -0500 )edit

fedora - 28

Sayandeep Saha gravatar imageSayandeep Saha ( 2018-10-25 15:08:09 -0500 )edit

It shows same message if I write dnf update

[root@hello-world sayandeep]# dnf update
Traceback (most recent call last):
  File "/usr/bin/dnf", line 57, in <module>
    from dnf.cli import main
ModuleNotFoundError: No module named 'dnf'
[root@hello-world sayandeep]#
Sayandeep Saha gravatar imageSayandeep Saha ( 2018-10-25 15:09:23 -0500 )edit

Well yes, it would as yum is just a link to dnf.

sideburns gravatar imagesideburns ( 2018-10-26 10:51:50 -0500 )edit

basically no dnf or yum command is working

Sayandeep Saha gravatar imageSayandeep Saha ( 2018-10-28 23:32:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-10-29 06:23:44 -0500

villykruse gravatar image

You would need to re-install dnf, but that requires a solution to the chicken and egg problem.

First: Boot a live install medium for the same release.

Second: Find and mount your root file system on /mnt.

Third: Reinstall all dnf relates packages:

 dnf --installroot=/mnt reinstall '*dnf*'

Maybe you also need to upgrade the dnf packages if your dnf packages were not the latest version

dnf --installroot=/mnt upgrade '*dnf*'
edit flag offensive delete link more

Comments

If memory serves, the live system already mounts your installed root partition at /mnt/sysimage so there's no need to mount it again.

sideburns gravatar imagesideburns ( 2018-10-29 17:05:40 -0500 )edit

It doesn't when I boot the live system. I just checked.

villykruse gravatar imagevillykruse ( 2018-10-30 01:08:45 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-10-25 03:23:11 -0500

Seen: 227 times

Last updated: Oct 29 '18