Trip to Ubuntu
前言
前几天我在Microsoft Store里发现了Ubuntu,它是运行在Windows上的子系统,第一时间我就开始了Ubuntu的配置探索之旅。
安装
我在Microsoft Store安装之后,发现它是装在C盘系统盘的,为了节省C盘空间,我采取了转移到非系统盘的方式
通过安装,我定位到了它的安装路径
1
| C:\Users\xxxx\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc
|
接着,我将它卸载,通过创建软链接来解决这个问题
先在想要安装的位置创建了Ubuntu文件夹
然后打开cmd
终端,输入
1
| mklink /j C:\Users\XXXX\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc D:\Ubuntu\
|
创建成功后,再重新在Microsoft Store中安装Ubuntu
安装过程中如果出现了安装失败的问题,可以运行
1
| icacls D:\Ubuntu /grant "用户名:(OI)(CI)(F)"
|
配置
换源
清华源
1 2 3 4 5 6 7 8 9 10 11 12 13
| # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
|
阿里源
1 2 3 4 5 6 7 8 9 10 11 12 13
| # 默认注释了源码仓库,如有需要可自行取消注释 deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.aliyun.com/ubuntu/ bionic 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-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-proposed main restricted universe multiverse # deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
|
中科大源
1 2 3 4 5 6 7 8 9 10 11 12 13
| # 默认注释了源码仓库,如有需要可自行取消注释 deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用 # deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
|
网易源
1 2 3 4 5 6 7 8 9 10 11 12 13
| # 默认注释了源码仓库,如有需要可自行取消注释 deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse # deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse # deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse # deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
# 预发布软件源,不建议启用 # deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
|
先对系统给的镜像源进行备份,以防止出现问题
1
| $ sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
|
然后,修改数据源配置文件
1
| $ sudo vim /etc/apt/sources.list
|
选择一个源添加到文件最前面或直接将官方的源注释掉替换掉原文件
更新软件源中的所有软件列表:
更新软件:
更新系统版本:
1
| $ sudo apt-get dist-upgrade
|
下载中文语言包:
1
| $ sudo apt-get install language-pack-zh-han*
|
安装 C/C++ 开发环境
安装编译工具包:
1
| $ sudo apt-get install build-essential
|
安装 nginx 依赖库:
1
| $ sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev
|
图形界面
首先安装使用VcXsrv Windows X Server
启动Launcher,首次启动自动进入界面设置后,选择:“one large window”,Display number设置成0,其它默认即可:
安装桌面环境
1
| sudo apt-get install ubuntu-desktop unity compizconfig-settings-manager
|
启动之前安装的X-Windows,在Bash中执行如下命令:
1 2
| export DISPLAY=localhost:0 ccsm
|
启动compiz (打开桌面)