2021年2月21日 星期日

[Ubuntu] libpng 版本相沖

這次是 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

2021年2月3日 星期三

[vim] python 的縮排

 參考這篇

```

filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab

```