LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   yum command not working in Fedora ! (https://www.linuxquestions.org/questions/linux-newbie-8/yum-command-not-working-in-fedora-4175632698/)

LEON71 06-26-2018 07:49 AM

yum command not working in Fedora !
 
When I try to update software packages in my Fedora workstation I run this command

yum update

and I get this error message :

Traceback (most recent call last):
File "/usr/bin/yum", line 57, in <module>
from dnf.cli import main
ImportError: No module named 'dnf'


What's wrong ?

pan64 06-26-2018 07:55 AM

that means - in general - dnf is not installed, so you need to [re]install it.
But dnf is used to be installed, so I think something went wrong on your linux.

LEON71 06-26-2018 07:56 AM

Quote:

Originally Posted by pan64 (Post 5872095)
that means - in general - dnf is not installed, so you need to [re]install it.
But dnf is used to be installed, so I think something went wrong on your linux.

How can I fix it ? Any idea ?

pan64 06-26-2018 08:15 AM

yes, look for the official documentation: https://fedoraproject.org/wiki/DNF?rd=Dnf

knudfl 06-26-2018 10:22 AM

Fedora 27 :

The update command is not really # yum update
... but # dnf update

LEON71 06-26-2018 10:24 AM

Quote:

Originally Posted by knudfl (Post 5872131)
Fedora 27 :

The update command is not really # yum update
... but # dnf update

when I run dnf update I got this error message :

Traceback (most recent call last):
File "/usr/bin/dnf", line 57, in <module>
from dnf.cli import main
ImportError: No module named 'dnf'

TB0ne 06-26-2018 10:33 AM

Quote:

Originally Posted by LEON71 (Post 5872135)
when I run dnf update I got this error message :

Traceback (most recent call last):
File "/usr/bin/dnf", line 57, in <module>
from dnf.cli import main
ImportError: No module named 'dnf'

Related to your other thread: https://www.linuxquestions.org/quest...ow-4175632664/

You updated/moved/bothered python, so now things that depend on python aren't working. Since you don't say what you did, we can't tell you how to undo it.

LEON71 06-26-2018 11:34 AM

Quote:

Originally Posted by TB0ne (Post 5872138)
Related to your other thread: https://www.linuxquestions.org/quest...ow-4175632664/

You updated/moved/bothered python, so now things that depend on python aren't working. Since you don't say what you did, we can't tell you how to undo it.

Thanks for the reply.Let me give you an idea what I did. I will give all the history here :



845 yum install logwatch
846 vim /etc/logwatch/conf/logwatch.conf
847 yum install sysstat.x86_64
848 cat /etc/cron.d/0hourly
849 mail
850 sar -u | less
851 man sar
852 df
853 df -h
854 NetworkManager
855 cd /var/www/
856 ls
857 cd /root/
858 find /var/www -type f -exec grep /php/malware {} \; -print
859 man sed
860 help sed
861 sed --help
862 man sed
863 cat sitelistfile.txt | grep ‘clean clean’ | wc -l
864 ls
865 touch sitelistfile.txt
866 ls
867 gedit sitelistfile.txt
868 cat sitelistfile.txt | grep ‘clean clean’ | wc -l
869 cat sitelistfile.txt | grep 'clean clean' | wc -l
870 cat sitelistfile.txt | grep 'blacklisted blacklisted' | wc -l
871 cat sitelistfile.txt | grep 'blacklisted malwarefound ' | wc -l
872 cat sitelistfile.txt | grep 'blacklisted' | wc -l
873 cat sitelistfile.txt | grep 'malwarefound' | wc -l
874 cp /root/Documents/Commands/Shell_Script/automation /usr/local/bin/
875 chmod 755 /usr/local/bin/automation
876 cd /root/Documents/Commands/Shell_Script/
877 ls
878 ./automation
879 chmod 755 automation
880 ./automation
881 cp /root/sitelistfile.txt /root/Documents/Commands/Shell_Script/
882 ./automation
883 rm /usr/local/bin/automation
884 ./automation
885 cp /root/Documents/Commands/Shell_Script/automation /usr/local/bin/
886 cd /root
887 automation
888 cd /root/Documents/
889 automation
890 cd /root/
891 automation
892 rm /usr/local/bin/automation
893 automation
894 cp /root/Documents/Commands/Shell_Script/automation /usr/local/bin/
895 automation
896 yum update
897 poweroff
898 history | grep /var/www
899 reboot
900 cd Documents/
901 ls
902 cd Python/
903 ls
904 python test.py
905 python hello.py
906 cd /root/
907 ip addr show
908 yum install Scrapy
909 conda install -c conda-forge scrapy
910 cd /root/Documents/
911 ls
912 cd Python/
913 ls
914 scrapy startproject tutorial
915 ls
916 cd tutorial/
917 ls
918 cd tutorial/
919 ls
920 cd spiders/
921 touch quotes_spider.py
922 gedit quotes_spider.py
923 ls
924 cd ..
925 ls
926 cd ..
927 ls
928 cd ..
929 cd tutorial/
930 ls
931 scrapy crawl quotes
932 ls
933 scrapy shell 'http://quotes.toscrape.com/page/1/'
934 scrapy shell 'http://quotes.toscrape.com'
935 scrapy crawl quotes
936 cd /root/
937 history
938 ip addr show
939 infconfig
940 fuck
941 ip addr show
942 ifconfig wlp3s0
943 route
944 Kernel IP routing table
945 poweroff
946 history
947 exit
948 fuck
949 exit
950 yum remove the_fuck
951 yum remove fuck
952 exit
953 history
954 yum remove thefuck
955 exit
956 poweroff
957 yum install fuck
958 yum install dnf
959 yum install thefuck
960 pip install thefuck
961 exit
962 yum update
963 yum install dnf -y
964 yum update
965 pip install yum
966 yum update
967 sudo dnf update
968 yum update
969 sudo yum install dnf
970 yum update
971 osinfo-db-path
972 os
973 uname -a
974 lsb_release
975 sudo find /etc | xargs grep -i fedora > searchFedora
976 cat /etc/issue
977 cat /etc/fedora-release
978 yum install dnf
979 rpm -Vv dnf-yum python3-dnf dnf-conf
980 yum update
981 rpm -qa | grep dnf
982 rpm -Vv dnf-yum python3-dnf dnf-conf
983 dnf update
984 traceroute google.com
985 traceroute cibc.com
986 traceroute cibc.com > cibc_route
987 ls
988 gedit cibc_route
989 rm cibc_route
990 traceroute google.co
991 hostname
992 dnsdomainname
993 man dnsdomainname
994 dnf update
995 exi
996 fuck
997 pip install dnf-yum
998 yum-deprecated
999 rpm -qa | egrep "^python3" | sed ':a;N;$!ba;s/\n/ /g' | xargs sudo yum-deprecated reinstall -y
1000 yum update
1001 yum-deprecated
1002 yum-deprecated reinstall "dnf*"
1003 yum clean all
1004 rpm -qa | egrep "^python3" | sed ':a;N;$!ba;s/\n/ /g' | xargs sudo yum-deprecated reinstall -y
1005 history

TB0ne 06-26-2018 12:00 PM

Quote:

Originally Posted by LEON71 (Post 5872159)
Thanks for the reply.Let me give you an idea what I did. I will give all the history here :
Code:

  902  cd Python/
  903  ls
  904  python test.py
  905  python hello.py
  906  cd /root/
  912  cd Python/
  914  scrapy startproject tutorial
  979  rpm -Vv dnf-yum python3-dnf  dnf-conf
  981  rpm -qa | grep dnf
  982  rpm -Vv dnf-yum python3-dnf  dnf-conf
  999  rpm -qa | egrep "^python3" | sed ':a;N;$!ba;s/\n/ /g' | xargs sudo yum-deprecated reinstall -y
 1000  yum update
 1001  yum-deprecated
 1002  yum-deprecated reinstall "dnf*"
 1003  yum clean all
 1004  rpm -qa | egrep "^python3" | sed ':a;N;$!ba;s/\n/ /g' | xargs sudo yum-deprecated reinstall -y
 1005  history


Seriously???? We don't need to see everything you've done; when asked about python, post what is RELATED TO PYTHON. Seems you re-installed things, and installed the yum command, although its deprecated, and did a re-install of python3. Open up the dnf command and look at the first line...chances are it's not going to the right python program. You've obviously got yum-deprecated working, and have re-installed python3. And how about telling us what the RESULTS of the reinstall command were?

LEON71 06-26-2018 12:04 PM

This is what I get :

rpm -qa | egrep "^python3" | sed ':a;N;$!ba;s/\n/ /g' | xargs sudo yum-deprecated reinstall -y

File "/bin/yum-deprecated", line 36
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax

TB0ne 06-26-2018 12:29 PM

Quote:

Originally Posted by LEON71 (Post 5872169)
This is what I get :

rpm -qa | egrep "^python3" | sed ':a;N;$!ba;s/\n/ /g' | xargs sudo yum-deprecated reinstall -y

File "/bin/yum-deprecated", line 36
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax

So you didn't think that posting the fact that your re-install command DID NOT WORK was relevant??? Run rpm -qa | egrep python, and find out the package names that you have. Download them from a repository, and manually install them with the RPM command.

LEON71 06-26-2018 01:56 PM

Quote:

Originally Posted by TB0ne (Post 5872177)
So you didn't think that posting the fact that your re-install command DID NOT WORK was relevant??? Run rpm -qa | egrep python, and find out the package names that you have. Download them from a repository, and manually install them with the RPM command.


When I run this command : rpm -qa | egrep python

I got this message :

python3-cairo-1.15.3-1.fc27.x86_64
python2-idna-2.5-2.fc27.noarch
python3-inotify-0.9.6-9.fc27.noarch
python-xpyb-1.3.1-9.fc27.x86_64
python-mako-1.0.6-4.fc27.noarch
python2-gobject-3.26.1-1.fc27.x86_64
python3-caribou-0.4.21-5.fc27.noarch
python3-crypto-2.6.1-22.fc27.x86_64
python3-colorama-0.3.7-6.fc27.noarch

Where Python part is in orange colour. So does it mean they are not installed in the system ? right ? Now if I wish to install

python3-cairo-1.15.3-1.fc27.x86_64 with rpm command how can I do that ?

TB0ne 06-26-2018 02:30 PM

Quote:

Originally Posted by LEON71 (Post 5872207)
When I run this command : rpm -qa | egrep python

I got this message :

python3-cairo-1.15.3-1.fc27.x86_64
python2-idna-2.5-2.fc27.noarch
python3-inotify-0.9.6-9.fc27.noarch
python-xpyb-1.3.1-9.fc27.x86_64
python-mako-1.0.6-4.fc27.noarch
python2-gobject-3.26.1-1.fc27.x86_64
python3-caribou-0.4.21-5.fc27.noarch
python3-crypto-2.6.1-22.fc27.x86_64
python3-colorama-0.3.7-6.fc27.noarch

Where Python part is in orange colour.

....except you didn't post anything here in a different color, did you?
Quote:

So does it mean they are not installed in the system ? right ?
Wrong. Read the man page on the rpm command, and look at what those options do.
Quote:

Now if I wish to install python3-cairo-1.15.3-1.fc27.x86_64 with rpm command how can I do that ?
You read the man page on the rpm command, and look at the options. Try putting "how to install an rpm package in linux using rpm" into Google. Sorry, but there's only so much homework I'll help with. Good luck

LEON71 06-26-2018 02:58 PM

Quote:

Originally Posted by TB0ne (Post 5872217)
....except you didn't post anything here in a different color, did you?

Wrong. Read the man page on the rpm command, and look at what those options do.

You read the man page on the rpm command, and look at the options. Try putting "how to install an rpm package in linux using rpm" into Google. Sorry, but there's only so much homework I'll help with. Good luck

I have a feeling that you are angry with me Sorry if i heart you by any way

TB0ne 06-26-2018 03:11 PM

Quote:

Originally Posted by LEON71 (Post 5872234)
I have a feeling that you are angry with me Sorry if i heart you by any way

You show little to no effort in any of your posts. You don't show that you've done any research, you don't post details, and we have to continually prod you to get you to provide things (as in the command RESULTS in this very thread). You have done this in all of your other threads, and continue to do it, despite being asked not to.

So tell me why we shouldn't get frustrated at this behavior?


All times are GMT -5. The time now is 02:48 PM.