 I installed the python3.8 version for my application and deleted the python2.7 in amazon linux 2 , now yum command is not working.
I installed the python3.8 version for my application and deleted the python2.7 in amazon linux 2 , now yum command is not working.
- 
        reinstall Python 2.7. Multiple Python version can co-exist. for your application, learn how to use "venv"Sharuzzaman Ahmat Raslan– Sharuzzaman Ahmat Raslan2021-06-28 08:17:27 +00:00Commented Jun 28, 2021 at 8:17
- 
        Welcome to the site. Please don't post screenshots of console output. They are often difficult to read, the content will not show up in search engine results, and contributors trying to help will have to type-copy content when trying to analyze/reproduce your problem. Instead, paste it into the question using code formatting.AdminBee– AdminBee2021-06-28 10:09:25 +00:00Commented Jun 28, 2021 at 10:09
- 
        Do you have "dnf" installed? It may not work for the same reason "yum" won't work - or it might not exist Amazon LInux 2. In fact you may have a hard time anything. I'd recommend contacting AWS to see if they can re-install it for you.Cinaed Simson– Cinaed Simson2021-06-28 20:31:13 +00:00Commented Jun 28, 2021 at 20:31
                    
                        Add a comment
                    
                 | 
            
                
            
        
         
    1 Answer
Could be you have not deleted the actual file and have just deleted the link the /usr/bin/python
Assuming that is the case
Check what all python are present in the directory by
ls /usr/bin/python*
If python 2.7 is present then create a symlink for the same by
Backup usr/bin/python first
You can create symlink by
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
