You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CentOS 8下Git Clone Odoo仓库报HTTPS不存在错误的排查求助

Troubleshooting Git Clone & HTTPS Connectivity Issues on CentOS 8 VPS

Hey there, let's break down this problem and fix it step by step. I've run into similar HTTPS/DNS headaches on CentOS 8 before, so here's what to check:

First: Double-Check Your Git Clone Command

That "repository 'https' does not exist" error often pops up if you mistyped the repository URL. Make sure you're using the full, correct Odoo repo address:

git clone https://github.com/odoo/odoo.git

If you accidentally truncated the URL (e.g., just typed git clone https), that's exactly why you're seeing this error. Fix the command first before moving on.

Step 1: Verify DNS Resolution (Likely Culprit)

Since you can't access Google via HTTPS either, DNS failure is the most probable issue. Let's confirm:

  • Run these commands to test if your server can resolve GitHub and Google:
    nslookup github.com
    dig google.com
    
    If you get "NXDOMAIN" or "server failure" messages, your DNS servers are not working correctly.

Fix DNS Settings

CentOS 8 typically uses NetworkManager to manage DNS. Here's how to fix it:

  1. Temporary fix (immediate effect, resets on reboot):
    Edit /etc/resolv.conf and replace existing nameservers with reliable public ones:

    echo -e "nameserver 8.8.8.8\nnameserver 1.1.1.1" > /etc/resolv.conf
    

    Then test again with nslookup github.com to confirm resolution works.

  2. Permanent fix (survives reboots):
    Find your active network connection name first:

    nmcli con show
    

    Then update the DNS servers for that connection (replace <your-connection-name> with the actual name, e.g., "ens3"):

    nmcli con mod <your-connection-name> ipv4.dns "8.8.8.8 1.1.1.1"
    nmcli con up <your-connection-name>
    

    Restart NetworkManager to apply changes:

    systemctl restart NetworkManager
    

Step 2: Check for HTTPS Proxy Interference

Sometimes a misconfigured proxy can block HTTPS traffic. Check if any proxy variables are set:

echo $https_proxy
echo $HTTP_PROXY

If you see any proxy URLs here, unset them temporarily to test:

unset https_proxy
unset HTTP_PROXY

Then try cloning the repo again or accessing Google via curl https://google.com.

Step 3: Verify System CA Certificates

Expired or missing CA certificates can break HTTPS connections. Install/update them:

dnf install ca-certificates -y
update-ca-trust extract

After this, test HTTPS connectivity again with curl -v https://github.com to see if certificate errors are resolved.

Alternative: Clone via SSH (Bypass HTTPS)

If you still can't get HTTPS working, use SSH to clone the repo instead. You'll need to set up an SSH key pair on your VPS and add the public key to your GitHub account:

  1. Generate an SSH key (press enter through all prompts to accept defaults):
    ssh-keygen -t ed25519 -C "your-email@example.com"
    
  2. Copy the public key to your clipboard:
    cat ~/.ssh/id_ed25519.pub
    
  3. Add this key to your GitHub account under Settings > SSH and GPG keys.
  4. Now clone the repo using SSH:
    git clone git@github.com:odoo/odoo.git
    

After trying these steps, your git clone should work, and HTTPS access to external sites should be restored.

内容的提问来源于stack exchange,提问作者Axel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 13:32:47