首页 > 系统相关 >Ubuntu 22.04.1 LTS 切换国内源

Ubuntu 22.04.1 LTS 切换国内源

时间:2023-04-25 14:23:27浏览次数:46  
标签:LTS universe restricted jammy 22.04 Ubuntu main multiverse ubuntu

1、备份原文件

cp /etc/apt/sources.list /etc/apt/sources.list.bak

 

2、清空  sources.list 文件中的内容,然后将以下任何一个源复制到文件中,以阿里源为例:

vim /etc/apt/sources.list

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

#保存退出
:wq

 

3、更新源

apt-get update
apt-get upgrade

 

4.1 阿里源

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

 

4.2 清华源

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

 

4.3 中科大源

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

 

4.4 网易163源

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

 

5、可能出现的错误

Ubuntu 404 Not Found [IP: 91.189.95.85 80]

这个错误有可能是你的网络运营商拦截了,这个很坑。

我当初遇到这个问题后,尝试了网上的各种办法都没解决,我的宽带是联通的,最后切换到移动网络,顺利解决!

 

package has no installation candidate

这个错误就是你的源出问题了,尝试:apt-get update,如果不行就按上面的步骤切换一下源。

 

标签:LTS,universe,restricted,jammy,22.04,Ubuntu,main,multiverse,ubuntu
From: https://www.cnblogs.com/hunttown/p/17352465.html

相关文章

  • 办公套件Microsoft Office LTSC 2021最新中文Mac版
    MicrosoftOfficeLTSC2021(office全家桶)中文版是Microsoft为Mac用户推出的一款新iPadMac系列电脑、iPad桌面应用程序。OfficeLTSC2021是MicrosoftOffice系列电脑、iPad电脑和桌面应用程序的新一代操作系统和办公自动化产品。它采用了Mac和Linux操作系统的同步版......
  • Ubuntu 22.04.1 LTS 编译安装 nginx-1.23.4
    一、安装环境依赖sudoapt-getinstallg++sudoapt-getinstallopenssllibssl-devsudoapt-getinstalllibpcre3libpcre3-devsudoapt-getinstallzlib1g-devsudoapt-getinstalllibgd-dev 二、下载安装包wgethttp://nginx.org/download/nginx-1.23.4.tar.gz......
  • ubuntu中安装vmtools时出现问题
    参考:虚拟机安装Ubuntu后安装open-vm-tools出错,无法更新源的问题解决-知乎(zhihu.com)补充:其中ubuntu22.1中的SoftwareUpdates在Settings——About中,其他参考上述链接中的文章即可 ......
  • [Ubuntu]:查看Ubuntu版本
    方法一系统全名uname-a方法二cat/proc/version方法三lsb_release-a参考链接参考链接......
  • ubuntu 22.04 国内镜像阿里云/163源/清华大学/中科大
    ubuntu22.04国内镜像阿里云/163源/清华大学/中科大--转--已验证GPG错误由于没有公钥,无法验证下列签名sudoapt-keyadv--keyserverkeyserver.ubuntu.com--recv-keys871920D1991BC93Csudoapt-keyadv--keyserverkeyserver.ubuntu.com--recv-keys3B4FE6ACC0B21F323B......
  • windows+centos+ubuntu多系统环境,ubuntu启动修复
    故障现象:       在windows中调整分区后,ubuntu系统无法启动,centos启动进入保护模式解决过程一、双硬盘,centos硬盘EFI分区还在,ubuntu硬盘EFI分区消失,发现一个300的分区但是不是efi分区,查看分区无数据重建EFI分区fdisk/dev/nvme0n1p1  d删除原有分区n新建分区 ......
  • Ubuntu postgresql
    Ubuntu#Createthefilerepositoryconfiguration:sudosh-c'echo"debhttp://apt.postgresql.org/pub/repos/apt$(lsb_release-cs)-pgdgmain">/etc/apt/sources.list.d/pgdg.list'#Importtherepositorysigningkey:wget--quiet-......
  • ubuntu22.4.1 部署Postgres12 、PostGIS、TimescaleDB
    参考文章https://www.postgresql.org/download/linux/ubuntu/一、postgres数据库安装#Createthefilerepositoryconfiguration:1.sudosh-c'echo"debhttp://apt.postgresql.org/pub/repos/apt$(lsb_release-cs)-pgdgmain">/etc/apt/sources.list.d/pgdg.l......
  • Ubuntu:PostgreSql安装PostGis、TimeScaleDB插件
    Ubuntu:PostgreSql安装PostGis、TimeScaleDB插件https://docs.timescale.com/self-hosted/latest/install/installation-linux/ Installingself-hostedTimescaleDBonDebian-basedsystemsAtthecommandprompt,asroot,addthePostgreSQLthirdpartyrepository......
  • Ubuntu Vmware虚拟机 没有共享文件夹/mnt/hgfs 解决
    问题现象在Vmware虚拟机设置共享文件夹后,在Ubuntu系统侧应该在/mnt/hgfs目录下可见。然而,有时在重启虚拟机后不存在该文件夹。解决方法在终端中执行以下代码,需要root权限。sudoapt-getinstallopen-vm-toolssudomkdir/mnt/hgfssudo/usr/bin/vmhgfs-fuse.host://mnt/h......