fedora中使用yum安裝軟體

火星人 @ 2014-03-25 , reply:0



筆記本上裝了 fedora , 類似 ubuntu 中的新立得, fedora 中可以使用 yum 來安裝軟體,並且可以比較好的解決軟體的依賴關係. 首先需要配置源: 在 /etc/yum.repos.d 下面創建兩個文件:

第一個是 fedora-sjt, 內容為 :
[base-sjtu]
name=Fedora Core $releasever - $basearch - Base
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/core/$releasever/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
[extras-sjtu]
name=Fedora Extras $releasever - $basearch
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/extras/$releasever/$basearch/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
gpgcheck=1
[updates-sjtu]
name=Fedora Core $releasever - $basearch - Released Updates
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/core/updates/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

第二個文件起名 fedora-ts, 內容:
[base-ts]
name=Fedora Core $releasever - $basearch - Base
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

[extras-ts]
name=Fedora Extras $releasever - $basearch
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
gpgcheck=1

[updates-ts]
name=Fedora Core $releasever - $basearch - Released Updates
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora

[freshrpms-ayo]
name=Fedora Core $releasever - $basearch - Freshrpms
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/ayo.freshrpms.net/pub/freshrpms/ayo/fedora/linux/$releasever/$basearch/freshrpms/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-freshrpms
enabled=1

[livna]
name=Fedora Core $releasever - $basearch - livna
baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/livna/fedora/$releasever/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-freshrpms

然後就可以安裝軟體了, 比如 :
yum install yumex
將會安裝 yum 的圖形界面前端, 可以像新立得一樣方便的下載所需的軟體

記住兩個命令行選項 --enablerepo 和 --disablerepo
這兩個選項可以混合用,比如先 --disablerepo=\* 然後 --enablerepo=base-sjtu
因為如果已經知道只有一個倉庫有自己想要的軟體(和依賴關係),那麼同時啟用其他倉庫就有些浪費時間,解析依賴關係時出錯的可能性更大。



[火星人 via ] fedora中使用yum安裝軟體已經有102次圍觀

http://www.coctec.com/docs/linux/show-post-169551.html