美文网首页
Ubuntu20.04更换国内源

Ubuntu20.04更换国内源

作者: 再梦梦就醒了 | 来源:发表于2022-09-05 23:32 被阅读0次

    1、备份原来的源

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

    2、编辑sources.list配置文件更换源

    sudo vim/etc/apt/sources.list

    添加如下内容

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

    3、更新源

    sudo apt-get update

    4、更新软件

    sudo apt-get upgrade


    最后装个MySQL测试一下
    # apt install mysql-server
    
    可以看到已经成功安装上了MySQL80
    root@jiahao:/# mysql --version
    mysql  Ver 8.0.30-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))
    root@jiahao:/# dpkg -l | grep mysql
    ii  mysql-client-8.0                      8.0.30-0ubuntu0.20.04.2            amd64        MySQL database client binaries
    ii  mysql-client-core-8.0                 8.0.30-0ubuntu0.20.04.2            amd64        MySQL database core client binaries
    ii  mysql-common                          5.8+1.0.5ubuntu2                   all          MySQL database common files, e.g. /etc/mysql/my.cnf
    ii  mysql-server                          8.0.30-0ubuntu0.20.04.2            all          MySQL database server (metapackage depending on the latest version)
    ii  mysql-server-8.0                      8.0.30-0ubuntu0.20.04.2            amd64        MySQL database server binaries and system database setup
    ii  mysql-server-core-8.0                 8.0.30-0ubuntu0.20.04.2            amd64        MySQL database server binaries
    

    相关文章

      网友评论

          本文标题:Ubuntu20.04更换国内源

          本文链接:https://www.haomeiwen.com/subject/psmwnrtx.html