LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-26-2018, 07:49 AM   #1
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Rep: Reputation: Disabled
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 ?
 
Old 06-26-2018, 07:55 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
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.
 
Old 06-26-2018, 07:56 AM   #3
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
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 ?
 
Old 06-26-2018, 08:15 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
yes, look for the official documentation: https://fedoraproject.org/wiki/DNF?rd=Dnf
 
Old 06-26-2018, 10:22 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Fedora 27 :

The update command is not really # yum update
... but # dnf update
 
Old 06-26-2018, 10:24 AM   #6
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
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'
 
Old 06-26-2018, 10:33 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by LEON71 View Post
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.
 
Old 06-26-2018, 11:34 AM   #8
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
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
 
Old 06-26-2018, 12:00 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by LEON71 View Post
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?
 
Old 06-26-2018, 12:04 PM   #10
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
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
 
Old 06-26-2018, 12:29 PM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by LEON71 View Post
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.
 
Old 06-26-2018, 01:56 PM   #12
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
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 ?
 
Old 06-26-2018, 02:30 PM   #13
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by LEON71 View Post
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
 
Old 06-26-2018, 02:58 PM   #14
LEON71
Member
 
Registered: May 2018
Location: Canada
Distribution: Fedora 38 Workstation
Posts: 87

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
....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
 
Old 06-26-2018, 03:11 PM   #15
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,637

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by LEON71 View Post
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?
 
  


Reply

Tags
dnf, yum conf



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yum install flash ... yum: command not found ... which yum ... /usr/bin/yum tg0000 Fedora 8 04-13-2011 11:25 AM
[SOLVED] yum not working on fedora 12 Fred_mike Linux - Software 2 10-22-2010 05:31 AM
yum not working in fedora 11 av.dubey Linux - Newbie 2 08-14-2009 07:59 AM
yum Not Working in Fedora 4 vkmraja Linux - Newbie 1 02-02-2007 06:49 AM
Yum not Working in Fedora 4 vkmraja Fedora 1 02-02-2007 06:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration