LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 05-18-2020, 02:11 AM   #1
AlanRyu
LQ Newbie
 
Registered: May 2020
Posts: 1

Rep: Reputation: Disabled
Exclamation accidentally delete python3 in /usr/bin


Hi techleads!

Plz help me!!! I am so desperate now!! I accidentally delete python3 in /usr/bin and this is what happened:
[Ra@localhost bin]$ sudo pip3 install requests beautifulsoup4 lxml termcolor pythonping dnspython
sudo: unable to execute /usr/local/bin/pip3: No such file or directory
[Ra@localhost bin]$ cd /usr/bin/pip
bash: cd: /usr/bin/pip: No such file or directory
[Ra@localhost bin]$ sudo dnf remove python
sudo: unable to execute /usr/bin/dnf: No such file or directory
[Ra@localhost bin]$ sudo yum remove python
sudo: unable to execute /usr/bin/yum: No such file or directory
[Ra@localhost ~]$ python
bash: python: command not found...

Here are some output of commands that may be helpful..
[Ra@localhost bin]$ ll
lrwxrwxrwx. 1 root root 8 Mar 3 00:42 pydoc -> ./pydoc3
lrwxrwxrwx. 1 root root 8 Mar 3 00:42 pydoc3 -> pydoc3.8
-rwxr-xr-x. 1 root root 78 Mar 3 00:42 pydoc3.8
-rwxr-xr-x. 1 root root 392 Jan 30 23:48 pyinotify
lrwxrwxrwx. 1 root root 9 Mar 3 01:05 python -> ./python3
lrwxrwxrwx. 1 root root 16 May 18 16:22 python3.6 -> /usr/bin/python3
-rwxr-xr-x. 1 root root 15408 Mar 3 00:42 python3.8
-rwxr-xr-x. 1 root root 2558 Jan 30 21:45 python-argcomplete-check-easy-install-script
-rwxr-xr-x. 1 root root 318 Jan 30 21:45 python-argcomplete-tcsh

[Ra@localhost bin]$ rpm -q dnf python3-dnf python3 python3-rpm
dnf-4.2.21-1.fc32.noarch
python3-dnf-4.2.21-1.fc32.noarch
python3-3.8.2-2.fc32.x86_64
python3-rpm-4.15.1-3.fc32.1.x86_64
[Ra@localhost bin]$ rpm -q --requires python3-dnf | grep python
/usr/bin/python3
python(abi) = 3.8
python3-gpg
python3-hawkey >= 0.46.2
python3-libcomps >= 0.1.8
python3-libdnf
python3-libdnf >= 0.46.2
python3-rpm >= 4.14.0
[Ra@localhost bin]$ rpm -q --requires python3-rpm | grep python
python(abi) = 3.8

[Ra@localhost bin]$ type -p dnf
/usr/bin/dnf
[Ra@localhost bin]$ sudo rpm --verify --all
.......T. /boot/efi/EFI/BOOT/BOOTIA32.EFI
.......T. /boot/efi/EFI/BOOT/fbia32.efi
.......T. /boot/efi/EFI/fedora/BOOTIA32.CSV
.......T. /boot/efi/EFI/fedora/mmia32.efi
.......T. /boot/efi/EFI/fedora/shimia32-fedora.efi
.......T. /boot/efi/EFI/fedora/shimia32.efi
.M....... g /run/lock/ppp
.M....... g /run/ppp
.M....... c /etc/fstab
.M....G.. g /var/log/lastlog
.M....... g /boot/System.map-5.6.10-300.fc32.x86_64
.M....... g /boot/initramfs-5.6.10-300.fc32.x86_64.img
.......T. /lib/modules/5.6.10-300.fc32.x86_64/modules.builtin.alias.bin
.M....... c /etc/machine-id
.M....... g /var/log/btmp
.M....G.. g /var/log/journal
.M....... g /var/lock/iscsi
.M....... g /var/lock/iscsi/lock
.M....... g /var/lib/snapd/snap/README
.M....... g /var/lib/snapd/state.json
.......T. /boot/efi/EFI/fedora/grubia32.efi
missing /usr/bin/python3
.M....... /boot/efi/System
.M....... /boot/efi/System/Library
.M....... /boot/efi/System/Library/CoreServices
.M.....T. /boot/efi/System/Library/CoreServices/SystemVersion.plist
.M.....T. /boot/efi/mach_kernel
.M....... g /boot/System.map-5.6.11-300.fc32.x86_64
.M....... g /boot/initramfs-5.6.11-300.fc32.x86_64.img
.......T. /lib/modules/5.6.11-300.fc32.x86_64/modules.builtin.alias.bin
.M....... g /boot/System.map-5.6.12-300.fc32.x86_64
.M....... g /boot/initramfs-5.6.12-300.fc32.x86_64.img
.......T. /lib/modules/5.6.12-300.fc32.x86_64/modules.builtin.alias.bin
S.5....T. c /var/lib/unbound/root.key
....L.... c /etc/pam.d/fingerprint-auth
....L.... c /etc/pam.d/password-auth
....L.... c /etc/pam.d/postlogin
....L.... c /etc/pam.d/smartcard-auth
....L.... c /etc/pam.d/system-auth
SM5....T. c /etc/crypto-policies/back-ends/nss.config
.M....G.. g /etc/brlapi.key
....L.... c /etc/nsswitch.conf
.......T. /boot/efi/EFI/fedora/gcdia32.efi
.M....... /var/lib/AccountsService/icons
.M....... g /run/dbus
.M....... g /var/lib/plymouth/boot-duration
.......T. /boot/efi/EFI/BOOT/BOOTX64.EFI
.......T. /boot/efi/EFI/BOOT/fbx64.efi
.......T. /boot/efi/EFI/fedora/BOOTX64.CSV
.......T. /boot/efi/EFI/fedora/mmx64.efi
.......T. /boot/efi/EFI/fedora/shim.efi
.......T. /boot/efi/EFI/fedora/shimx64-fedora.efi
.......T. /boot/efi/EFI/fedora/shimx64.efi
.M....G.P /usr/sbin/tcpdump
.......T. c /etc/selinux/targeted/contexts/customizable_types
..5....T. /var/lib/selinux/targeted/active/commit_num
S.5....T. /var/lib/selinux/targeted/active/file_contexts
S.5....T. /var/lib/selinux/targeted/active/homedir_template
S.5....T. /var/lib/selinux/targeted/active/policy.kern
.......T. /var/lib/selinux/targeted/active/seusers
.......T. /var/lib/selinux/targeted/active/users_extra
.M....G.. g /var/log/lastlog
S.5....T. c /etc/sudoers
.M....... g /etc/udev/hwdb.bin
.M....... c /etc/vconsole.conf
.M....... g /var/lib/systemd/random-seed
.M....... /boot/efi/EFI
S.5....T. c /etc/cups/cups-browsed.conf
....L.... c /etc/nsswitch.conf
.M....... g /var/lib/dnf
.M....... g /var/log/dnf.librepo.log
.M....... g /var/log/hawkey.log
.M....G.. /var/log/gdm
.....UG.. g /var/run/avahi-daemon
missing /run/gluster/metrics
[Ra@localhost bin]$ sudo rpm --verify --all
.......T. /boot/efi/EFI/BOOT/BOOTIA32.EFI
.......T. /boot/efi/EFI/BOOT/fbia32.efi
.......T. /boot/efi/EFI/fedora/BOOTIA32.CSV
.......T. /boot/efi/EFI/fedora/mmia32.efi
.......T. /boot/efi/EFI/fedora/shimia32-fedora.efi
.......T. /boot/efi/EFI/fedora/shimia32.efi
.M....... g /run/lock/ppp
.M....... g /run/ppp
.M....... c /etc/fstab
.M....G.. g /var/log/lastlog
.M....... g /boot/System.map-5.6.10-300.fc32.x86_64
.M....... g /boot/initramfs-5.6.10-300.fc32.x86_64.img
.......T. /lib/modules/5.6.10-300.fc32.x86_64/modules.builtin.alias.bin
.M....... c /etc/machine-id
.M....... g /var/log/btmp
.M....G.. g /var/log/journal
.M....... g /var/lock/iscsi
.M....... g /var/lock/iscsi/lock
.M....... g /var/lib/snapd/snap/README
.M....... g /var/lib/snapd/state.json
.......T. /boot/efi/EFI/fedora/grubia32.efi
missing /usr/bin/python3
.M....... /boot/efi/System
.M....... /boot/efi/System/Library
.M....... /boot/efi/System/Library/CoreServices
.M.....T. /boot/efi/System/Library/CoreServices/SystemVersion.plist
.M.....T. /boot/efi/mach_kernel
.M....... g /boot/System.map-5.6.11-300.fc32.x86_64
.M....... g /boot/initramfs-5.6.11-300.fc32.x86_64.img
.......T. /lib/modules/5.6.11-300.fc32.x86_64/modules.builtin.alias.bin
.M....... g /boot/System.map-5.6.12-300.fc32.x86_64
.M....... g /boot/initramfs-5.6.12-300.fc32.x86_64.img
.......T. /lib/modules/5.6.12-300.fc32.x86_64/modules.builtin.alias.bin
S.5....T. c /var/lib/unbound/root.key
....L.... c /etc/pam.d/fingerprint-auth
....L.... c /etc/pam.d/password-auth
....L.... c /etc/pam.d/postlogin
....L.... c /etc/pam.d/smartcard-auth
....L.... c /etc/pam.d/system-auth
SM5....T. c /etc/crypto-policies/back-ends/nss.config
.M....G.. g /etc/brlapi.key
....L.... c /etc/nsswitch.conf
.......T. /boot/efi/EFI/fedora/gcdia32.efi
.M....... /var/lib/AccountsService/icons
.M....... g /run/dbus
.M....... g /var/lib/plymouth/boot-duration
.......T. /boot/efi/EFI/BOOT/BOOTX64.EFI
.......T. /boot/efi/EFI/BOOT/fbx64.efi
.......T. /boot/efi/EFI/fedora/BOOTX64.CSV
.......T. /boot/efi/EFI/fedora/mmx64.efi
.......T. /boot/efi/EFI/fedora/shim.efi
.......T. /boot/efi/EFI/fedora/shimx64-fedora.efi
.......T. /boot/efi/EFI/fedora/shimx64.efi
.M....G.P /usr/sbin/tcpdump
.......T. c /etc/selinux/targeted/contexts/customizable_types
..5....T. /var/lib/selinux/targeted/active/commit_num
S.5....T. /var/lib/selinux/targeted/active/file_contexts
S.5....T. /var/lib/selinux/targeted/active/homedir_template
S.5....T. /var/lib/selinux/targeted/active/policy.kern
.......T. /var/lib/selinux/targeted/active/seusers
.......T. /var/lib/selinux/targeted/active/users_extra
.M....G.. g /var/log/lastlog
S.5....T. c /etc/sudoers
.M....... g /etc/udev/hwdb.bin
.M....... c /etc/vconsole.conf
.M....... g /var/lib/systemd/random-seed
.M....... /boot/efi/EFI
S.5....T. c /etc/cups/cups-browsed.conf
....L.... c /etc/nsswitch.conf
.M....... g /var/lib/dnf
.M....... g /var/log/dnf.librepo.log
.M....... g /var/log/hawkey.log
.M....G.. /var/log/gdm
.....UG.. g /var/run/avahi-daemon
missing /run/gluster/metrics

[Ra@localhost bin]$ yum-deprecated
bash: yum-deprecated: command not found...

HELP!!!!!!!!!!!!!!!!!!!!
 
Old 05-18-2020, 10:33 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 1,016

Rep: Reputation: Disabled
Quote:
Originally Posted by AlanRyu View Post
[Ra@localhost bin]$ ll
lrwxrwxrwx. 1 root root 8 Mar 3 00:42 pydoc -> ./pydoc3
lrwxrwxrwx. 1 root root 8 Mar 3 00:42 pydoc3 -> pydoc3.8
-rwxr-xr-x. 1 root root 78 Mar 3 00:42 pydoc3.8
-rwxr-xr-x. 1 root root 392 Jan 30 23:48 pyinotify
lrwxrwxrwx. 1 root root 9 Mar 3 01:05 python -> ./python3
lrwxrwxrwx. 1 root root 16 May 18 16:22 python3.6 -> /usr/bin/python3
-rwxr-xr-x. 1 root root 15408 Mar 3 00:42 python3.8
-rwxr-xr-x. 1 root root 2558 Jan 30 21:45 python-argcomplete-check-easy-install-script
-rwxr-xr-x. 1 root root 318 Jan 30 21:45 python-argcomplete-tcsh
Looks like /usr/bin/python3.8 is still there. You probably just removed the symlink. Then
Code:
cd /usr/bin
sudo ln -s python3.8 python3
 
1 members found this post helpful.
Old 05-18-2020, 11:16 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 14,698

Rep: Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800Reputation: 4800
I do not really understand what you posted (why did you do that, what did you try ...) and what's happened at all.
Do not try to remove python3. Now probably you can download that package, pick that file and put it into /usr/bin (por just try to force reinstall).
But as far as I see there can be other problems too...
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] how to start python3.6 interpreter just by typing python in terminal not python3.6 bmohanraj91 Linux - Newbie 4 05-10-2017 07:51 AM
After upgrade python3.4 to python3.5.1 , not able to install packages "request" though pip3 YOGESHAS87 Linux - Software 1 08-03-2016 10:38 PM
Error: Cannot find 'ssh-keygen' in '/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin' venu.navat Linux - Software 3 03-08-2012 04:00 AM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
Accidentally Linked /usr/bin to /bin... worldgnat Linux - Software 2 04-01-2006 06:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 04:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration