当前位置: 首页 > 编程笔记 >

Ubuntu 18.04更换apt-get源的方法

龙玄天
2023-03-14
本文向大家介绍Ubuntu 18.04更换apt-get源的方法,包括了Ubuntu 18.04更换apt-get源的方法的使用技巧和注意事项,需要的朋友参考一下

使用apt-get安装时,会很慢,更换了国内的源后,就可以解决这个问题了。

1. 备份sources.list文件

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

2. 打开sources.list文件

sudo gedit /etc/apt/sources.list

3. 删除原内容,添加下列内容

#清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

#阿里云源
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

这两个源都可以用,我都试过,感觉阿里云源速度更快。

4. 更新

保存sources.list文件后需要更新apt-get。

sudo apt-get update

更新完成后就可以正常使用了。

到此这篇关于Ubuntu 18.04更换apt-get源的文章就介绍到这了,更多相关Ubuntu 18.04更换apt-get源内容请搜索小牛知识库以前的文章或继续浏览下面的相关文章希望大家以后多多支持小牛知识库!

 类似资料:
  • 问题内容: 有人可以帮我在Docker容器中轻松工作吗?每当我尝试在Docker容器中运行任何apt-get命令时,该命令都会失败。我正在运行Docker 1.1.1版,在Ubuntu 12.04上构建bd609d2。 当我做 我说错了 无法解析“ archive.ubuntu.com” 我试图取消注释/ etc / default / docker下面的行 DOCKER_OPTS =“-dns

  • 我用的是树莓pi 3b杰西发行。我试图更新我的覆盆子,但它给我这个错误: sudo apt-get更新 Get:1 http://archive.raspbian.org jessie InRelease 100% [1 InRelease gpgv 6,893 B]拆分 /var/lib/apt/lists/部分/archive.r Ign http://archive.raspbian.org

  • 本文向大家介绍Ubuntu下apt-get/apt命令的介绍与使用,包括了Ubuntu下apt-get/apt命令的介绍与使用的使用技巧和注意事项,需要的朋友参考一下 前言 本文主要给大家介绍了关于Ubuntu下apt-get/apt命令的相关内容,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍吧。 命令详解: 用法:apt-get [选项] 命令    apt-get [选项] i

  • 问题内容: 我正在尝试在我的AWS实例上安装apache服务器,但是似乎没有安装apt软件包。 我用谷歌搜索,发现所有与此包相关的链接都被破坏了。如果该信息有帮助,我正在Windows机器上使用Putty。 我目前在Linux环境方面经验不足或没有。 我正在运行以下版本的Linux 有人可以帮忙吗? 问题答案: 如果您使用的是Amazon Linux,则它是基于CentOS的,它是基于RedHat

  • 本文向大家介绍Ruby Gems更换淘宝源方法,包括了Ruby Gems更换淘宝源方法的使用技巧和注意事项,需要的朋友参考一下 最近由于要做课设,所以昨天装了个 Windows,感觉闲的没事干,就想装个 Ruby 玩玩。 官方的 Rubygems 源由于有些资源放在 Amazon S3 上面,所以有时会抽风,在 Linux 下我用 proxychains gem install xxx 实现了指定

  • 本文向大家介绍Ubuntu17.04配置更换国内源的方法,包括了Ubuntu17.04配置更换国内源的方法的使用技巧和注意事项,需要的朋友参考一下 ### 修改源命令: ### 把source.list内容替换成下面其中一个源 第二种方法直接在界面打开: 再进入software&updates: 选择自己所需要的源, 过程完成,说明更新完成。 以上就是本文的全部内容,希望对大家的学习有所帮助,也希