Centos -- yum command running error Solution

Source: Internet
Author: User

Problem:

[[Email protected] user] # Yum
File "/usr/bin/yum", line 30
Except t keyboardinterrupt, E:
^

 

Cause:

This is because Yum uses python as the command interpreter, which can be the first line in the/usr/bin/Yum file #! /Usr/bin/Python found. The compatibility between Python versions is not good, so there is a syntax inconsistency between 2.x and 3.0. The yum of centos 6 adopts python2.6. When the system upgrades python to 3.0, a syntax error occurs.

 

Solution:

It's easy. Upgrade yum, and change the yum interpreter to the earlier version python2.4 (if you do not use the overwrite upgrade)

The upgrade of Yum will not be detailed;

Modify the yum interpreter to the earlier version python2.6:

VI/usr/bin/yum

 

Set the first line "#! /Usr/bin/Python "changed "#! /Usr/bin/python2.6"

Centos -- yum command running error Solution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.