感谢支持
我们一直在努力

Fedora 14 下源的更新与优化

设置优化系统yum镜像源


一、添加fusion


1.添加rpm fusion



sudo rpm -Uvh http://download1.rpmfusion.org/free/Fedora/rpmfusion-free-release-stable.noarch.rpm


sudo rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm


2.导入rpm fusion仓库的密钥
  rpm –import http://ATrpms.net/RPM-GPG-KEY.atrpms  
3.
修改密钥文件
  gedit /etc/yum.conf
  在打开的文件尾部添加下面几行:

  [atrpms]
  name=Fedora Core releasever – basearch – ATrpms
  baseurl=http://dl.atrpms.net/freleasever-basearch/atrpms/stable
  gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
  gpgcheck=1





二、更换Fedora 14yum升级源


Fedora发行版一直没有采用Ubuntu中动态选择升级源的技术,让我们这些粉丝真的很郁闷;国内的开源镜像源也就sohu163和上海交大那几个,速度吗还是要比国外的快点,我们只好自己动手来更换fedora的升级源啦;


1.添加上sohu的yum


首先从http://mirrors.sohu.com/help/fedora-sohu.repohttp://mirrors.sohu.com/help/fedora-updates-sohu.repo下载fedora-sohu.repofedora-updates-sohu.repo,放入/etc/yum.repos.d/文件夹下;


这是sohu的源,速度很快,这两个文件原来是为fedora 7~13设计的,现在也已经适用14啦;赶快体验一下吧!


如果fedora-sohu.repofedora-updates-sohu.repo无法下载,就把以下内容分别保存为fedora-sohu.repofedora-updates-sohu.repo


#以下请保存为fedora-sohu.repo


[fedora]
name=Fedora releasever – basearch – sohu.com
failovermethod=priority
baseurl=http://mirrors.sohu.com/fedora/releases/releasever/Everything/basearch/os/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-releasever&arch=basearch
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 – sohu.com
failovermethod=priority
baseurl=http://mirrors.sohu.com/fedora/releases/releasever/Everything/basearch/debug/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-releasever&arch=basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-basearch

[fedora-source]
name=Fedora releasever – Source – sohu.com
failovermethod=priority
baseurl=http://mirrors.sohu.com/fedora/releases/releasever/Everything/source/SRPMS/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-releasever&arch=basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-basearch





#以下请保存为fedora-updates-sohu.repo


[updates]
name=Fedora releasever – basearch – Updates – sohu.com
failovermethod=priority
baseurl=http://mirrors.sohu.com/fedora/updates/releasever/basearch/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-freleasever&arch=basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-basearch

[updates-debuginfo]
name=Fedora releasever – basearch – Updates – Debug – sohu.com
failovermethod=priority
baseurl=http://mirrors.sohu.com/fedora/updates/releasever/basearch/debug/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-freleasever&arch=basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-basearch

[updates-source]
name=Fedora releasever – Updates Source – sohu.com
failovermethod=priority
baseurl=http://mirrors.sohu.com/fedora/updates/releasever/SRPMS/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-freleasever&arch=basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-basearch


p { margin-bottom: 0.21cm; }


2.添加163源:


输入gedit /etc/yum.repos.d/163.repo,回车


再次把一下内容复制到打开的163.repo中:


[Fedora-mirrors.163.com]
name=Fedora 12 – i386
baseurl=http://mirrors.163.com/fedora/updates/12/i386/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[Everything-mirrors.163.com]
name=Everything 12 – i386
baseurl=http://mirrors.163.com/fedora/updates/12/i386/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
[updates-mirrors.163.com]
name=Fedora updates
baseurl=http://mirrors.163.com/fedora/updates/12/i386/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY


保存,关闭163.repo




3、添加上海交大的yum源1:

[Fedora-ftp.sjtu.edu.cn]

