debian换源_WSL2安装Debian(Ubuntu)并配置国内apt源
從我本科學編程以來一直用的mac,配環境都用homebrew,省心到都不曉得外面的世界多險惡。最近得到一臺windows,需要在上面配置開發環境,把過程記錄下來免得下次重裝機時忘了。
一、安裝WSL和Debian並切換至WSL2
二、切換Debian的apt-get至國內源
1. 用預設源做sudo apt-get update(不能一開始就換源!否則換源後需要的ca-certificates組件沒辦法裝)
sudo apt-get update2. 安裝ca-certificates,Debian Buster(10) 版開始己經不需要apt-transport-https
sudo apt-get install ca-certificates3. 打開內建的vim,編輯/etc/apt/sources.list,注意是vi不是vim
sudo vi /etc/apt/sources.list4. 將以下內容取代原本的,記得先備份([trusted=yes]很重要)。內建的vim有bug,Insert模式下按方向鍵會輸出ABCD,所以正確姿勢是按dd清除每一行,按i進入insert,按右鍵黏貼,按esc退出insert,:wq保存後離開。
deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free # deb-src [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free #deb-src [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free # deb-src [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free # deb-src [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free5. 幹掉坑爹內建vim,換成完整版,測試一下換源是否成功。
sudo apt-get update sudo apt-get remove vim-common sudo apt-get install vim三、Shell從bash換成zsh
最難的換源己經結束,再來要把預設shell換成用習慣的zsh + oh-my-zsh,找篇ubuntu安裝zsh的教學照做即可。(debian換shell方式同ubuntu)
Ubuntu 16.04下安裝zsh和oh-my-zsh?www.cnblogs.com四、安裝pyenv和Python3
同樣找篇教學照做即可,如果己經換了shell,要在~/.zshrc更新pyenv的PATH而不是~/.bashrc。
https://blog.csdn.net/wanyu_lss/article/details/81138268?blog.csdn.net總結
還是homebrew好。
參考資料
量子位:微軟更新Linux子系統,編譯WSL 2內核只需3步
Tsinghua Open Source Mirror
總結
以上是生活随笔為你收集整理的debian换源_WSL2安装Debian(Ubuntu)并配置国内apt源的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: BUUCTF-Reverse:[GKCT
- 下一篇: 使用汇编软件emu8086输出十次Hel