AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1169657
Accepted
singrium
singrium
Asked: 2019-08-31 11:59:01 +0800 CST2019-08-31 11:59:01 +0800 CST 2019-08-31 11:59:01 +0800 CST

搬到另一个国家后无法更新或安装任何东西

  • 772

几天前,我在我的电脑上安装了 Ubuntu,一切正常。
碰巧我去了另一个国家,我还在那里。因此,每当我运行更新或尝试从 Ubuntu 软件安装任何东西时,都没有任何效果,尽管我的互联网工作正常并且我可以使用我的 PC 访问互联网(我现在正在使用它来编写这些行)。
我试图将服务器更改为我现在所在国家/地区的服务器之一,但没有成功。所以我换了Ubuntu主服务器,也没用。
我重新启动了我的电脑,运行sudo apt autoclean并sudo apt clean没有任何改变。
每当我运行更新过程时,我仍然会收到这些错误:

sudo apt update
Ign:1 http://archive.canonical.com/ubuntu bionic InRelease
Err:2 http://archive.canonical.com/ubuntu bionic Release
  404  Not Found [IP: 91.189.92.191 80]
Ign:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:6 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Err:7 http://archive.ubuntu.com/ubuntu bionic Release
  404  Not Found [IP: 91.189.88.174 80]
Err:8 http://archive.ubuntu.com/ubuntu bionic-updates Release
  404  Not Found [IP: 91.189.88.174 80]
Err:9 http://archive.ubuntu.com/ubuntu bionic-backports Release
  404  Not Found [IP: 91.189.88.174 80]
Err:10 http://archive.ubuntu.com/ubuntu bionic-security Release
  404  Not Found [IP: 91.189.88.174 80]
Reading package lists... Done
E: The repository 'http://archive.canonical.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 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-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://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.

任何人都知道如何解决这个问题?

编辑:
问题不在于我没有正确的链接/etc/apt/sources.list。我的问题是,当我运行更新时,出现在终端中的链接与我在终端中的链接不相似/etc/apt/sources.list 此外,当我/etc/apt/sources.list按照Raffa所说的那样进行更新时,我仍然会遇到类似的错误。

sudo apt update 
Ign:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Err:4 http://security.ubuntu.com/ubuntu bionic-security Release
  404  Not Found [IP: 91.189.91.14 80]
Err:5 http://archive.ubuntu.com/ubuntu bionic Release
  404  Not Found [IP: 91.189.88.31 80]
Err:6 http://archive.ubuntu.com/ubuntu bionic-updates Release
  404  Not Found [IP: 91.189.88.31 80]
Reading package lists... Done
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security 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 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-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.

虽然包含Raffa/etc/apt/sources.list提到的链接

cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted
updates software-center apt
  • 4 4 个回答
  • 61305 Views

4 个回答

  • Voted
  1. Best Answer
    Raffa
    2019-08-31T15:22:26+08:002019-08-31T15:22:26+08:00

    由于某种原因,APT 无法Release在指定的存储库列表中找到该文件。

    为了解决这个问题,我建议如下:

    • 检查您与 Internet 的连接是否在防火墙后面、以任何方式受到限制或在代理后面,并相应地配置您的系统和连接,或者如果可用,更改为不同的连接。

    • 通过运行以下命令检查是否存在 APT 代理配置文件:

    ls /etc/apt/apt.conf.d/*proxy*
    

    如果命令返回任何结果,请将这些文件移出/etc/apt/apt.conf.d/目录或删除它们。

    • 通过在终端中运行以下命令,将您的存储库列表恢复为原始 Ubuntu Bionic Beaver 列表:
    sudo nano /etc/apt/sources.list
    

    将打开一个文件编辑器。删除其中的所有行,然后将以下内容复制并粘贴到文件编辑器中:

    deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted
    deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted
    deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted
    

    然后,按Ctrl+保存并关闭文件,X然后按Y再按Enter

    要验证您是否正确保存了文件,请在终端中运行以下命令:

    cat /etc/apt/sources.list
    

    输出应该是:

    deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse restricted
    deb http://security.ubuntu.com/ubuntu/ bionic-security main multiverse universe restricted
    deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse universe restricted
    

    Ubuntu 存储库具有定义的格式。例如,它们应该是类似的东西deb http://archive.ubuntu.com/ubuntu bionic main。

    解释:

    deb:这些存储库包含二进制文件或预编译包。大多数用户都需要这些存储库。

    http://archive.ubuntu.com/ubuntu: URI(统一资源标识符),在这种情况下是 Internet 上的位置。

    bionic:是您的 Ubuntu 安装的版本名称。

    main& restricted...等:是部分名称或组件。可以有多个部分名称,以空格分隔。


    之后,请通过在终端中运行以下命令来更新您的存储库列表:

    sudo apt update
    

    您现在应该能够再次安装软件包并更新您的系统。


    注意:

    如果仍然出现错误,请先/etc/apt/sources.list.d/在终端中运行以下命令备份到您的主目录:

    mkdir ~/old_sources_list_d && sudo cp -r /etc/apt/sources.list.d/* ~/old_sources_list_d/
    

    之后,请/etc/apt/sources.list.d/通过在终端中运行以下命令来清除所有现有的 PPA 和存储库列表:

    sudo rm -r /etc/apt/sources.list.d/*
    

    然后,请通过在终端中再次运行以下命令来更新您的存储库列表:

    sudo apt update
    
    • 22
  2. Leonardo
    2020-03-03T07:21:43+08:002020-03-03T07:21:43+08:00

    我认为这不完全是因为您的连接改变了国家。这是因为新连接有任何代理服务器或系统来阻止或重定向 Ubuntu 服务器......(可能是政府或机构)

    从我大学的“sala de computo”(计算室)连接时,我遇到了类似的问题。

    我想我可以使用一些 VPN 或服务器配置 (DNS) 来跳过这个...

    • 3
  3. K7AAY
    2019-08-31T14:45:10+08:002019-08-31T14:45:10+08:00

    如果您在突尼斯,则可以更改为适当的存储库https://launchpad.net/ubuntu/+mirror/ubuntu.mirror.tn-archive2

    但我注意到它不是最新的,甚至没有仿生的文件,更不用说新的发行版了。阿尔及利亚或利比亚没有存储库,因此您可以在法国、西班牙、瑞士或荷兰尝试替代方案。

    • 1
  4. AKJ
    2020-12-18T11:15:29+08:002020-12-18T11:15:29+08:00

    我只是在/etc/apt/sources.list.

    • 1

相关问题

  • 如何从命令行仅安装安全更新?关于如何管理更新的一些提示

  • iPod Touch (iPhone) 的固件更新?

  • 如何让 Ubuntu 减少检查更新的频率?对于 11.04 及更高版本对于赶时间的人!通过 Ubuntu 软件中心

  • 如何启用自动更新?

  • 如何设置软件中心为非 root 用户安装软件?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve