做为一个windows下面的开发者,以前工做一直用cygwin。cygwin虽然方便可是不少时候安装一些东西,好比jekyll,是各类依赖不足,太痛苦了。好在微软win10出了针对开发者的linux子系统,那就先试用一段时间吧。html
如今win10的linux子系统已经有ubuntu和opensuse两个版本了,应该后续还会推出更多的linux发行版。你们按我的喜爱安装吧。linux
安装过程,网上不少也不难,就略过了,你们自行搜索吧。ubuntu
个人linux子系统用的是ubuntu,使用起来简单方便啊😁vim
安装完成以后,顺手就是一个 apt update,可是默认的源太慢了,无法忍。那咱们就换国内源吧。windows
国内有好多源,阿里云,163,搜狐,中科大等等。咱们就以阿里云作个例子吧:浏览器
浏览器打开 http://mirrors.aliyun.com/bash
找到ubuntu的help测试
发现里面最新的是 Quantal(12.10) 看来不能直接复制阿里云
在你的子系统bash中执行url
cat /etc/apt/sources.list ------------------------- deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse -------------------------
索性最新版ubuntu16.04代号叫xenial
那直接把url换换就好了
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bk # 改配置文件,先备份是个好习惯 sudo vim /etc/apt/sources.list # 把内容换成下面的就好了,其实就是url变了 ------------------------- deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse -------------------------
搞定了,测试下:
sudo apt update
没问题就能够了。
原文链接: