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

Ubuntu 14安装git与openssh-client报错:依赖包损坏、无安装候选

Fixing "Held Broken Packages" & "No Installation Candidate" on Ubuntu 14.04 for Git/OpenSSH-Client

Hey there, let's work through this issue together. Those errors you're seeing are super common on Ubuntu 14.04 these days, and it mostly comes down to the fact that Ubuntu 14.04 reached its end-of-life (EOL) years ago—meaning the default package repositories are no longer active. Here's a step-by-step fix:

Step 1: Resolve Existing Package Issues

First, let's clean up and fix any broken dependencies or held packages that might be blocking installs:

  • Clear out cached packages that could be corrupted:
    sudo apt-get clean
    sudo apt-get autoclean
    
  • Force-fix any unmet dependencies in your system:
    sudo apt-get -f install
    
  • Check if any packages are marked as "held" (this locks them and prevents updates/installs):
    sudo apt-mark showhold
    
    If you see packages listed here, unhold them with:
    sudo apt-mark unhold <package-name>
    
    Replace <package-name> with the actual package from the output.

Step 2: Switch to Ubuntu's Old Releases Repository

Since Ubuntu 14.04 is no longer supported, we need to point your system to the archived repositories that still host its packages:

  • First, back up your current sources list (a safety net in case something goes wrong):
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    
  • Update all repository URLs to use the old releases server. You can do this quickly with a sed command:
    sudo sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
    sudo sed -i 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
    
    Alternatively, edit the file manually with sudo nano /etc/apt/sources.list and replace every instance of archive.ubuntu.com or security.ubuntu.com with old-releases.ubuntu.com.
  • Refresh your package cache with the updated sources:
    sudo apt-get update
    

Step 3: Install Git & OpenSSH-Client

Now that your repositories are working again, try installing the packages you need:

  • Install Git:
    sudo apt-get install git
    
  • Install OpenSSH-Client:
    sudo apt-get install openssh-client
    

If You Still Run Into Issues

If the errors persist, try these extra troubleshooting steps:

  • Force-configure any partially installed packages that might be stuck:
    sudo dpkg --configure -a
    
  • Temporarily disable any third-party repositories you've added (check the /etc/apt/sources.list.d/ directory) and run sudo apt-get update again before attempting the install.

内容的提问来源于stack exchange,提问作者فاطمه الطاهر

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 07:41:26