vim常用命令
- 全選(高亮顯示):按esc后,然后ggvG或者ggVG
- 全部復(fù)制:按esc后,然后ggyG
- 全部刪除:按esc后,然后dG
- 粘貼:插入模式下,ctrl+shift+v(wsl開啟ctrl+shift+c/v復(fù)制粘貼模式)
# /etc/apt/sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup # 復(fù)制一份備份
sudo vim /etc/apt/sources.list
# 在第一行的第一個位置,按esc,輸入dG,全選刪除
# 因?yàn)樵趙sl中開啟了ctrl+shift+c/v復(fù)制粘貼模式,所以可以直接ctrl+c復(fù)制下邊的字符,在終端vim中按i進(jìn)入插入模式,再按ctrl+shift+v粘貼
#阿里云源
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
# 按esc,:wq,寫入保存
sudo apt-get update # 更新源
sudo apt-get install package # 安裝包
sudo apt-get remove package # 刪除包
sudo apt-cache search package # 搜索軟件包
sudo apt-cache show package # 獲取包的相關(guān)信息,如說明、大小、版本等
sudo apt-get install package --reinstall # 重新安裝包
sudo apt-get -f install # 修復(fù)安裝
sudo apt-get remove package --purge # 刪除包,包括配置文件等
sudo apt-get build-dep package # 安裝相關(guān)的編譯環(huán)境
sudo apt-get upgrade # 更新已安裝的包
sudo apt-get dist-upgrade # 升級系統(tǒng)
sudo apt-cache depends package # 了解使用該包依賴那些包
sudo apt-cache rdepends package # 查看該包被哪些包依賴
sudo apt-get source package # 下載該包的源代碼
sudo apt-get clean && sudo apt-get autoclean # 清理無用的包
sudo apt-get check # 檢查是否有損壞的依賴
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。