【Debian學徒記事】 Debian 安裝源配置


Debian 安裝源配置

所有的Linux安裝完后第一件事,就是要更新安裝源

安裝源是什么呢,安裝源又稱軟件源,是指把軟件的安裝源地址放在一個pool里面,用一條命令(比如apt-get install XXX)就可以按照順序從源內指定的服務器查詢下載並進行更新或安裝

源列表文件通常在/etc/apt/sources.list,里面記錄了你所用的源服務器地址

0x01 首先我們需要獲取root用戶,切換權限

su
# 輸入你的root賬戶密碼,這里光標不會有顯示是否輸入,按就完了,注意小鍵盤及大小寫

0x02 切換到root賬戶后

vi etc\apt\source.list
# vim打開安裝源列表文件並進行相應編輯

0x03 vim編輯

  1. 方向鍵移動光標,按i進入插入模式

    注:命令模式下dd為刪除本行,x為刪除當前字符,輸入模式下方向鍵及delete、backspace均失效。按ESC可退出輸入模式,如對當前輸入不滿意,想要重新輸入可以進入命令模式下輸入q!。再次進入list文件修改時,會有提示,不要按enter進入繼續編輯,按其他任意鍵,丟棄上次編輯結果以重新進行編輯

  2. 將下列復制並替換到list文件內,終端內粘貼快捷鍵為Ctrl+Shift+V。

  3. 光盤文件源於源代碼已經注釋掉了,如有需要刪除前方#即可。注意下列源內包括兩種不同的Debian發行版,可注釋掉不需要的版本。

  4. 修改完成后,進入命令模式,輸入:wq!即可(注意:!)

# 
# deb cdrom:[Debian GNU/Linux 10.3.0 _Buster_ - Official amd64 DVD Binary-1 20200208-12:08]/ buster contrib main
# deb cdrom:[Debian GNU/Linux 10.3.0 _Buster_ - Official amd64 DVD Binary-1 20200208-12:08]/ buster contrib main
# deb http://deb.debian.org/debian/ buster main
# deb-src http://deb.debian.org/debian/ buster main
# deb http://security.debian.org/debian-security buster/updates main contrib
# deb-src http://security.debian.org/debian-security buster/updates main contrib
# buster-updates, previously known as 'volatile'
# deb http://deb.debian.org/debian/ buster-updates main contrib
# deb-src http://deb.debian.org/debian/ buster-updates main contrib
deb http://httpredir.debian.org/debian/ jessie main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian stable main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free
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

0x04 更新軟件源

注意上面的源內包括兩種不同的Debian發行版,注釋掉不需要的版本,否則這里會有沖突報錯,如不在意報錯可不注釋,目前未發現影響,后續如發現將進行補充,當然大佬們也可以提前幫助指正

sudo apt-get update
sudo apt-get upgrade

等待跑完即可


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM