---
title: "Ubuntu Precise 12.04 LTS 升級問題解決方法"
url: https://sammy.hk/ubuntu-precise-12-04-lts-upgrade-problem-troubleshoot/
author: Sammy Fung
published: 2012-05-01T19:37:10+08:00
modified: 2021-06-01T00:43:14+08:00
description: "沒想過在升級第二台 Ubuntu Oneiric 11.10 到 Precise 12.04 LTS 時，會遇上一些問題，所以寫了這篇 blog 來記述一下。 兩天前把第一台 (Lenovo ThinkPad T400s) Oneiric 11.10 升級時，只是使用「更新管理員」 (update-manager) 然…"
categories: ["開放源碼"]
tags: [ubuntu]
source: https://sammy.hk
---
沒想過在升級第二台 Ubuntu Oneiric 11.10 到 Precise 12.04 LTS 時，會遇上一些問題，所以寫了這篇 blog 來記述一下。

兩天前把第一台 (Lenovo ThinkPad T400s) Oneiric 11.10 升級時，只是使用「更新管理員」 (update-manager) 然後按下「升級至 12.04」，便能順利升級了。

**解決 Couldn’t configure pre-depend libtinfo5 for libncurses5 問題**

今天便把第二台 (Core2Duo + Gigabyte Intel G33 底板的自組機) Oneiric 11.10 升級時，同樣使用「更新管理員」 (update-manager) 然後按下「升級至 12.04」，在下載新套件後，卻出現以下錯誤。

> 無法安裝升級，提交時發生錯誤
> ‘E:Couldn’t configure pre-depend libtinfo5 for libncurses5, probably a dependency cycle.’
> 回復原有系統狀態

經過 google 後，至少有兩個方法可以嘗試解決。第一個方法是先升級 apt 套件後再升級 ([Bug #924079](https://bugs.launchpad.net/ubuntu/+source/apt/+bug/924079))，第二個方法是[先升級 libtinfo5、libncurses5 及 libncursesw5 套件](http://aaron-kelley.net/blog/2012/04/upgrade-from-ubuntu-11-10-oneiric-to-ubuntu-12-04-lts-precise-fails-with-error-couldnt-configure-pre-depend-libtinfo5-for-libncurses5-probably-a-dependency-cycle/)後再升級，我選擇了先升級 apt 的方法。

$ sed ‘s/oneiric/precise/g’ -i /etc/apt/sources.list
$ apt-get update
$ apt-get install apt python-apt
$ sed ‘s/precise/oneiric/g’ -i /etc/apt/sources.list

然後再使用「更新管理員」 (update-manager) 然後按下「升級至 12.04」，便可解決上述問題。

**解決 USB 鍵盤滑鼠不能用問題**

在更新管理員完成升級後，指示我重新啟動電腦。在重新啟動電腦後，在出現 LightDM 用戶登入畫面後，便發現我的 USB 鍵盤 keybOneiric 11.10 的 3.0.0 舊版本 kerneloard 和 mouse 也不能用！！！因為尚未登入，Network Manager 沒有自動經 DHCP 拿取 IP 地址，所以也不能經由網絡以 SSH 登入。 orz

使用過另一個 Linux 系統 mount 了 Precise 的硬碟分區來看 log，發現 kernel 不能偵測到 USB keyboard 和 mouse。還找到 init: Failed to create pty – disabling logging for job 等問題。

經過 google 閱讀不同類似情況後 ([Bug #990870](https://bugs.launchpad.net/ubuntu/+source/linux/+bug/990870)) \[[1](http://askubuntu.com/questions/127410/upgrading-to-ubuntu-12-04-loses-keyboard-and-mouse)\] \[[2](http://askubuntu.com/questions/127110/12-04-upgrade-not-working)\] ，最後嘗試在啟動電腦後 grub 開機 boot loader，在「Ubuntu, with Linux 3.2.0-24-generic」 一行上按 e 編輯修改設定，來載入仍在系統上的 [Oneiric 11.10 的 3.0.0 舊版本 kernel](https://launchpad.net/ubuntu/oneiric/+package/linux-image)。

linux **/boot/vmlinuz-3.2.0-24-generic** root=UUID=c3efdcfb-589d-4103-a147-c7435f45ffff ro quiet splash

把上述一行改為以下一行，然後接 F10 去啟動系統。USB Keyboard 和 Mouse 在舊 kernel 下仍能使用，在LightDM 用戶登入畫面 就能進入 Unity 或 GNOME。

linux **/boot/vmlinuz-3.0.0-17-generic** root=UUID=c3efdcfb-589d-4103-a147-c7435f45ffff ro quiet splash

登入後，啟動終端機 (terminal) 並執行以下 apt-get 指令。

$ sudo apt-get -f install

然後 apt-get 會繼續進行未完成的套件安裝和設定，終於能用 USB keyboard 和 mouse 了！！！

### 相關文章：

1. [成功在 notebook 的 Ubuntu 上設定 Compiz 3D compositing](https://sammy.hk/%e6%88%90%e5%8a%9f%e5%9c%a8-notebook-%e7%9a%84-ubuntu-%e4%b8%8a%e8%a8%ad%e5%ae%9a-compiz-3d-compositing/ "成功在 notebook 的 Ubuntu 上設定 Compiz 3D compositing")
2. [F-Spot 與我的 Gallery 相簿](https://sammy.hk/f-spot-%e8%88%87%e6%88%91%e7%9a%84-gallery-%e7%9b%b8%e7%b0%bf/ "F-Spot 與我的 Gallery 相簿")
3. [Ubuntu 7.10 在我的 P30 上閃屏問題](https://sammy.hk/ubuntu-710-%e5%9c%a8%e6%88%91%e7%9a%84-p30-%e4%b8%8a%e9%96%83%e5%b1%8f%e5%95%8f%e9%a1%8c/ "Ubuntu 7.10 在我的 P30 上閃屏問題")
4. [\[Presentation\] My Linux Experience: Ubuntu on netbook](https://sammy.hk/ubuntuonnetbook/ "[Presentation] My Linux Experience: Ubuntu on netbook")
