小白openwrt编译笔记——win10安装ubuntu及改国内源

Windows10不需要虚拟机直接运行ubuntu子系统,步骤如下:

一、安装

①打开设置找到”应用和功能“选项;
小白openwrt编译笔记——win10安装ubuntu及改国内源_第1张图片

②下拉到底,点击”程序和功能“;

小白openwrt编译笔记——win10安装ubuntu及改国内源_第2张图片

③点击“启用或关闭Windows功能”;
小白openwrt编译笔记——win10安装ubuntu及改国内源_第3张图片

④把”适用于Linus的Windows子系统“打勾,点确定保存;

小白openwrt编译笔记——win10安装ubuntu及改国内源_第4张图片

⑤打开Microsoft store 搜索’ubuntu’,我下载的是ubuntu 18.04 LTS

小白openwrt编译笔记——win10安装ubuntu及改国内源_第5张图片
⑥打开会让你设置账户密码,设置完就可以使用啦。
小白openwrt编译笔记——win10安装ubuntu及改国内源_第6张图片

二、改源

①为什么要改源?因为ubuntu默认源在国外,国内使用很多时候下载速度只有20K左右,下载个源码下个一两天这谁受得了;不改源用科学也是可以的,但是有时候速度还是奇慢,可能是我的梯子太low了吧

②怎么改源?

(1).打开Ubuntu

cd /etc/apt            进入/etc/apt/   

(2).在修改前先对 sources.list文件(源文件)进行备份

sudo cp sources.list sources.list.bak

(3).用你熟悉的编辑器打开sources.list

ubuntu路径:etc\apt\sources.list

win10路径:
C:\Users\你的win10账户\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\etc\apt\sources.list

替换默认的

archive.ubuntu.com              #默认源(英国)

为(选一个,我选的是阿里源)

mirrors.aliyun.com               #阿里源
mirrors.tuna.tsinghua.edu.cn      #清华源
mirrors.163.com                   #网易源
mirrors.ustc.edu.cn               #中科大源

小白openwrt编译笔记——win10安装ubuntu及改国内源_第7张图片
替换完成后内容如下:
(默认不启用测试版源,去除源地址前面的#号即可启用)

mirrors.aliyun.comors.aliyun.com/ubuntu/ bionic main restricted
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ bionic universe
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates universe
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.aliyun.com/ubuntu/ bionic multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
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

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu/ bionic-security main restricted
deb http://security.ubuntu.com/ubuntu/ bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu/ bionic-security universe
deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu/ bionic-security multiverse

(4)在Ubuntu里更新,等待更新完成就OK啦

sudo apt update      #更新软件列表

你可能感兴趣的:(笔记)