在 VMWare Workstation Player 中創建一個 Linux(Debian)虛擬機並安裝 VMWare Tools(用於虛擬機與主機共享剪貼板)、配置軟件倉庫(方便安裝常用軟件)

1、到 Debian.org 的鏡像選擇頁面(或其它頁面)選擇官方站點或任意一個鏡像站點下載其中一個版本。我選的是 https://mirror.xtom.com.hk/debian-cd/10.4.0/amd64/iso-bd/ 中的 debian-edu-10.4.0-amd64-BD-1.iso 。
下載完畢後,如果安裝了 7-zip 或類似軟件,通過計算哈希來校驗文件。7-zip 安裝後可以通過右鍵菜單的 CRC SHA 一項來驗證哈希值:
在這裏插入圖片描述將需要驗證的哈希值與鏡像網站上提供的哈希值對比,如果相同則認爲下載沒有錯誤。
在這裏插入圖片描述在這裏插入圖片描述
2、下載 VMWare Workstation Player,目前的最新版本爲 15.5.5:https://my.vmware.com/en/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/15_0

3、安裝 VMWare Workstation Player,並按照提示用剛纔下載好的系統鏡像創建新的虛擬機。創建過程中可以選擇帶有 GUI 的 profile。

4、安裝完成後,關閉虛擬機。在下一次啓動虛擬機之前修改虛擬機設置:將 CD / DVD 驅動器(如果沒有則添加)裝載的鏡像文件改成 VMWare Workstation Player 安裝目錄下的 linux.iso,保存設置後啓動虛擬機。

5、虛擬機的桌面上會多出一個 VMWare tools。打開,將裏面的 tar 壓縮包複製到任意一個目錄並解壓(如果對命令行終端不熟悉,也可以在圖形界面上操作),然後在終端下執行 vmware-install.pl。開始執行後,一路按默認設置(不停按回車,要求輸入 yes 或者 y 就輸入)安裝,最後按照終端上的提示運行指定的文件(如果有這樣的提示的話),然後重啓。接下來這個虛擬機已經可以和物理機共用剪貼板了。

6、以 root 用戶(最高權限用戶)登錄,進入 /etc/apt 目錄:

cd /etc/apt

可以先將原有的 sources.list 備份:

mv sources.list sources.bak

用自帶的文本編輯器 vim 打開 sources.list:

vim sources.list

按 i 鍵進入輸入模式,將全部文本選中(可以用鼠標選),然後按 Delete 鍵刪除,再複製清華大學鏡像站提供的內容到這個文件上(Shift + Insert 粘貼):

# 默認註釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消註釋
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

按 Esc 鍵,然後輸入 :wq 保存並退出。
也可按自己的需要選擇其它的軟件倉庫。

7、輸入:

apt-get update

更新軟件倉庫的軟件列表。然後就可以通過 apt-get 直接輸入相應命令來安裝需要的軟件了。例如:

apt-get install gcc
apt-get install g++
apt-get install gdb
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章