1.安裝yum
apt-get install yum
2.配置yum源
由於是Ubuntu沒有yum源,所以要想使用yum安裝軟件必須要配置yum安裝源。在/etc/yum/repos.d/目錄下創建兩個文件,fedora-163.repo和fedora-updates-163.repo。分別複製以下配置信息保存即可。
推薦使用vim編輯器。在終端使用:
vi fedora-163.repo
進入第一個文件,然後:
在命令模式下按下鍵盤上的a進入插入模式;粘貼下面兩個文件內容;按下ESC鍵;再輸入 :wq! 強制保存 (可能創建的文件是隻讀的,這樣可以不用修改權限即可更改文件內容)(需要在root用戶下)
fedora-163.repo文件內容:
[fedora]
name=Fedora 17 - basearch−163.comfailovermethod=prioritybaseurl=http://mirrors.163.com/fedora/releases/17/Everything/basearch/os/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-17&arch=basearchenabled=1metadataexpire=7dgpgcheck=1gpgkey=file:///etc/pki/rpm−gpg/RPM−GPG−KEY−fedora−basearch
[fedora-debuginfo]
name=Fedora 17 - basearch−Debug−163.comfailovermethod=prioritybaseurl=http://mirrors.163.com/fedora/releases/17/Everything/basearch/debug/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-17&arch=basearchenabled=0metadataexpire=7dgpgcheck=1gpgkey=file:///etc/pki/rpm−gpg/RPM−GPG−KEY−fedora−basearch
[fedora-source]
name=Fedora 17 - Source - 163.com
failovermethod=priority
baseurl=http://mirrors.163.com/fedora/releases/17/Everything/source/SRPMS/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-17&arch=basearchenabled=0metadataexpire=7dgpgcheck=1gpgkey=file:///etc/pki/rpm−gpg/RPM−GPG−KEY−fedora−basearch
fedora-updates-163.repo文件內容:
[updates]
name=Fedora 17 - basearch−Updates−163.comfailovermethod=prioritybaseurl=http://mirrors.163.com/fedora/updates/17/basearch/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f17&arch=basearchenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm−gpg/RPM−GPG−KEY−fedora−basearch
[updates-debuginfo]
name=Fedora 17 - basearch−Updates−Debug−163.comfailovermethod=prioritybaseurl=http://mirrors.163.com/fedora/updates/17/basearch/debug/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f17&arch=basearchenabled=0gpgcheck=1gpgkey=file:///etc/pki/rpm−gpg/RPM−GPG−KEY−fedora−basearch
[updates-source]
name=Fedora 17 - Updates Source - 163.com
failovermethod=priority
baseurl=http://mirrors.163.com/fedora/updates/17/SRPMS/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f17&arch=basearchenabled=0gpgcheck=1gpgkey=file:///etc/pki/rpm−gpg/RPM−GPG−KEY−fedora−basearch
3.執行配置
在終端輸入
yum makecache
即可完成在Ubuntu中安裝yum
原博地址