WSL下的Ubuntu 18.04LTS配置软件源和系统更新

Posted Kingyingbin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了WSL下的Ubuntu 18.04LTS配置软件源和系统更新相关的知识,希望对你有一定的参考价值。

WSL下的Ubuntu 18.04LTS配置软件源和系统更新

设置系统语言为中文

# 安装中文支持
sudo apt-get install -y language-pack-zh-hans
# 设置默认语言
sudo update-locale LANG=zh_CN.UTF-8

分别执行完上面的命令,关闭窗口,然后重新启动Ubuntu即可切换为中文。

更换软件源

1. 切换root用户

sudo -i

2. 备份当前软件源

 mv /etc/apt/sources.list /etc/apt/sources.list.bak

3. 编辑软件源管理文件

vim /etc/apt/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

网易软件源:

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

4.更新软件列表和系统软件包

sudo apt-get update&& apt-get upgrade

至此,软件源的配置结束,快下载个软件试试你的网速有没有飞起来吧
PS:配置LNMP的方案新手我推荐宝塔面板,包含可视化操作面板的服务器环境,对小白用户非常友好,官网:https://www.bt.cn/ ,也欢迎转至宝塔面板7.2.0,宝塔5.9.2安装学习版。

以上是关于WSL下的Ubuntu 18.04LTS配置软件源和系统更新的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu 18.04 LTS 搭建 LAMP 环境

ubuntu 18.04 LTS server系统安装失败问题解决

WSL Ubuntu 20.04 LTS 修改默认登陆用户

无法在 WSL Ubuntu 18.04 上安装 R Shiny Server

Ubuntu 18.04 LTS安装Samba服务及配置

WSL Ubuntu 宝塔 PHP 环境安装及配置