日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Ubuntu18.04更改apt為阿里云軟件源

ubuntu更改apt源為國內(nèi)更新源(或者軟件源)方法早就有了,內(nèi)容大同小異,我們應(yīng)當(dāng)掌握其規(guī)律了,其實(shí)每一版內(nèi)容不同的地方就是版本號(hào)(或者官方一點(diǎn)的說:系統(tǒng)代號(hào)),所以我們先了解下新版本的系統(tǒng)代號(hào):

使用命令:lsb_release -c

得到本系統(tǒng)的系統(tǒng)代號(hào),如下圖所示:

我們可以看到新版本的Ubuntu系統(tǒng)代號(hào)為bionic

同樣的我們也可以得到之前任意版本的系統(tǒng)代號(hào):

Ubuntu 12.04 (LTS)代號(hào)為precise。
Ubuntu 14.04 (LTS)代號(hào)為trusty。
Ubuntu 15.04 代號(hào)為vivid。
Ubuntu 15.10 代號(hào)為wily。
Ubuntu 16.04 (LTS)代號(hào)為xenial。

所以這也就解釋了為什么利用搜索引擎搜出來的那么多方案里面內(nèi)容不盡相同的原因,因?yàn)榇蠹腋腶pt安裝源時(shí)用的系統(tǒng)不一樣。

一、首先備份Ubuntu系統(tǒng)的官方源文件

1、打開Ubuntu的命令終端,進(jìn)入源文件 sources.list 所在的目錄:

2、然后執(zhí)行備份命令,執(zhí)行 sudo cp sources.list sources.list.backup 對源文件內(nèi)容進(jìn)行備份,以防萬一。

cd /etc/apt
sudo cp sources.list sources.list.backup

二、修改源文件內(nèi)容

1、阿里源文件內(nèi)容如下:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

值得注意的是 sources.list 文件的條目都是有格式的(通過上面的內(nèi)容大家也看的出來),一般有如下形式:
deb http://site.example.com/debian distribution component1 component2 component3
deb-src http://site.example.com/debian distribution component1 component2 component3

所以后面幾個(gè)參數(shù)是對軟件包的分類(Ubuntu下是main, restricted,universe ,multiverse這四個(gè))
所以你把內(nèi)容寫成:

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed universe multiverse

上面之類的也是可以的,之前我有這個(gè)疑惑,所以在這里一并告知和我有一樣疑惑的朋友。

2、將上述阿里源的文件內(nèi)容全部復(fù)制,使用 sudo vim sources.list 打開文件,輸入 ggdG(vim操作指令)刪除所有內(nèi)容(這句指令可以理解為刪除第一行到最后一行的的全部內(nèi)容)

sudo vim sources.list    # 在 /etc/apt 目錄下
ggdG    # 使用vim打開 sources.list 文件后執(zhí)行此命令

3、將復(fù)制的阿里源文件內(nèi)容全部粘貼到文件中后,輸入 : ——> wq 保存退出。

更新源

使用 sudo apt-get update 即可更新獲取 阿里軟件源 提供的軟件列表

sudo apt-get update

更新軟件

使用 sudo apt-get upgrade 即可跟新軟件
sudo apt-get upgrade


網(wǎng)站標(biāo)題:Ubuntu18.04更改apt為阿里云軟件源
文章路徑:http://www.dlmjj.cn/article/dhcoehg.html