从 ubuntu 16.04 LTS 升级到 ubuntu 18.04 LTS

从 ubuntu 16.04 LTS 升级到 ubuntu 18.04 LTS

我想升级我的系统,但是面临这些问题:

  1. 每当我按下软件更新程序时都没有任何反应,有时我会收到错误报告。
  2. sudo apt update给了我这个:

    Reading state information... Done
    1363 packages can be upgraded. Run 'apt list --upgradable' to see them.
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:1 and /etc/apt/sources.list:2
    
  3. sudo apt upgrade给了我这个:

    1116 upgraded, 195 newly installed, 0 to remove and 247 not upgraded.
    Need to get 85.1 kB/552 MB of archives.
    After this operation, 668 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Err:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 libproxy1-plugin-networkmanager amd64 0.4.15-1
      400  Bad URI [IP: 91.189.88.162 80]
    Err:2 http://archive.ubuntu.com/ubuntu bionic/main amd64 libproxy1-plugin-gsettings amd64 0.4.15-1
      400  Bad URI [IP: 91.189.88.162 80]
    Err:3 http://archive.ubuntu.com/ubuntu bionic/main amd64 libproxy1v5 amd64 0.4.15-1
      400  Bad URI [IP: 91.189.88.162 80]
    Err:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmbim-proxy amd64 1.14.2-2.1ubuntu1
      400  Bad URI [IP: 91.189.88.162 80]
    Err:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 libqmi-proxy amd64 1.18.0-3ubuntu1
      400  Bad URI [IP: 91.189.88.162 80]
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-networkmanager_0.4.15-1_amd64.deb  400  Bad URI [IP: 91.189.88.162 80]
    
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1-plugin-gsettings_0.4.15-1_amd64.deb  400  Bad URI [IP: 91.189.88.162 80]
    
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libproxy/libproxy1v5_0.4.15-1_amd64.deb  400  Bad URI [IP: 91.189.88.162 80]
    
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libm/libmbim/libmbim-proxy_1.14.2-2.1ubuntu1_amd64.deb  400  Bad URI [IP: 91.189.88.162 80]
    
    E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libq/libqmi/libqmi-proxy_1.18.0-3ubuntu1_amd64.deb  400  Bad URI [IP: 91.189.88.162 80]
    
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
    

然后cat /etc/apt/sources.list给我这个:

deb http://archive.canonical.com/ubuntu xenial partner

作为对这个问题的编辑: cat /etc/apt/sources.list给我这个:

# deb http://ftp.oleane.net/ubuntu/ bionic-updates main restricted universe multiverse # disabled on upgrade to bionic
# deb http://ftp.oleane.net/ubuntu/ bionic-backports main restricted universe multiverse # disabled on upgrade to bionic
# deb http://ftp.oleane.net/ubuntu/ bionic-security main restricted universe multiverse # disabled on upgrade to bionic
deb http://archive.canonical.com/ubuntu bionic partner
deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse # auto generated by ubuntu-release-upgrader
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse # auto generated by ubuntu-release-upgrader
deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse # auto generated by ubuntu-release-upgrader
deb http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse # auto generated by ubuntu-release-upgrader

任何帮助都将受到赞赏。

答案1

看起来你的 sources.list 可能相当混乱。我怀疑你至少有一个 ppa 配置错误,这导致 apt 无法从正确的位置下载源。

我建议你从以下网址下载默认的 ources.list 文件这里。接下来,找到您的 sources.list 文件;通常它位于/etc/apt/sources.list。我建议您将当前文件重命名为 sources.list.bak 之类的名称,然后尝试使用默认 sources.list 运行 apt,如下所示。

mv sources.list sources.list.bak
cp path/to/downloaded/sources.list sources.list
sudo apt update
sudo apt upgrade

默认的 sources.list 无法访问您从自定义 ppa 安装的任何软件,但它应该允许您更新工具链中必要的内容,然后允许您升级。由于您正在升级,因此无论如何都需要再次添加这些 ppa。祝你好运!

答案2

此问题几乎与您尝试下载的服务器的连接性有关。请检查与服务器的连接性或更改存储库链接,然后在此处分享结果。

相关内容