name=Fedora 14 – i386
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/14/Fedora/i386/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
[Everything-ftp.sjtu.edu.cn]
name=Everything 14 – i386
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/14/Everything/i386/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
[updates-ftp.sjtu.edu.cn]
name=Fedora updates
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/updates/14/i386/
enabled=1
gpgcheck=0


将以上内容保存至/etc/yum.repos.d/sjtu.repo即可


添加上海交大的yum源2:



gedit  /etc/yum.repos.d/sjtu.repo

  在打开的文件中添加如下行:

  [fedora]
  name=Fedora releasever – basearch
  failovermethod=priority
  baseurl=ftp://openware.byr.edu.cn/pub/mirror/fedora/linux/releases/releasever/Everything/basearch/os/
  http://ftp.sjtu.edu.cn/fedora/linux/releases/releasever/Everything/basearch/os/
  ftp://ftp.sjtu.edu.cn/fedora/linux/releases/releasever/Everything/basearch/os/
  ftp://ftp.cuhk.edu.hk/pub/Linux/fedora/releases/releasever/Everything/basearch/os/
  enabled=1
  gpgcheck=1
  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-basearch
  [updates]
  name=Fedora releasever – basearch – Updates
  failovermethod=priority
  baseurl=ftp://openware.byr.edu.cn/pub/mirror/fedora/linux/updates/releasever/basearch/
  http://ftp.sjtu.edu.cn/fedora/linux/updates/releasever/basearch/
  ftp://ftp.cuhk.edu.hk/pub/Linux/fedora/updates/releasever/basearch/
  enabled=1
  gpgcheck=1
  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-basearch

  然后保存退出。


(参考:

国内的两大门户网易和搜狐都有镜像服务器,http://mirrors.163.com/http://mirrors.sohu.com/
添加他们的源可以看他们的帮助(搜狐用英语),以fedora12为例:
添加搜狐源,点击fedora后边的“help”,先下载fedora-sohu.repofedora-updates-sohu.repo,放入/etc/yum.repos.d/
运行yum makecache生成缓存即可。
添加163源,点击fedora后边的“使用帮助“,下载fedora-163.repofedora-updates-163.repo,放入/etc/yum.repos.d/
运行yum makecache生成缓存即可。




三、运行yum makecache生成缓存


#切换到/etc/yum.repos.d/目录之下,对照着链接不上的显示,将链接不上的yum源挨个删除,yum源有一个对的就好了,多余的不对源反而让yum用不了。


 


更新系统:su切换到root用户下,运行 yum update(时间很长)


系统更新完成后应该马上重启电脑,这时就会以新内核登录,在登录后,执行:sudo updatedb命令(或在root用户下执行updatedb),该命令更新系统数据库文件,有时候这个命令很有效,因为系统自动更新数据库文件是每周一次,而有时我们操作很频繁,所有手动更新有很多好处


五,设置sudo命令:


首先,打开终端,获得root环境: su –,并输入root帐户密码。


接着输入: visudo,将会打开一个配置文件,(会使用VI编辑器打开文件,按字母i输入,修改完后按ESC后输入“:wq”退出)


找到 root ALL=(ALL) ALL这一行,紧跟此行增加一行


username ALL=(ALL) ALL


即获得了sudo用户


完成后执行“exit”命令退出root环境,再执行:sudo whoami,输入密码后如果效果是“root”,则配置成功,


这以后就能应用sudo命令而不是每次都必须是root环境了。


六、更新yum插件,以加快下载速度。由于yum中有的mirror速度是非常慢的,如果yum选择了这个mirror,这个时候yum就会非常慢,可以下载fastestmirror插件和presto插件,它会自动选择最快的mirror

  yum install yum-presto -y

  yum -y install yum-fastestmirror


(此种命令也可:


安装插件  yum-fastestmirror


sudo yum install yum-fastestmirror

赞(0) 打赏
转载请注明出处:服务器评测 » Fedora 14 下源的更新与优化
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