1. 程式人生 > 其它 >kali 更換國內源

kali 更換國內源

開啟source源

vim /etc/apt/sources.list


沒有許可權進行更改 獲取root 許可權

按 i

提示內容:

E325: 注意
發現交換檔案 "/var/tmp/sources.list.swp"
所有者: depressiom 日期: 三 3月 09 20:37:48 2022
檔名: /etc/apt/sources.list
修改過: 是
使用者名稱: depressiom 主機名: depressiom
程序 ID: 1612
正在開啟檔案 "/etc/apt/sources.list"
日期: 三 3月 09 20:58:19 2022
比交換檔案新!

(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
如果是這樣,請用 ":recover" 或 "vim -r /etc/apt/sources.list"
恢復修改的內容 (請見 ":help recovery")。
如果你已經進行了恢復,請刪除交換檔案 "/var/tmp/sources.list.swp"
以避免再看到此訊息。

請按 ENTER 或其它命令繼續

輸入 :wq 提示: 加'!'強制執行,但是未儲存檔案


0. sudo su - # 獲取root 許可權

1. vim /etc/apt/sources.list  # 開啟source.list

2. 輸入 i  進行插入

3. ## 將自帶的kali源 註釋

4. 更換下面兩個源:
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib

deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib

5. 按esc鍵進入命令列模式  再輸入 :wq # 儲存 加'!' 強制執行

用apt update檢驗一下

請執行 ‘apt list --upgradable’ 來檢視它們。