V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
PbCopy111
V2EX  ›  Ubuntu

升级 ubuntu21 失败,后面怎么办?

  •  
  •   PbCopy111 · 2021-08-02 20:43:14 +08:00 · 2743 次点击
    这是一个创建于 987 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我有一个 vps,ubuntu20.04 版本,打算升级到 21. 可是执行升级命令的时候报错,结果现在陷入了死循环,具体如下:

    sudo do-release-upgrade
    Checking for a new Ubuntu release
    Please install all available updates for your release before upgrading.  
    
    sudo apt update  
    59 packages can be upgraded. Run 'apt list --upgradable' to see them.  
    
    sudo apt upgrade 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    The following packages have been kept back:
      bind9-dnsutils bind9-host libmagickwand-6.q16-6 libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail libnss-systemd
      libpython2.7-minimal libqca-qt5-2 libqt5dbus5 libqt5sql5-sqlite linux-headers-generic mariadb-client mariadb-server nginx nginx-common
      quassel-core systemd-sysv
    0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.  
    

    如果运行 sudo apt dist-upgrade,跟上面的提示是一样的,18 not upgraded

    之前还曾经无法进入系统,等了一天突然可以选择进入哪个内核了,选择进入原来的内核,现在还可以操作。 是不是除了重装,没什么办法了??还有,vps 如何选择进入修复程序??没有键盘可以按啊。。。我用的 linnode 的 vps 。

    11 条回复    2021-08-03 00:12:39 +08:00
    learningman
        1
    learningman  
       2021-08-02 20:49:52 +08:00
    控制台找找 vnc,或者有没有 rescue image
    PbCopy111
        2
    PbCopy111  
    OP
       2021-08-02 20:51:24 +08:00
    @learningman ???这是什么?我现在可以进系统了啊,只不过我没有安装 xwin,所以没有桌面。
    YsHaNg
        3
    YsHaNg  
       2021-08-02 20:51:55 +08:00
    sudo apt-get install <list of packages kept back>
    PigKnife
        4
    PigKnife  
       2021-08-02 21:58:37 +08:00
    换 Arch ?
    vibbow
        5
    vibbow  
       2021-08-02 22:41:38 +08:00
    apt install -y apt-show-versions

    sudo apt-get install $(apt-show-versions \
    | grep -P 'newer than version in archive' \
    | awk -F: '{print $1"/'$(lsb_release -cs)'"}')
    PbCopy111
        6
    PbCopy111  
    OP
       2021-08-02 23:10:55 +08:00
    我觉得没法升级的原因,就是系统升级到一半不知道为什么就挂了,导致这些软件卡在中间,有的太新了。
    比如没法升级的第一个软件:

    ```
    sudo apt install bind9-dnsutils
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    bind9-dnsutils : Depends: bind9-libs (= 1:9.16.8-1ubuntu3.1) but 1:9.16.1-0ubuntu2.8 is to be installed
    E: Unable to correct problems, you have held broken packages.
    ```
    PbCopy111
        7
    PbCopy111  
    OP
       2021-08-02 23:12:09 +08:00
    @PigKnife 这不重新安装一个意思么。。。。我就是懒得重新安装,需要配置的太多了。。。
    PbCopy111
        8
    PbCopy111  
    OP
       2021-08-02 23:13:33 +08:00
    对了,我还执行过了 apt -f install 然后 apt autoremove 了,故障依旧,没什么可修复的。。
    是不是还是跟内核有关系啊?
    sagaxu
        9
    sagaxu  
       2021-08-02 23:24:29 +08:00
    有没有加过 ppa? 有没有多个 apt mirror 混用?
    wi857nston
        10
    wi857nston  
       2021-08-03 00:00:25 +08:00 via Android
    光说没用 自己搞不定 要么重装 要么花钱找人搞 150 一次 有需要可以找我
    jim9606
        11
    jim9606  
       2021-08-03 00:12:39 +08:00
    apt-mark show hold 检查一下软件包是不是被锁版本了。
    你这里好像是 nginx 和 mariadb 升级不了,如果你没在用可以暂时卸载掉,或者升级完重新安装。
    do-release-upgrade 前建议运行 sudo apt autoremove 删掉无用的依赖,能少点冲突。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3600 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:54 · PVG 12:54 · LAX 21:54 · JFK 00:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.