Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Could not resolve ‘security.ubun

2023-05-16

在执行apt-get update命令的时候更新报错。

Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Could not resolve 'security.ubuntu.com'
Err:2 http://cn.archive.ubuntu.com/ubuntu bionic InRelease
  Could not resolve 'cn.archive.ubuntu.com'
Err:3 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease
  Could not resolve 'cn.archive.ubuntu.com'
Err:4 http://cn.archive.ubuntu.com/ubuntu bionic-backports InRelease
  Could not resolve 'cn.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Could not resolve 'cn.archive.ubuntu.com'
W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Could not resolve 'cn.archive.ubuntu.com'
W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Could not resolve 'cn.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Could not resolve 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
root@mec-PowerEdge-T40:~# vi /etc/resolv.conf 
root@mec-PowerEdge-T40:~# apt-get update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://cn.archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]        
Get:4 http://cn.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]       
Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [48.9 kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [1,133 kB]     
Get:7 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [57.1 kB]
Get:8 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [1,713 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]  
Get:10 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [364 kB]
Get:11 http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [295 kB]
Get:12 http://cn.archive.ubuntu.com/ubuntu bionic-updates/restricted i386 Packages [17.3 kB]
Get:13 http://cn.archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [178 kB]
Get:14 http://cn.archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [24.0 kB]
Get:15 http://cn.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [1,542 kB]
Get:16 http://cn.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,678 kB]
Get:17 http://cn.archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [353 kB]
Get:18 http://cn.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [286 kB]
Get:19 http://cn.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [214 kB]
Get:20 http://cn.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [463 kB]
Get:21 http://cn.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [31.7 kB]
Get:22 http://cn.archive.ubuntu.com/ubuntu bionic-updates/multiverse i386 Packages [13.0 kB]
Get:23 http://cn.archive.ubuntu.com/ubuntu bionic-updates/multiverse Translation-en [6,952 B]
Get:24 http://cn.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:25 http://cn.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [9,288 B]
Fetched 8,683 kB in 4s (2,234 kB/s)                                   
Reading package lists... Done

解决办法:

修改DNS,编辑resolv.conf文件:原来的nameserver注释掉,加入下面2行即可

# vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

更新成功!!

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Could not resolve ‘security.ubun 的相关文章

  • Perl:LWP::UserAgent 对于重定向 URL 始终返回代码 200

    我有一个简单的 url 它执行 302 临时错误 移至另一页 我尝试在 URL 返回代码 200 表示 OK 时检索它 并在返回 200 以外的其他内容时停止 My code my ua LWP UserAgent gt new env p
  • 如何在 IE9 中检测用户禁用了某个加载项?

    IE9 用户可以通过单击齿轮按钮并选择 管理加载项 来禁用加载项 例如浏览器帮助程序对象 我需要使用 JavaScript 检测给定的附加组件是否已以这种方式被禁用 我似乎无法找到错误处理程序的方法
  • 所有 CopyConstructible 类型都是 MoveConstructible 类型吗?

    根据工作草案 N3337 与已发布的 ISOC 11 标准最相似的草案 和cppreference com http en cppreference com w cpp concept CopyConstructible 答案是肯定的 N3
  • .NET 中有什么方法可以以编程方式侦听 HTTP 流量吗?

    我正在使用浏览器自动化来测试网站 但我需要验证来自浏览器的 HTTP 请求 即图像 外部脚本 XmlHttpRequest 对象 有没有一种方法可以以编程方式实例化代理以供浏览器使用以查看其发送的内容 我已经在使用 Fiddler 来监视流
  • HTTP部分上传、断点续传的标准方法

    我正在开发 http 客户端 服务器框架 并寻找处理部分上传的正确方法 与使用带有 Range 标头的 GET 方法进行下载相同 但是 HTTP PUT 并不打算恢复 据我所知 PATCH 方法不接受 Range 标头 有没有办法通过 HT
  • 一个 Guice 就绪的安全框架?

    有没有人见过一个为与 Guice 一起工作而编写的框架 或者一个将现有安全系统 即 Acegi 与 Guice 集成的库 到目前为止我发现了以下内容 http code google com p warp security http cod
  • 正确使用 EncryptedSharedPreferences

    Android 最近发布了 EncryptedSharedPreferences 它自动加密 SharedPreferences 键 值数据 虽然这很好 但我发现我可以简单地连接 API 调用并检索解密的值 除了在调用 EncryptedS
  • 使用终端时出现意外标记“(”附近的语法错误[关闭]

    Closed 这个问题是无法重现或由拼写错误引起 help closed questions 目前不接受答案 我试图为我的平板电脑获取一个 cpuid 该平板电脑变砖了 我有这段代码 当我通过终端在 ubuntu 上执行它时 它给出以下错误
  • 是否可以从 .apk 文件获取 Android.mk 或本机源文件?

    看来从 apk文件中获取Java源文件是很容易的 但是否有可能得到Android mk or native通过工具或棘手的方法从 apk 文件中获取源文件 我正在研究 Android 应用程序本机代码安全性 因此这些文件对我来说非常重要 谢
  • 了解 ASP.NET 应用程序文件夹

    ASP NET 中的应用程序文件夹用于存储对运行网站至关重要的各种元素 我想更深入地了解这些文件夹 特别是文件夹的可访问性 根据有关的文章ASP NET 网站布局 http msdn microsoft com en us library
  • 使用鼠标检测的反验证码

    我想知道是否可以为仅使用 javascript 的表单创建一个安全的人体检测机制 不使用验证码 来检测鼠标移动 因为 jquery 或操作系统代码都可以移动鼠标 我是这么告诉的 这是我的计划 使用 jQuery 我可以检测鼠标是否已移动 然
  • 来自守护程序的错误响应:加入会话密钥环:创建会话密钥:超出磁盘配额

    我尝试在我的服务器上安装 docker 使用本教程 https docs docker com install linux docker ce ubuntu 我想远程运行 docker 镜像并使用 portainer Web 界面来管理一切
  • Ubuntu Python shebang 线不工作

    无法让 shebang 线在 Ubuntu 中为 python 脚本工作 我每次只收到命令未找到错误 test py usr bin env python print Ran which python usr bin python 在 sh
  • 遭受xss攻击后如何恢复站点?

    最近我正在研究XSS攻击以及它们对网站的破坏性有多大 让我惊讶的是 网络 even SO 充满了关于如何防止xss攻击但没有相关资源说明如何在网站受到 xss 攻击后恢复网站 我遇到过一些事情 比如 将备份网站代码上传回服务器 下载整个网站
  • 如何在 Web 表单中进行 Html.Encode

    我有一个 ASP NET Web 窗体应用程序 有一个带有文本框的页面 用户在其中输入搜索词用于查询数据库 我知道我需要防止 JavaScript 注入攻击 我该怎么做呢 在 MVC 中我会使用Html Encode Web 表单中似乎无法
  • Python PAM 模块的安全问题?

    我有兴趣编写一个 PAM 模块 该模块将利用流行的 Unix 登录身份验证机制 我过去的大部分编程经验都是使用 Python 进行的 并且我正在交互的系统已经有一个 Python API 我用谷歌搜索发现pam python http pa
  • 从 HTTP 登录到 HTTPS

    我的网站默认使用 HTTP 我确实有一个启用 HTTPS 的证书 但只有其上的某些区域强制建立安全连接 登录是通过 Ajax 处理的 我想开始使用 SSL 即使请求来自 HTTP 我尝试强制请求的地址具有 HTTPS 并且它完美地回复 然而
  • 从经典 ASP 调用 .Net C# DLL 方法

    我正在开发一个经典的 asp 项目 该项目需要将字符串发送到 DLL DLL 会将其序列化并发送到 Zebra 热敏打印机 我已经构建了我的 DLL 并使用它注册了regasm其次是 代码库这使得 IIS 能够识别它 虽然我可以设置我的对象
  • 使用 Http Post 发送图像

    我想使用 Http Post 将图像从 android 客户端发送到 Django 服务器 该图像是从图库中选择的 目前 我正在使用列表值名称 Pairs 将必要的数据发送到服务器并接收来自 Django 的 JSON 响应 是否可以对图像
  • 我必须使用什么加密程序来通过 HTTP 协议发送加密的“电子邮件”和“密码”值?

    我正在使用 Ruby on Rails 3 我想通过 HTTP 协议发送 电子邮件 和 密码 值 我知道 我不应该 但我需要 我需要从发送用户凭据我的客户申请到一个我的服务应用 我可以使用公共和私人RSA密钥来实现这一点 但如果是这样 我不

随机推荐