Ask Your Question

Dnf , broken after Purging python3/site_packages

asked 2017-02-17 07:23:54 -0500

aswinmohanme gravatar image

Hey , there I am a Newbie to Fedora ( you can judge by the stupidity of the question) . While Installing a python library I and playing around with pip I ran

sudo rm -rf /usr/lib/python3.5/site-packages/

And now when I run dnf

Traceback (most recent call last):
  File "/usr/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.5/site-packages/dnf/", line 31, in <module>
    import dnf.base
  File "/usr/lib/python3.5/site-packages/dnf/", line 37, in <module>
    import dnf.conf
  File "/usr/lib/python3.5/site-packages/dnf/conf/", line 43, in <module>
    import dnf.yum.config
  File "/usr/lib/python3.5/site-packages/dnf/yum/", line 28, in <module>
    from iniparse.compat import ParsingError, RawConfigParser as ConfigParser
  File "/usr/lib/python3.5/site-packages/iniparse/", line 6, in <module>
    from ini import INIConfig, change_comment_syntax
ImportError: No module named 'ini'

How do I fix this. I got yum-deprecated working , so I can install packages.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-02-18 05:10:11 -0500

You shouldn't delete files in system directories manually as you did, but I assume you now learned that. =0)

A save way to get the files again, would be to reinstall the packages that are installed on your system, provided that yum is working. So you could reinstall all packages with the following command.

yum reinstall $(rpm -qa | tr '\n' ' ')
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-02-17 07:23:54 -0500

Seen: 526 times

Last updated: Feb 18 '17