zoukankan      html  css  js  c++  java
  • Ubuntu18.04修改apt-get源

    1)备份源文件:

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

    2)查看版本信息
    如是Linux Mint等Ubuntu衍生版,执行:

    cat /etc/upstream-release/lsb-release
    

    如是Ubuntu直接执行:

    lsb_release -c
    

    确认当前系统代号(Codename)为:bionic。如是其他版本,请使用其他版本的软件源,其中:

    Ubuntu 12.04 (LTS)代号为precise。
    Ubuntu 14.04 (LTS)代号为trusty。
    Ubuntu 15.04 代号为vivid。
    Ubuntu 15.10 代号为wily。
    Ubuntu 16.04 (LTS)代号为xenial。
    Ubuntu 18.04 (LTS)代号为bionic
    

    3)修改sources.list:
    修改/etc/apt/sources.list为以下内容:

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

    3.1) for Ubunto 20

    sudo sed "s/bionic/$(lsb_release -c | awk '{print $2}')/g" /etc/apt/sources.list
    

    4)检查更新

    sudo apt-get update
    

    5)可选操作:移除原有源

    cd /etc/apt/sources.list.d
    sudo mv official-package-repositories.list official-package-repositories.list.bak
    
  • 相关阅读:
    [CTF隐写]png中CRC检验错误的分析
    Bugku
    Bugku
    【CTF 攻略】CTF比赛中关于zip的总结
    sqlserver中利用Tran_sql把逗号分隔的字符串拆成临时表
    H5摇一摇遇到的问题
    C# MVC 微信支付之微信模板消息推送
    各种大型网站技术架构
    ORM框架详解
    显示实现接口
  • 原文地址:https://www.cnblogs.com/testopsfeng/p/12777392.html
Copyright © 2011-2022 走看看