Ubuntu如何恢复默认镜像源

这篇具有很好参考价值的文章主要介绍了Ubuntu如何恢复默认镜像源。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

一、前言

如果你按照了其他博客换源的操作,应该都有一个备份的默认源:

其他博客中备份的指令:

cp /etc/apt/sources.list /etc/apt/sources.list.backup 


二、步骤

1、查看备份文件

我们需要走到源的文件夹下,查看备份是否存在:

cd /etc/apt

ls

ubuntu恢复默认源,ubuntu,linux,服务器

 这里显示:sources.list.backup,说明我当时保存了。


2、恢复方法

方法1:

(1)复制文件

方法描述:如果有备份,直接拷贝恢复source.list。

还记得第一步吗,直接反向操作就行:

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

(2)查看文件

再查看一下:

gedit sources.list

ubuntu恢复默认源,ubuntu,linux,服务器

没问题就是备份完了。


方法2:

直接打开备份文件

gedit sources.list.backup

②手动复制

然后,我们接下来就是要把里面的内容复制到sources.list里面

先Ctrl+C拷贝上面的内容,然后以sudo形式打开source.list

sudo gedit sources.list

打开文件复制进去保存即可,如果不加sudo就是只读模式,记得要加。


方法3:

参考:

anaconda换源和恢复默认源

Ubuntu系统镜像备份及恢复


三、Ubuntu 22.04 LTS

这里提供一份ubuntu22.04的:
 

#deb cdrom:[Ubuntu 22.04.1 LTS _Jammy Jellyfish_ - Release amd64 (20220809.1)]/ jammy main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ jammy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ jammy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ jammy universe
deb http://cn.archive.ubuntu.com/ubuntu/ jammy-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ jammy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ jammy multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ jammy-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://security.ubuntu.com/ubuntu jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu jammy-security universe
deb http://security.ubuntu.com/ubuntu jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu jammy-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

四、Ubutnu20.04.5 LTS

再提供一个20.04.5的文章来源地址https://www.toymoban.com/news/detail-727273.html

# deb cdrom:[Ubuntu 20.04.5 LTS _Focal Fossa_ - Release amd64 (20220831)]/ focal main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates restricted main
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal universe
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner

deb http://security.ubuntu.com/ubuntu focal-security restricted main
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

到了这里,关于Ubuntu如何恢复默认镜像源的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Selenium技术在CentOS6.8系统的腾讯云服务器上的docker镜像的Ubuntu容器里的相关使用(Linux环境下)

    一开始看标题,我知道你们会很懵,我当初完成的时候,我自己也很懵,主要是想在Linux环境下使用Selenium技术来完成一些工作,本来打算用docker创建一个Anaconda的容器来用Selenium技术的,但发现无法通过chrome驱动来驱动谷歌浏览器,所以我又用docker创建了一个Ubuntu容器来使用

    2024年02月03日
    浏览(79)
  • Ubuntu服务器安全性提升:修改SSH默认端口号

    在Ubuntu服务器上,SSH(Secure Shell)是一种至关重要的远程连接工具。它提供了一种安全的方式来远程连接和管理计算机系统,通过加密通信来确保数据的保密性和完整性。SSH协议广泛用于计算机网络中,用于远程管理、文件传输和安全通信等任务。然而,SSH默认使用的端口号

    2024年02月08日
    浏览(44)
  • Ubuntu 服务器通过 resolvconf 管理配置系统默认DNS解析服务器配置文件

    1、首先安装 resolvconf 如果未安装 2、检查已启动并启用的解析服务 3、如果未启用服务,则可以通过以下方式启动和启用它:  4、现在编辑 resolv.conf.d/head 配置文件 5、将您的 DNS 地址添加到此文件中,例如我使用(223.5.5.5 和 223.6.6.6)  6、现在强制 resolvevconf 在使用 -u 调用时

    2024年02月11日
    浏览(39)
  • 【Linux】 ubuntu 安装搭建Samba cifs服务器,windows下无法访问如何解决!

    一、windows下无法访问samba 1、smbd没有正常启动;  service smbd  start       启动smbd   service smbd status      查看状态   2、主机和虚拟机需要可以互ping成功 3、共享文件的访问权限设置 4、windows和linux防火墙关闭, 之后重启smbd 5、在运行里面输入格式: “\\\\ +ip”   (因为我就是

    2024年02月05日
    浏览(50)
  • 群晖Nas构建Github镜像服务器(ubuntu系统可参考)

    由于众所周知的原因,github的访问不是很顺畅,如果需要拉一些内容下来,用nas做一个镜像server,不断定时去更新,需要的时候再从nas的git server去clone就会是一个比较经济的办法了。 安装GitServer 在群晖NAS的套件中心安装GitServer 创建Git用户(组),eg, git_local 开启SSH登录权限 控

    2024年02月16日
    浏览(38)
  • linux/ubuntu系统管理(8)ubuntu启动模式介绍以及如何进入单用户模式和恢复模式

    Ubuntu操作系统提供了多种启动模式,每种模式都有不同的用途和功能。下面将深入介绍Ubuntu的几种启动模式: 正常启动模式(Normal boot) :这是默认的启动模式,也是大多数用户使用的模式。在正常启动模式下,系统会按照正常的流程启动,加载所有必要的服务和驱动程序,

    2024年01月25日
    浏览(41)
  • Ubuntu 系统如何配置 DHCP 服务器?

    Ubuntu 系统上安装和配置 DHCP 服务器的步骤如下: 1. 安装 DHCP 服务器软件包: 在终端中输入以下命令安装 dhcp-server 软件包: ``` sudo apt-get update sudo apt-get install isc-dhcp-server ``` 2. 配置 DHCP 服务器: 在终端中输入以下命令打开 /etc/dhcp/dhcpd.conf 文件: ``` sudo nano /etc/dhcp/dhcpd.conf

    2024年02月08日
    浏览(54)
  • linux系统(centos、Ubuntu、银河服务器)备份

    Get Kali | Kali Linux   balenaEtcher - Flash OS images to SD cards USB drives  点击下载,等待下载完成 双击安装,等待安装完成 双击 启动  选择镜像 选择U盘    开始烧录 等地制作完成  重启电脑,按f11 ,选择正确的u盘启动 输入命令: lsblk 可以看到下图的服务器存在3个硬盘sda、sdb、s

    2024年02月10日
    浏览(50)
  • 重装系统之linux的ubuntu系统(服务器版)

    1 . 准备工具 1.1 一个8G以上的U盘 、软碟通UltralSO软件 软碟通 下载完后,双击安装,接受协议,勾选需要的附加任务,如下图 1.2 ubuntu的镜像文件ubuntu服务器版 在ubuntu官网下载ubuntu,点击Ubuntu Server 20.04LTS即可下载镜像文件 这里安装的是服务器版,下载完成后是一个ISO镜像文件

    2024年02月07日
    浏览(45)
  • Linux环境(Ubuntu)上搭建MQTT服务器(EMQX )

    目录 概述 1 认识EMQX 1.1 EMQX 简介 1.2 EMQX 版本类型 2 Ubuntu搭建EMQX 平台 2.1 下载和安装 2.1.1 下载 2.1.2 安装 2.2 查看运行端口 3 运行Dashboard 管理控制台 3.1 查看Ubuntu上的防火墙 3.2 运行Dashboard 管理控制台 本文主要介绍EMQX 的一些内容,终端介绍如何在Ubuntu上安装EMQX,并可以在第三

    2024年04月08日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包