升级Ubuntu 9.10时出现问题

我一直在尝试将我在Ubuntu上的版本从9.10升级到10.04(并最终升级到最新版本),但是我遇到了破坏软件包的问题。

我试过了:

  • apt-get update
  • apt-get升级
  • apt-get dist-upgrade
  • dpkg –configure -a(不知道为什么)

我不确定什么是相关的,所以我要抛弃我所拥有的东西:

升级尝试的输出:

$ sudo do-release-upgrade Checking for a new ubuntu release Done Upgrade tool signature Done Upgrade tool Done downloading extracting 'lucid.tar.gz' authenticate 'lucid.tar.gz' against 'lucid.tar.gz.gpg' tar: Removing leading `/' from member names Reading cache Checking package manager Reading package lists: Done Reading state information: Done Reading state information: Done Reading state information: Done Done downloading Reading package lists: Done Reading state information: Done Reading state information: Done Reading state information: Done Updating repository information WARNING: Failed to read mirror file Done downloading Checking package manager Reading package lists: Donelucid-security/multiverse Packages: 96 gutsy/restricted Packages: 02 Reading state information: Done Reading state information: Done Reading state information: Done Calculating the changes Calculating the changes Could not calculate the upgrade An unresolvable problem occurred while calculating the upgrade: E:Unable to correct problems, you have held broken packages. This can be caused by: * Upgrading to a pre-release version of Ubuntu * Running the current pre-release version of Ubuntu * Unofficial software packages not provided by Ubuntu If none of this applies, then please report this bug against the 'update-manager' package and include the files in /var/log/dist-upgrade/ in the bug report. Restoring original system state Aborting Reading package lists: Donekarmic-security/multiverse Packages: 95 utsy/restricted Packages: 02 Reading state information: Done Reading state information: Done Reading state information: Done 

/etc/apt/sources.list(删除了大部分注释)

 $ cat sources.list # deb cdrom:[Ubuntu 9.10 _Karmic Koala_ - Release i386 (20091028.5)]/ karmic main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted deb http://us.archive.ubuntu.com/ubuntu/ karmic main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ karmic main restricted deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates main restricted deb http://us.archive.ubuntu.com/ubuntu/ karmic universe deb-src http://us.archive.ubuntu.com/ubuntu/ karmic universe deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates universe deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates universe deb http://us.archive.ubuntu.com/ubuntu/ karmic multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic multiverse deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates multiverse # deb http://us.archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse # deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse ## respective vendors as a service to Ubuntu users. deb http://archive.canonical.com/ubuntu karmic partner deb-src http://archive.canonical.com/ubuntu karmic partner deb http://security.ubuntu.com/ubuntu karmic-security main restricted deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted deb http://security.ubuntu.com/ubuntu karmic-security universe deb-src http://security.ubuntu.com/ubuntu karmic-security universe deb http://security.ubuntu.com/ubuntu karmic-security multiverse deb-src http://security.ubuntu.com/ubuntu karmic-security multiverse ## Packages for Chrome #deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main #deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main ## Latest PHP packages #deb http://php53.dotdeb.org stable all #deb-src http://php53.dotdeb.org stable all #deb http://security.ubuntu.com/ubuntu jaunty-security main 

/var/log/dist-upgrade/main.log的最后几行

 2011-08-02 19:21:54,211 DEBUG entry 'deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse' updated to new dist 2011-08-02 19:21:54,246 DEBUG running doUpdate() (showErrors=True) 2011-08-02 19:22:24,895 DEBUG openCache() 2011-08-02 19:22:24,895 DEBUG failed to SystemUnLock() (E:Not locked) 2011-08-02 19:22:29,991 DEBUG /openCache(), new cache size 30853 2011-08-02 19:22:29,991 DEBUG needServerMode(): run in 'desktop' mode, (because of pkg 'ubuntu-desktop') 2011-08-02 19:26:29,025 DEBUG Installing 'upstart-logd' (priority in required set 'required' but not scheduled for install) 2011-08-02 19:26:30,695 ERROR Dist-upgrade failed: 'E:Unable to correct problems, you have held broken packages.' 2011-08-02 19:26:30,696 DEBUG abort called 2011-08-02 19:26:30,697 DEBUG openCache() 2011-08-02 19:26:30,698 DEBUG failed to SystemUnLock() (E:Not locked) 2011-08-02 19:26:33,728 DEBUG /openCache(), new cache size 29182 2011-08-02 19:26:33,728 DEBUG enabling apt cron job 

我试着删除Gutsy CD系列:

 deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted 

我认为线索在错误信息中 –

抱怨Gutsy在场。 在你的sources.list文件中你有CDROM作为deb cdrom:[Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)]/ gutsy main restricted d

使用“软件源”窗口 – 取消选中CDROM。 或者,只需在sources.list文件中添加一行#。

更有可能的是,您的问题是由于您的计算机上安装了PPA软件包。 由于PPA具有比官方存储库更新的包,因此升级不知道如何替换它们。 幸运的是,这是一个简单的ppa-purge修复方法。 查看下面的文章,或者只是Google ppa-purge了解更多信息。

http://bigbrovar.aoizora.org/index.php/2010/01/10/how-to-safely-remove-ppa-repository-from-ubuntu/

如果你有aptitude sudo aptitude search ~b会给你破碎的包裹清单。 您很可能会识别出应删除哪些ppa /包。

删除PPA( apt-get install package=version )后,可以通过安装旧版本来删除它们,也可以使用dpkg force remove强制删除它。

由于它没有解决问题,你可以用Debian的方式做到这一点。 用ubuntu 10.04 sources.list替换sources.list内容并执行aptitude dist-upgrade。 您最终可能会遇到几个破损的软件包,但您可以通过重新安装来轻松修复它(如果您没有手动配置任何重要的东西,您可以清除这些软件包并安装它们)。

如果它不起作用,还有另一种选择(但它很难看):

我从8.04升级到8.10(破包,升级停在中间)出了意外,我用来恢复的解决方案是除了ubuntu-minimal一切(和一些相关的东西,主要是wifi驱动,你可以做这很容易在ncurses ui for aptitude中,只需键入sudo aptitude而不用任何参数)并在切换到新的sources.list并通过dist-upgrade升级系统后安装ubuntu-desktop

它可以工作,因为升级最小系统非常容易,它将保留大部分内容的配置。

但是在这一点上,如果你的/home/ dir在一个单独的分区上并且没有任何重要的手工配置(特别是/etc/ dir),安装任何新的Ubuntu你的新副本会容易得多喜欢。