這次是 ubuntu 16 遇到的鳥問題,應該是之前裝 ROS 把 repository 裝錯了,所以版本沖到。
錯誤訊息長這樣
```
x11-apps : Depends: libpng12-0 (>= 1.2.13-4) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
```
如果使用 apt-cache policy 個別去看
```
$ sudo apt-cache policy libpng12-0 libpng12-dev
libpng12-0:
Installed: (none)
Candidate: 1.2.54-1ubuntu1.1
Version table:
1.2.54-1ubuntu1.1 500
500 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
1.2.54-1ubuntu1 500
500 http://tw.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
1.2.50-1ubuntu2 500
500 http://archive.ubuntu.com/ubuntu trusty/main amd64 Packages
libpng12-dev:
Installed: 1.2.54-1ubuntu1.1
Candidate: 1.2.54-1ubuntu1.1
Version table:
*** 1.2.54-1ubuntu1.1 500
500 http://tw.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
100 /var/lib/dpkg/status
1.2.54-1ubuntu1 500
500 http://tw.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
1.2.50-1ubuntu2 500
500 http://archive.ubuntu.com/ubuntu trusty/main amd64 Packages
```
最後只好 overwrite 後來就好了?
```
$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
$ sudo apt-get -f install
```
參考這篇:https://unix.stackexchange.com/questions/405981/unmet-dependencies-problem-in-elementary-os-loki
沒有留言:
張貼留言