文章目錄
前言
因爲項目需要在 ubuntu
上使用 ecplise,嘗試在 WIN 10
安裝 ubuntu
。
正文
第一步 安裝 ubuntu
- 在win10應用商店搜索 ubuntu,我選擇 ubuntu 20.04 LTS,公司網速快也等了幾分鐘,網速慢的可以自己找安裝包安裝。
2. 查看安裝
第二步 安裝圖形化界面
2.1 開源軟件 VcXsrv
2.1.1 下載安裝包
點擊 下載鏈接 進行下載。
下載完成後,默認配置就行,next -> install -> close
。
2.1.2 使用
按自己需求隨便選一個,一般默認就行。繼續
下一步
…
點擊 完成
,啓動。然後黑屏了,別關閉,記住下一步…
附:換源
執行 sudo vi /etc/apt/sources.list
並在文件最開始添加如下信息
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
執行:
sudo apt update
sudo apt upgrade
sudo apt autoremove
2.2 ubuntu 配置
2.2.1 Ubuntu內安裝桌面環境
sudo apt-get install ubuntu-desktop unity compizconfig-settings-manager
執行:
如果出現上述 ERROR: Package *** has no installation candidate
,沒有執行 update。
sudo apt-get update
執行:
重新執行安裝桌面環境:鍵入
y/Y
,繼續。
時間略久,網不好的同學換一下源。
OK
2.2.2 配置顯示
export DISPLAY=localhost:0
這個 0
就是對應 2.1.2 節的 display numer
,如果之前配置爲默認值 -1 是自動匹配的。
sudo ccsm
執行:
同時 VcXsrv
彈出界面如下:
彈出的警告窗口
- Show … 取消勾選
- Show …,點擊
OK
,點擊close
,繼續黑屏
2.2.4 開啓桌面
sudo compiz
整理成一鍵啓動腳本:
>> vi disklink.sh
#! /bin/bash
export DISPLAY=localhost:0
sudo compiz
>> chmod a+x disklink.sh
>> ./disklink.sh
注意事項
VcXsrvu
一直黑屏問題:
- 先開啓
VcXsrv
,後啓動Ubuntu
服務。
總結
這真是個坑啊,不建議!圖形化界面體驗賊差,不如虛擬機省時省事。
參考文獻
[1].https://blog.csdn.net/daybreak222/article/details/87968078
[2].https://zhuanlan.zhihu.com/p/34884285