首页 > 系统相关 >ubuntu更新源

ubuntu更新源

时间:2022-10-30 08:35:40浏览次数:52  
标签:restricted multiversedeb ubuntu 更新 bionic universe main

文章目录
前言
一、Ubuntu 更新软件源的方法
二、具体步骤
前言
Ubuntu系统自带的更新源服务器在国外,下载速度一般很慢,所以更换为国内源就成为必要操作了。

一、Ubuntu 更新软件源的方法
Ubuntu 更新软件源的方法:
1、打开终端;
2、输入命令备份原有软件源文件;
3、打开sources.list文件并添加新的软件源地址;
4、输入命令更新系统软件源地址。

二、具体步骤
具体步骤如下:
1、使用快捷键【ctrl+alt+t】打开终端。
2、输入以下命令备份原有软件源文件。
cp /etc/apt/sources.list /etc/apt/sources.list.bak_yyyymmdd
3、再输入以下命令打开sources.list文件并添加新的软件源地址。
vim /etc/apt/sources.list #打开sources.list文件

PS: 新安装的Ubuntu可能没有安装Vim, 用如下命令先安装Vim:
sudo apt-get install vim-gtk

在文件末尾添加新的软件源地址,常用国内源地址如下:

#阿里源地址

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

#华为源地址

deb https://repo.huaweicloud.com/ubuntu/ focal main restricted
deb https://repo.huaweicloud.com/ubuntu/ focal-updates main restricted
deb https://repo.huaweicloud.com/ubuntu/ focal universe
deb https://repo.huaweicloud.com/ubuntu/ focal-updates universe
deb https://repo.huaweicloud.com/ubuntu/ focal-backports main restricted universe
deb https://repo.huaweicloud.com/ubuntu/ focal-security main restricted
deb https://repo.huaweicloud.com/ubuntu/ focal-security universe

#中科大源地址

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

#163源地址

deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

#清华源地址

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe ultiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe ultiverse

4、输入命令更新系统软件源地址:
apt-get update
apt-get upgrade
————————————————
版权声明:本文为CSDN博主「anjoel」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/anjoel/article/details/124805571

标签:restricted,multiversedeb,ubuntu,更新,bionic,universe,main
From: https://www.cnblogs.com/SunShine110/p/16840455.html

相关文章

  • 设置ubuntu信任自签证书(mitmproxy,charls,...)
    方法1:#转换格式sudoopensslx509-outformder-in~/Downloads/mitmproxy-ca-cert.pem-outmitmproxy-ca.crtsudocpmitmproxy-ca-cert/usr/share/ca-certifica......
  • Markdown排版格式语法(持续更新)
    首行缩进&ensp;半角的空格&emsp;全角的空格需要首行缩进两个字符的话,连续使用以上任意一个两次即可。文本加粗<b>你好</b>文本加粗&&居中&&用黑体<center><font......
  • 夸克网盘更新,
    增加了书签和全网搜索功能,本来我以为是全网搜资源呢,试了一下,结果就是又集成了一个浏览器功能,和迅雷的感觉优点像了,很失望,还不如什么都不加,就保持原来简洁的样子呢......
  • 在Ubuntu22.04中配置riscv64-toolchain以及QEMU
    本文提供另类的搭建riscv64-toolchain的方法目前已有的方法有使用riscv-gnu-toolchain进行源码编译使用sifive预编译工具使用他人已搭建好的Docker镜像作为环境我......
  • CentOS7更新OpenSSH
    前言整个过程不要断开ssh链接,如有必要可使用telnet远程操作。系统版本:centos7.9OpenSSL版本:1.0.2k->1.1.1qOpenSSH版本:7.4p1->9.1p1步骤下载OpenSSL和openssh......
  • 总表与分表相互更新
    问题:总表数据手动更新后,分表一键更新,同时分表手动更新后,总表一键更新。解决思路:分别写两段代码,总表拆分用于前者,分表汇总用于后者。数据源8列若干行,按第一列进行拆分。......
  • ubuntu更换pip镜像源
    sudomkdir~/.pip&&cd~/.pip&&sudotouchpip.confsudovimpip.conf然后写入如下配置:[global]index-url=https://pypi.tuna.tsinghua.edu.cn/simple[inst......
  • ubuntu docker 安装指定版本 MongoDB 并配置用户密码
    ubuntudocker安装指定版本MongoDB并配置用户密码​​初​​​​查看安装的镜像​​​​运行容器​​​​检查运行​​​​进入数据库​​​​创建用户和密码​​​​创......
  • Ubuntu中Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend)问
    Ubuntu中Unabletoacquirethedpkgfrontendlock(/var/lib/dpkg/lock-frontend)问题的解决按顺序执行直到sudodpkg--configure-a结束就可以了......
  • 在windows下通过脚本动态域名DDNS更新
    这里采用PowerShell编写脚本请求3322的动态域名接口$pair="root:更新密码"$encodedCreds=[System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetByt......