search
HomeOperation and MaintenanceCentOSWhat should I do if the installation of git on centos fails?

What should I do if the installation of git on centos fails?

Solution to failure to install git on centos:

1. Uninstall the old version of git

yum remove git

2. Download the compressed package and unzip it

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz

tar -zxvf git-2.9.0.tar.gz

3. Install some dependency packages needed for git installation

If you unzip If you install git directly after that, you may encounter many problems (I did this at the beginning), most of which are caused by the lack of certain necessary packages during installation. git relies on zlib-devel, openssl-devel , perl, cpio, expat-devel, gettext-devel these packages, so make sure you have these packages before installing git. The following are the missing packages Errors that may occur and their solutions

1. Error one:

usr/bin/perl Makefile.PL PREFIX=’/usr/local/git’ INSTALL_BASE=’’ --localedir=’/usr/local/git/share/locale’
  Can’t locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5   /usr/share/perl5 .) at Makefile.PL line 3.
  BEGIN failed–compilation aborted at Makefile.PL line 3.
  make[1]: *** [perl.mak] Error 2
  make: *** [perl/perl.mak] Error 2

Solution:

yum install perl-ExtUtils-MakeMaker package
yum -y install perl-devel perl-CPAN

2.Error two:

/bin/sh: msgfmt: command not found

Solution:

yum install gettext-devel

3. Error three:

tclsh failed; using unoptimized loading
MSGFMT po/bg.msg make[1]: *** [po/bg.msg] 错误 127

Solution:

yum install tcl build-essential tk gettext

4. Install git

Check if there are some necessary packages in the three steps After solving the problem, you can install git (under normal circumstances, after solving the three-step common problems, the following command will not report an error. If there are still errors, please solve it according to the error Baidu)

cd git-2.9.0
./configure --prefix=/usr/local/git
make
make install

5. When checking the git version, bash appears: git:command not found

bash:git:command not found appears when git --version, and Enter the installation directory /usr/local/git/bin, execute ./git --version is git version 2.9.0, it can be seen that our git is installed Successfully, if you want to use the git command in a non-installation directory, the solution is as follows:

Open /etc/profile, find the line path manipulation, below Add the pathmunge command path in if then (for example: pathmunge /usr/loccl/git/bin). Then execute source /etc/profile, and execute git --version again. The execution will be successful, and the git version number will be displayed.

6. Using https to operate git appears: fatal: Unable to find remote helper for 'https'

Solution:

yum install -y curl curl-devel

7. git clone reports SSL connect error

Solution:

yum update -y nss curl libcurl

Recommended tutorial: "centos tutorial"

The above is the detailed content of What should I do if the installation of git on centos fails?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
CentOS: The Choice for Server EnvironmentsCentOS: The Choice for Server EnvironmentsMay 09, 2025 am 12:21 AM

CentOS is widely selected as a server operating system because it is stable, secure and free. 1.CentOS is based on RHEL, providing enterprise-level stability and a life cycle of up to 10 years. 2. It has rich software packages and strong community support. 3. Simple installation, use yum management software package, and intuitive configuration. 4. Improve server management efficiency through command line tools, regular backups and log management. 5. Optimize server performance by adjusting kernel and network parameters.

The Future of CentOS: What's Next?The Future of CentOS: What's Next?May 08, 2025 am 12:01 AM

CentOS will continue to develop through CentOSStream in the future. CentOSStream is no longer a direct clone of RHEL, but is part of RHEL development. Users can experience the new RHEL functions in advance and participate in development.

CentOS: From Development to Production EnvironmentsCentOS: From Development to Production EnvironmentsMay 07, 2025 am 12:08 AM

The transition from development to production in CentOS can be achieved through the following steps: 1. Ensure the consistent development and production environment, use the YUM package management system; 2. Use Git for version control; 3. Use Ansible and other tools to automatically deploy; 4. Use Docker for environmental isolation. Through these methods, CentOS provides powerful support from development to production, ensuring the stable operation of applications in different environments.

CentOS Stream: The Successor and its ImplicationsCentOS Stream: The Successor and its ImplicationsMay 06, 2025 am 12:02 AM

CentOSStream is a cutting-edge version of RHEL, providing an open platform for users to experience the new RHEL functions in advance. 1.CentOSStream is the upstream development and testing environment of RHEL, connecting RHEL and Fedora. 2. Through rolling releases, users can continuously receive updates, but they need to pay attention to stability. 3. The basic usage is similar to traditional CentOS and needs to be updated frequently; advanced usage can be used to develop new functions. 4. Frequently asked questions include package compatibility and configuration file changes, and requires debugging using dnf and diff. 5. Performance optimization suggestions include regular cleaning of the system, optimizing update policies and monitoring system performance.

CentOS: Examining the Reasons Behind the End of LifeCentOS: Examining the Reasons Behind the End of LifeMay 04, 2025 am 12:12 AM

The reason for the end of CentOS is RedHat's business strategy adjustment, community-business balance and market competition. Specifically manifested as: 1. RedHat accelerates the RHEL development cycle through CentOSStream and attracts more users to participate in the RHEL ecosystem. 2. RedHat needs to find a balance between supporting open source communities and promoting commercial products, and CentOSStream can better convert community contributions into RHEL improvements. 3. Faced with fierce competition in the Linux market, RedHat needs new strategies to maintain its leading position in the enterprise-level market.

The Reasons for CentOS's Shutdown: A Detailed AnalysisThe Reasons for CentOS's Shutdown: A Detailed AnalysisMay 03, 2025 am 12:05 AM

RedHat shut down CentOS8.x and launches CentOSStream because it hopes to provide a platform closer to the RHEL development cycle through the latter. 1. CentOSStream, as the upstream development platform of RHEL, adopts a rolling release mode. 2. This transformation aims to enable the community to get exposure to new RHEL features earlier and provide feedback to accelerate the RHEL development cycle. 3. Users need to adapt to changing systems and reevaluate system requirements and migration strategies.

CentOS: The Advantages of Using This Linux DistroCentOS: The Advantages of Using This Linux DistroMay 02, 2025 am 12:10 AM

CentOS stands out among enterprise Linux distributions because of its stability, security, community support and enterprise application advantages. 1. Stability: The update cycle is long and the software package has been strictly tested. 2. Security: Inherit the security features of RHEL, update and announce in a timely manner. 3. Community support: a huge community and detailed documentation to respond to problems quickly. 4. Enterprise applications: Support container technologies such as Docker, suitable for modern application deployment.

Comparing CentOS Replacements: Features and BenefitsComparing CentOS Replacements: Features and BenefitsMay 01, 2025 am 12:05 AM

Alternatives to CentOS include AlmaLinux, RockyLinux, and OracleLinux. 1.AlmaLinux provides RHEL compatibility and community-driven development. 2. RockyLinux emphasizes enterprise-level support and long-term maintenance. 3. OracleLinux provides Oracle-specific optimization and support. These alternatives have similar stability and compatibility to CentOS, and are suitable for users with different needs.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment