申明:本帖只是此帖:Debugging Dpkg Problems的一個簡化.
問題描述:
$sudo apt-get update
$sudo dpkg -i /var/cache/apt/archives/libc6_2.4-1Ubuntu10_i386.deb
>Preparing to replace libc6 2.4-1ubuntu6 (using .../libc6_2.4-1ubuntu10_i386.deb) ...
>Matching libraries: /usr/lib/libpthread.so.20 /lib/ld-linux.so.2
>A copy of glibc was found in an unexpected directory.
>...
>dpkg: error processing /var/cache/apt/archives/libc6_2.4-1ubuntu10_i386.deb (--install)...
解決簡化:
//據引用帖知,問題與libpthread包有關聯
1.查看libpthread:
$sudo dpkg -l | grep libpthread
>ii libpthread20 2.0.7-2ubuntu2 The GNU Portable Threads (pthread emulation)
2.卸載libpthread:
$sudo apt-get remove --purge libpthread
//若能順利刪除則可執行(然後第4步):
$sudo apt-get update && sudo apt-get dist-upgrade
//若不能卸載libpthread,則須進行下一步
3.手動mv掉libpthread,然後再嘗試升級:
$sudo mkdir /usr/lib/temp
$sudo mv /usr/lib/libpthread* /usr/lib/temp/
$sudo apt-get update && sudo apt-get dist-upgrade
4.最後得將libpthread復原,否則系統會出問題:
$sudo mv /usr/lib/libpthread* /usr/lib/
$sudo rm -r /usr/lib/temp