2013年8月29日 星期四

修改 Fedora yum server



可上下面網站找尋
http://mirrors.fedoraproject.org/publiclist/

不同的 fedora 版本, 有不同的 server @@@@

以下以 Fedora 13 做範例

/etc/yum.repos.d 下有三個檔案
-rw-r--r--. 1 root root 1495 Aug 29 13:45 fedora.repo
-rw-r--r--. 1 root root 1410 Aug 29 13:41 fedora-updates.repo
-rw-r--r--. 1 root root 1492 Aug 29 13:41 fedora-updates-testing.repo
修改三個檔案中的 baseurl 或 mirrorlist 成你要的 server

vim fedora.repo
[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
baseurl=http://ftp.cuhk.edu.hk/pub/linux/fedora-archive/fedora/linux/releases/$releasever/Everything/$basearch/os/
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
baseurl=http://ftp.cuhk.edu.hk/pub/linux/fedora-archive/fedora/linux/releases/$releasever/Everything/$basearch/debug/
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch
baseurl=http://ftp.cuhk.edu.hk/pub/linux/fedora-archive/fedora/linux/releases/$releasever/Everything/source/SRPMS/
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch


vim fedora-updates.repo
[updates]
name=Fedora $releasever - $basearch - Updates
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
baseurl=http://ftp.cuhk.edu.hk/pub/linux/fedora-archive/fedora/linux/updates/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[updates-debuginfo]
name=Fedora $releasever - $basearch - Updates - Debug
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/debug/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch
baseurl=http://ftp.cuhk.edu.hk/pub/linux/fedora-archive/fedora/linux/updates/$releasever/$basearch/debug/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[updates-source]
name=Fedora $releasever - Updates Source
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/SRPMS/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch
baseurl=http://ftp.cuhk.edu.hk/pub/linux/fedora-archive/fedora/linux/updates/$releasever/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch


vim fedora-updates-testing.repo
[updates-testing]
name=Fedora $releasever - $basearch - Test Updates
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/testing/$releasever/$basearch/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch
baseurl=http://ftp.cuhk.edu.hk/pub/linux/fedora-archive/fedora/linux/updates/testing/$releasever/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[updates-testing-debuginfo]
name=Fedora $releasever - $basearch - Test Updates Debug
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/testing/$releasever/$basearch/debug/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-debug-f$releasever&arch=$basearch
baseurl=http://ftp.cuhk.edu.hk/pub/linux/fedora-archive/fedora/linux/updates/testing/$releasever/$basearch/debug/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[updates-testing-source]
name=Fedora $releasever - Test Updates Source
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/testing/$releasever/SRPMS/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-source-f$releasever&arch=$basearch
baseurl=http://ftp.cuhk.edu.hk/pub/linux/fedora-archive/fedora/linux/updates/testing/$releasever/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch


.清除yum暫存
# yum clean all

.列出有更新的檔案
# yum list

.執行更新
yum update


補上 yum 指令

# yum search [套件名稱/關鍵字]
# yum install [套件名稱]
# yum remove [套件名稱]

沒有留言:

張貼留言