虛拟機Ubuntu系統安裝與換源
1、ubuntu系統安裝
1.1下載下傳ubuntu鏡像
https://ubuntu.com/download/desktop
1.2打開VMware,建立新的虛拟機
1.3選擇自定義安裝
1.4一直下一步到此界面,選擇稍後安裝作業系統
1.5選擇Linux和Ubuntu64位
1.6一直按預設下一步到此,選擇将虛拟機盤存儲為單個檔案
1.7一直下一步完成建立後,修改CD/DVD到IOS檔案位置
1.8設定完成後打開此虛拟機進入到Ubuntu安裝界面,選擇中文(簡體)開始安裝
1.9一直按預設按繼續按鍵到此界面設定使用者名密碼,如果出現視窗過小看不到按鍵的問題可用windows加滑鼠左鍵移動視窗
1.10等待後安裝完成
2、對Ubuntu進行換源
2.1打開終端輸入
sudo cp /etc/apt/sources.list /etc/apt/sources_init.list進行備份
2.2打開源檔案
sudo gedit /etc/apt/sources.list
清空檔案内容
換為清華的的源
下面這些是國内主要的鏡像源網站。
阿裡源 https://developer.aliyun.com/mirror/
清華源 https://mirrors.tuna.tsinghua.edu.cn/
華科源 http://mirrors.ustc.edu.cn/
網易源 http://mirrors.163.com/
#添加清華源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse
2.3更新源
sudo apt-get update
2.4複損壞的軟體包,嘗試解除安裝出錯的包,重新安裝正确版本的。
sudo apt-get -f install
2.5更新軟體
sudo apt-get upgrade