CentOS 8下Git Clone Odoo仓库报HTTPS不存在错误的排查求助
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:
If you get "NXDOMAIN" or "server failure" messages, your DNS servers are not working correctly.nslookup github.com dig google.com
Fix DNS Settings
CentOS 8 typically uses NetworkManager to manage DNS. Here's how to fix it:
Temporary fix (immediate effect, resets on reboot):
Edit/etc/resolv.confand replace existing nameservers with reliable public ones:echo -e "nameserver 8.8.8.8\nnameserver 1.1.1.1" > /etc/resolv.confThen test again with
nslookup github.comto confirm resolution works.Permanent fix (survives reboots):
Find your active network connection name first:nmcli con showThen 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:
- Generate an SSH key (press enter through all prompts to accept defaults):
ssh-keygen -t ed25519 -C "your-email@example.com" - Copy the public key to your clipboard:
cat ~/.ssh/id_ed25519.pub - Add this key to your GitHub account under Settings > SSH and GPG keys.
- 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

