在ubuntu中我們使用sudo apt-get install 或者dpkg -i *.deb安裝軟件時,常常提示“有未能滿足的依賴關系“,解決方法


很早之前在ubuntu安裝軟件時遇到的問題,今天打開ubuntu看到了,總結如下:

在ubuntu中我們使用sudo apt-get install 或者dpkg -i *.deb安裝軟件常常提示“有未能滿足的依賴關系“,這是因為當前軟件源中依賴庫的版本不滿足軟件的要求。

解決辦法:
  步驟1:更新軟件源。ubuntu自帶的軟件源比較舊,很多的軟件版本較低,國內比較好用的源有阿里源;

      sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #備份
      sudo vim /etc/apt/sources.list #修改源列表,將阿里雲源復制到sources.list文件中
      sudo apt-get update #更新本地源列表;

     阿里雲源:

        deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

        deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

        deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

        deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

        deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

        deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

        deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

        deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

       deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

     deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

  步驟2:sudo apt-get install 軟件名稱。這里會提示“有未能滿足的依賴關系“。
  步驟3:sudo apt-get -f install。這個命令會針對當前不滿足的依賴關系,下載正確版本的依賴庫。

    步驟4:sudo apt-get install 軟件名稱。這一步就會正確安裝軟件了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM