ubuntu on windows安装和配置

因为github上很多都是在linux下运行的代码,我也不想用git on windows,于是使用win10自带的linux子系统。

一 安装 ubuntu on windows(bash on windows)

  • win10设置,更新和安全,开发者选项中选择开发者人员模式

  • 控制面板,程序,程序和功能,启动或关闭windows功能中选择勾选适用于linux的windows子系统。会提示重启电脑。

  • microstore中搜索ubuntu,选择ubuntu16.04,是五星评价的那个。点击get安装,等待。

  • 安装完毕打开,会提示安装组件之类的消息,等待一会,输入名称和密码。安装结束

二 ubuntu on windows的配置 (很重要)

第一步修改源,否则下载包会卡住。在bash.exe中输入以下代码进行备份

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

 接着修改源

sudo vim /etc/apt/sources.list

进入vim的insert模式

阿里源如下,将内容复制好,在bash.exe中点击右键即可完成粘贴操作。

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main

 依次更新软件列表和软件包

sudo apt-get update
sudo apt-get upgrade

最后安装基本组件即可完成配置

sudo apt-get install build-essential

 就可以make github上的makefile文件了


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值