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
    
  • 相关阅读:
    OpenCV-Python 霍夫直线检测-HoughLinesP函数参数
    2017 年度读书总结
    检查服务是否正在运行,如果未运行则启动
    添加MIME类型
    IIS功能查看、配置
    IIS下的身份验证方式管理
    PowerShell管理IIS(新建站点、应用程序池、应用程序、虚拟目录等)
    虚拟目录和应用程序的区别
    远程重启服务器
    逐行读取txt
  • 原文地址:https://www.cnblogs.com/testopsfeng/p/12777392.html
Copyright © 2011-2022 走看看