Android SDK Tools安装报错求助:Linux Mint下sdkmanager命令执行失败
Hey there, let's work through this SSL handshake error you're hitting when running sdkmanager --list. I've dealt with similar certificate headaches on Debian-based distros like Linux Mint before, so here are a few actionable fixes to try:
1. Update System CA Certificates
The most common culprit here is outdated or missing system root certificates. Let's refresh them first:
- Run these commands to update and reinstall the CA certificates package:
sudo apt update && sudo apt install --reinstall ca-certificates - Force the system to reconfigure all certificates:
sudo update-ca-certificates -f - Now try running
sdkmanager --listagain to see if the error clears up.
2. Import System Certificates into Java's Trust Store
Sometimes system certificates are up to date, but Java's own trust store (cacerts) doesn't include them. Here's how to sync them:
- First, find your Java installation path. Run this command to list available Java versions:
Example output might beupdate-alternatives --list java/usr/lib/jvm/java-11-openjdk-amd64/bin/java— the cacerts file lives in thejre/lib/securitysubfolder of that path, so it would look like/usr/lib/jvm/java-11-openjdk-amd64/jre/lib/security/cacerts. - Copy the system CA bundle to a temporary file:
sudo cp /etc/ssl/certs/ca-certificates.crt ~/system-ca.crt - Import this bundle into Java's trust store (the default password is
changeit):
Replacesudo keytool -importcert -file ~/system-ca.crt -keystore /path/to/your/java/cacerts -storepass changeit -noprompt/path/to/your/java/cacertswith the actual path you found earlier. - Clean up the temporary file:
rm ~/system-ca.crt - Test the
sdkmanager --listcommand again.
3. Temporary Workaround: Disable HTTPS (Not Recommended)
If you need a quick fix for testing (and understand the security risks), you can skip SSL verification:
sdkmanager --list --no-https --verbose
Note: This bypasses certificate checks, so only use this temporarily until you get the proper certificate setup working.
Additional Checks
- Verify your Java version is compatible: Android SDK Manager works best with Java 8 or 11. Check with
java -versionand switch versions if needed usingupdate-alternatives --config java. - If you're behind a proxy, make sure to pass proxy settings to sdkmanager:
sdkmanager --list --proxy=http --proxy_host=your-proxy-address --proxy_port=your-proxy-port
内容的提问来源于stack exchange,提问作者Edy Silva

