環境:ubuntu 14.04 STL、64位
在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 軟體名稱。這一步就會正確安裝軟體了,ok。