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源内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

香港服务器首选树叶云,2H2G首月10元开通。
树叶云(shuyeidc.com)提供简单好用,价格厚道的香港/美国云服务器和独立服务器。IDC+ISP+ICP资质。ARIN和APNIC会员。成熟技术团队15年行业经验。

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/183520.html<

(0)
运维的头像运维
上一篇2025-03-28 11:14
下一篇 2025-03-28 11:16

相关推荐

  • hosteonsVPS测评不限流量实测数据与性能表现,hosteonsVPS真的不限流量吗

    Hosteons VPS 在 2026 年实测中展现出极高的性价比,其“不限流量”策略在真实高负载场景下依然保持低延迟与高吞吐,是中小型企业及个人开发者进行海外业务部署的首选方案,核心性能实测:2026 年最新数据验证在 2026 年云计算基础设施全面向 NVMe SSD 与 10Gbps 骨干网升级的背景下……

    2026-05-02
    0
  • {name.com}是什么,{name.com}怎么用

    在 2026 年,<name.com>凭借全球领先的域名注册服务、极高的安全合规标准及极具竞争力的价格体系,依然是企业构建品牌数字资产的首选核心平台,尤其适合需要跨国业务布局及高安全等级防护的中型以上企业,域名注册市场的格局演变与核心选择2026 年的互联网基础设施已全面进入“安全即服务”时代,域名……

    2026-05-02
    0
  • Cloudcone 是什么?Cloudcone 服务器怎么样

    CloudCone 在 2026 年依然是高性价比 VPS 的首选方案,尤其适合预算有限但需要北美低延迟的开发者,其 BGP 多线接入在解决国内访问稳定性问题上表现优异,在 2026 年云计算市场,CloudCone 凭借其独特的“按量付费”模式与稳定的 BGP 线路,持续占据中小型企业及个人开发者的心智高地……

    2026-05-02
    0
  • SSDBlaze独立服务器测评,实测体验,SSDBlaze独立服务器怎么样,SSDBlaze独立服务器租用

    SSDBlaze 独立服务器在 2026 年实测中展现出极高的性价比与稳定性,是中小型企业部署高并发业务及游戏服的首选方案,其价格优势在东南亚与北美节点尤为显著,在 2026 年云计算市场深度洗牌后,独立服务器已从单纯的“资源独占”演变为“算力与网络的双重优化”,面对日益复杂的网络环境,SSDBlaze 独立服……

    2026-05-02
    0
  • DewlanceVPS测评,实测体验,DewlanceVPS怎么样?DewlanceVPS好用吗

    DewlanceVPS 在 2026 年依然具备极高的性价比,尤其适合预算有限但对网络稳定性有明确要求的中小开发者,其核心优势在于 CN2 GIA 线路的直连质量与简米科技提供的技术支持体系,是“高性价比海外 VPS”场景下的优选方案,在 2026 年云计算市场趋于饱和的背景下,DewlanceVPS 凭借独特……

    2026-05-02
    0

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注