Ign:1 http://old-releases.ubuntu.com/ubuntu bionic InRelease Ign:2 http://old-releases.ubuntu.com/ubuntu bionic-updates InRelease Ign:3 http://old-releases.ubuntu.com/ubuntu bionic-backports InRelease Ign:4 http://old-releases.ubuntu.com/ubuntu bionic-security InRelease Err:5 http://old-releases.ubuntu.com/ubuntu bionic Release SECURITY: URL redirect target contains control characters, rejecting. [IP: 91.189.91.124 80] Err:6 http://old-releases.ubuntu.com/ubuntu bionic-updates Release SECURITY: URL redirect target contains control characters, rejecting. [IP: 91.189.91.124 80] Err:7 http://old-releases.ubuntu.com/ubuntu bionic-backports Release SECURITY: URL redirect target contains control characters, rejecting. [IP: 91.189.91.124 80] Err:8 http://old-releases.ubuntu.com/ubuntu bionic-security Release SECURITY: URL redirect target contains control characters, rejecting. [IP: 91.189.91.124 80] Reading package lists... Done E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic-updates Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic-backports Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic-security Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://old-releases.ubuntu.com/ubuntu bionic-old-releases Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default N: See apt-secure(8) manpage for repository creation and user configuration details.
Ign:1 http://archive.ubuntu.com/ubuntu bionic InRelease Ign:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Ign:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Ign:4 http://archive.ubuntu.com/ubuntu bionic-security InRelease Err:5 http://archive.ubuntu.com/ubuntu bionic Release SECURITY: URL redirect target contains control characters, rejecting. [IP: 91.189.91.81 80] Err:6 http://archive.ubuntu.com/ubuntu bionic-updates Release SECURITY: URL redirect target contains control characters, rejecting. [IP: 91.189.91.81 80] Err:7 http://archive.ubuntu.com/ubuntu bionic-backports Release SECURITY: URL redirect target contains control characters, rejecting. [IP: 91.189.91.81 80] Err:8 http://archive.ubuntu.com/ubuntu bionic-security Release SECURITY: URL redirect target contains control characters, rejecting. [IP: 91.189.91.81 80] Reading package lists... Done E: The repository 'http://archive.ubuntu.com/ubuntu bionic Release' no longer has a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates Release' no longer has a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://archive.ubuntu.com/ubuntu bionic-security Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
这两个报错的具体解决方案和原因见下面的解决方案3。
解决方案
1、配置 WSL 网络代理
WSL1 和 WSL2 在网络代理的配置上稍微有一些区别。原因在于 WSL1 是与 windows 共享网络的,而 WSL2 是使用 Hyper-V 启动了全局虚拟化,与 windows 的网络交换需要使用ip来定位。
因此,WSL2 如果想配置将网络请求转发到系统代理上,需要动态获取 windows 的 ip 进行转发。
我在 windows 上运行了代理软件 clash , 代理软件的转发端口是 7890 。这可以在 windows 的 设置 -> 网络和internet -> 代理 中找到,如下图:
Ubuntu 18.04 LTS (bionic from 2018-April thus 18.04) is not an old-release, ie. it's currently supported and not EOL (old-releases is for EOL releases).
Ubuntu 18.04 LTS has 5 years of standard support so is supported until 2023-April, then moves to ESM or extended support before finally having it's repositories moved from archive.ubuntu.com to where you're file is looking - old-releases.ubuntu.com
You need to change old-releases.ubuntu.com to archive.ubuntu.com for that entry in your /etc/apt/sources.list file
Err:5 https://old-releases.ubuntu.com/ubuntu bionic Release 404 Not Found [IP: 185.125.190.37 443] Err:6 https://old-releases.ubuntu.com/ubuntu bionic-updates Release 404 Not Found [IP: 185.125.190.37 443] Err:7 https://old-releases.ubuntu.com/ubuntu bionic-backports Release 404 Not Found [IP: 185.125.190.37 443] Err:8 https://old-releases.ubuntu.com/ubuntu bionic-security Release 404 Not Found [IP: 185.125.190.37 443]
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb https://mirrors.aliyun.com/ubuntu bionic main restricted # deb-src http://mirrors.aliyun.com/ubuntu bionic main restricted
## Major bug fix updates produced after the final release of the ## distribution. deb https://mirrors.aliyun.com/ubuntu bionic-updates main restricted # deb-src http://mirrors.aliyun.com/ubuntu bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb https://mirrors.aliyun.com/ubuntu bionic universe # deb-src http://mirrors.aliyun.com/ubuntu bionic universe deb https://mirrors.aliyun.com/ubuntu bionic-updates universe # deb-src http://mirrors.aliyun.com/ubuntu bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb https://mirrors.aliyun.com/ubuntu bionic multiverse # deb-src http://mirrors.aliyun.com/ubuntu bionic multiverse deb https://mirrors.aliyun.com/ubuntu bionic-updates multiverse # deb-src http://mirrors.aliyun.com/ubuntu bionic-updates multiverse
## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb https://mirrors.aliyun.com/ubuntu bionic-backports main restricted universe multiverse # deb-src http://mirrors.aliyun.com/ubuntu bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu bionic partner # deb-src http://archive.canonical.com/ubuntu bionic partner
deb https://mirrors.aliyun.com/ubuntu bionic-security main restricted # deb-src http://mirrors.aliyun.com/ubuntu bionic-security main restricted deb https://mirrors.aliyun.com/ubuntu bionic-security universe # deb-src http://mirrors.aliyun.com/ubuntu bionic-security universe deb https://mirrors.aliyun.com/ubuntu bionic-security multiverse deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable # deb-src http://mirrors.aliyun.com/ubuntu bionic-security multiverse