`
clark1231
  • 浏览: 252689 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

ubuntu server替换更新源

阅读更多

1 首先对源列表做好备份:

sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

2 根据系统不同选择合适的编辑编辑器打开原列表:

sudo vii /etc/apt/sources.list

3.用找到的更新源替换原先的。

4.收尾工作:

sudo apt-get update

如果发现无法正常更新,请使用备份还原:

sudo cp /etc/apt/sources.list_backup /etc/apt/sources.list

 

备注:

我在替换更新源的时候遇到以下情况

Err http://cn.archive.ubuntu.com precise InRelease
  
Err http://security.ubuntu.com precise-security InRelease
  
Err http://cn.archive.ubuntu.com precise-updates InRelease
  
Err http://cn.archive.ubuntu.com precise Release.gpg
  Temporary failure resolving 'cn.archive.ubuntu.com'
Err http://security.ubuntu.com precise-security Release.gpg
  Temporary failure resolving 'security.ubuntu.com'
Err http://cn.archive.ubuntu.com precise-updates Release.gpg
  Temporary failure resolving 'cn.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise/InRelease  

W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease  

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease  

W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg  Temporary failure resolving 'cn.archive.ubuntu.com'

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg  Temporary failure resolving 'security.ubuntu.com'

W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg  Temporary failure resolving 'cn.archive.ubuntu.com'

W: Some index files failed to download. They have been ignored, or old ones used instead.

 解决方法:

1.查看增加的源是否正确

2.查看网络是否正常(我这由于dns没有指定,导致了以上的错误)

分享到:
评论
1 楼 px_dn 2014-03-05  
谢谢!!

相关推荐

    ubuntu server常用配置方法

    - 替换完成后,再次运行 `apt-get update` 来更新源列表。 3. **安装软件** - 安装软件时,可以使用以下命令: ```bash sudo apt-get install [package] ``` - 若要重新安装软件包,可以使用: ```bash ...

    加速ubuntu server apt软件管理器

    可以将默认的Ubuntu服务器地址替换为本地的镜像源地址。 3. 使用`apt-fast`或`unattended-upgrades`:`apt-fast`是一个脚本,它通过多线程下载来加快软件包的下载速度。`unattended-upgrades`则可以自动后台更新...

    ubuntuserver学习资料.pdf

    Ubuntu Server学习资料 本资源摘要信息介绍了 Ubuntu Server 的学习资料,涵盖了 Ubuntu Server 的安装、配置、使用等多方面的知识点。 知识点1: Ubuntu Server 的安装 在安装 Ubuntu Server 时,选择中文将导致...

    快速搭建项目发布环境 Ubuntu Server 10.04 + resin 3.1.10+ nginx 0.7.65

    在Ubuntu Server 10.04上安装Resin,首先确保系统更新至最新版本,运行以下命令: ```bash sudo apt-get update sudo apt-get upgrade ``` 接着,下载并安装Resin 3.1.10,你可以从Caucho官方网站获取安装包。解压...

    部署Ubuntu服务器的Delphi开发环境1

    7. **更换更新源**: 更换为高速的阿里云更新源,以加快更新速度和效率。将这些源添加到`/etc/apt/sources.list`文件中,替换原有的内容。 8. **验证网络连接**: 使用`sudo ip -r addr`检查网络配置,然后通过`ping ...

    Ubuntu服务器安装SQL_Ubuntu服务器安装SQL_

    然后,更新你的APT源列表,使新添加的MySQL源生效: ```bash sudo apt update ``` 现在,你可以安装MySQL Server了。执行以下命令: ```bash sudo apt install mysql-server ``` 在安装过程中,系统会提示你设置...

    ubuntu_raspberry_pi_4:使用Ubuntu Server 20.04.2 LTS设置树莓派4的说明

    使用Ubuntu Server 20.04.2 LTS设置树莓派4的说明 将Ubuntu刻录到micro SD 下载Ubuntu Server 20.04.2 LTS 我正在使用Balena将ubuntu安装到microSDCard中 从microSd启动 用户ubuntu密码ubuntu 您将要求更新密码 ...

    Ubuntu创建apt私有镜像服务器的软件

    在局域网内的其他Ubuntu主机上,需要修改`/etc/apt/sources.list`文件,将官方源替换为私有镜像服务器的URL。例如: ```bash deb http://your-server-ip/ubuntu focal main restricted universe multiverse deb ...

    ubuntu18.04.2下sshd服务安装包

    在Ubuntu 18.04.2操作系统中,SSH(Secure Shell)服务是远程管理和通信的重要工具,它允许用户安全地通过网络连接到服务器进行各种操作,如文件传输、命令执行等。本教程将详细讲解如何在该版本的Ubuntu上安装、...

    ubuntu nfs-kernel-server for hisi

    替换 `<Hisi_server_IP>` 为你的Hisi服务器的实际IP地址。至此,你已经成功设置了NFS服务器,实现了文件共享。 为了提高安全性,可能还需要考虑防火墙设置,确保仅允许特定的客户端IP访问NFS服务。此外,定期更新和...

    飞腾FT-2000-4开发板上移植Ubuntu18.04.5且更换飞腾内核4.19.8教程

    4. **内核更新**:安装完Ubuntu后,下一步是替换为飞腾定制的内核4.19.8。这通常涉及下载内核源码,编译并安装。编译过程中可能需要配置内核选项以适应飞腾的硬件特性,如CPU特性和驱动支持。 5. **更新Grub**:...

    ubuntu部落

    1. 安装Ubuntu:介绍如何从Windows或其他操作系统中安装Ubuntu,包括双系统安装和全盘替换。 2. Ubuntu基本操作:如何启动、登录、使用桌面环境、管理文件和设置等。 3. 命令行基础:学习Linux命令行,如ls、cd、...

    Ubuntu安装thingsboard详细步骤

    在本指南中,我们将介绍如何在 Ubuntu Server 20.10 上安装 ThingsBoard,包括安装 Java 8、安装服务、配置数据库、选择消息队列服务、低性能配置、运行安装脚本和启动服务等步骤。 步骤 1. 安装 Java 8(OpenJDK) ...

    ubuntu 安装mysql odbc驱动.zip

    1. 更新系统软件源: ```bash sudo apt update ``` 2. 安装`unixodbc`: ```bash sudo apt install unixodbc ``` 3. 安装MySQL ODBC驱动。MySQL的ODBC驱动有两个版本:Connector/ODBC 5.x和Connector/ODBC 8.x。...

    在 Ubuntu 12.04 Server 上安装部署 Ruby on Rails 应用

    本教程只适合 Ubuntu Server 用于部署项目到线上,建议使用同样的 Ubuntu 版本,以免遇到一些版本不同带来的问题。 本教程适合新手初次部署 Rails 应用; 本文测试通过环境 Ubuntu 12.04 Server, 服务器安装测试于 ...

    ubuntu使用教程.rar

    1. **安装Ubuntu**:包括下载Ubuntu ISO镜像、创建安装媒体(如USB或DVD)、选择合适的安装类型(如双系统安装或完全替换现有操作系统)、以及设置分区等步骤。 2. **Ubuntu桌面环境**:Ubuntu默认使用Unity桌面...

Global site tag (gtag.js) - Google Analytics