婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > ubuntu 更換阿里源實例

ubuntu 更換阿里源實例

熱門標簽:依蘭縣地圖標注app 潮州地圖標注 安陽百應電銷機器人加盟 百度地圖標注開鎖電話 琿春市地圖標注app 公司400電話辦理價格 百度中國地圖標注中心 山東企業電銷機器人價格 pageadm實現地圖標注

網上應該可以找到很多關于ubuntu源的設置方法,但是如果不搞清楚就隨便設置的話,不僅不能起到應有的效果,還會由于一些問題導致apt不可用。

最正確的更換源的方法應該如系統提示的:

## a.) add ‘apt_preserve_sources_list: true‘ to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

這種方法有點沒弄明白在/etc/apt/sources.list.d應該添加的是什么內容,如果是源文件的話,最后更改的模板又是什么作用?也沒有去嘗試,有時間會解決一下。

以下提供設置阿里源的方法,其他源也可以如法炮制:

1. 首先查看自己的ubuntu系統的codename,這一步很重要,直接導致你更新的源是否對你的系統起效果,查看方法:

    lsb_release -a

    如,我的系統顯示:

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty

    顯示了一些ubuntu的版本信息,需要得到的是Codename,比如,我這里是trusty

2. 確認阿里源支持:

    登陸以下網頁:http://mirrors.aliyun.com/ubuntu/dists/

    該網頁顯示了阿里云支持的ubuntu系統下各個Codename版本,確保自己的Codename在該網頁中存在(一般都會有的)

2. 備份系統源:

    cd /etc/apt
    sudo mv sources.list sources.list_bak

3. 添加新的源文件:

    sudo vi sources.list

并添加以下內容:注意,每一行的trusty應該用第一步查看得到的Codename來代替

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

4. 保存并且sudo apt-get update,更新成功

5. 以下提供配置腳本:

 1 Codename=$( (lsb_release -a)|awk ‘{print $2}‘|tail -n 1 )
 2 echo "\
 3 deb http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe
 4 deb http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe
 5 deb http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe
 6 deb http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe
 7 deb http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe
 8 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe
 9 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe
10 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe
11 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe
12 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe ">sources.list
13 apt-get update
sudo運行該腳本即可(注意運行之前最好備份之前的sources.list)

標簽:晉中 公主嶺 常德 林芝 呼和浩特 三明 香港 連云港

巨人網絡通訊聲明:本文標題《ubuntu 更換阿里源實例》,本文關鍵詞  ubuntu,更換,阿里,源,實例,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《ubuntu 更換阿里源實例》相關的同類信息!
  • 本頁收集關于ubuntu 更換阿里源實例的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 临澧县| 会理县| 凤翔县| 大埔区| 烟台市| 德令哈市| 玛曲县| 娱乐| 珠海市| 嘉鱼县| 呼图壁县| 平度市| 南召县| 剑河县| 调兵山市| 邯郸县| 镇沅| 德清县| 庆元县| 修武县| 黑河市| 贵阳市| 项城市| 温宿县| 贵港市| 黄陵县| 林甸县| 镇安县| 新蔡县| 抚顺县| 高要市| 信宜市| 海安县| 舞钢市| 会同县| 黄大仙区| 阜康市| 武鸣县| 宣汉县| 黄浦区| 宜春市|