在ubuntu系统安装应用程序的时候,出现错误:Unable to locate package
造成问题的原因是新装的ubuntu系统,没有update的原因,使用以下命令:
$ sudo apt-get update
命令执行完后,出现以下错误:
root@ubuntu:/home/ubuntu# apt update
Ign:1 http://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu bionic InRelease
Ign:2 http://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu bionic-updates InRelease
Ign:3 http://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu bionic-backports InRelease
Err:4 http://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu bionic Release
404 Not Found [IP: 202.38.95.110 80]
Err:5 http://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu bionic-updates Release
404 Not Found [IP: 202.38.95.110 80]
Err:6 http://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu bionic-backports Release
404 Not Found [IP: 202.38.95.110 80]
Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Ign:8 http://ppa.launchpad.net/fcitx-team/nightly/ubuntu bionic InRelease
Err:9 http://ppa.launchpad.net/fcitx-team/nightly/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
Reading package lists... Done
E: The repository 'http://mirrors.ustc.edu.cn/ubuntu-old-releases/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://mirrors.ustc.edu.cn/ubuntu-old-releases/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://mirrors.ustc.edu.cn/ubuntu-old-releases/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://ppa.launchpad.net/fcitx-team/nightly/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.
查阅资料,需要删除 /etc/apt/sources.list/ 目录下所有文件,删除完成后再次执行 sudo apt-get update,图示如下:
系统更新完成,再次执行 sudo apt install git,图示如下:
到此应用程序安装完成。