欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ubuntu 安装应用程序报错(Unable to locate package)

程序员文章站 2022-05-09 15:53:09
...

在ubuntu系统安装应用程序的时候,出现错误:Unable to locate package

Ubuntu 安装应用程序报错(Unable to locate package)

造成问题的原因是新装的ubuntu系统,没有update的原因,使用以下命令:

    $ sudo apt-get update

命令执行完后,出现以下错误:

aaa@qq.com:/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,图示如下:

 Ubuntu 安装应用程序报错(Unable to locate package)

系统更新完成,再次执行 sudo apt install git,图示如下:

Ubuntu 安装应用程序报错(Unable to locate package)

到此应用程序安装完成。