路径:装的位置为: /home/red/R
这里都是在线安装的过程,可以保存下yum的包,以后就不用在线安装了
在线装好后会有一段时间的404,等一会网络好了就没事了
重要:
http://mirrors.163.com/centos/
http://cran.r-project.org/
《4》cd /etc/yum.repos.d/
#这里需要清空yum仓库
《5》wget http://mirrors.163.com/.help/CentOS6-Base-163.repo《6》sed -i "s/\$releasever/6/" CentOS6-Base-163.repo
#这个语法指的是把文件CentOS6-Base-163.repo(下载下来是个模板)里面所有的$releasever全部替换为你得版本号即:6,注意空格
《7》yum makecache#详细的解答,这里的路径是不准确的参照上方即可
1.删除redhat 原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下载yum 安装文件
Wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
3.安装yum 软件包
(1)rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
(2)rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
(3) 两个一起安装先后顺序不要乱(中间50%正常)
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
4、更改yum源 #我们使用网易的CentOS镜像源
(1)清空yum仓库
# cd /etc/yum.repos.d/
#rm -rf *
(2)设置源
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
# vi CentOS6-Base-163.repo
编辑文件,把文件里面所有的$releasever全部替换为你得版本号,即6.4 最后保存!或者直接把下面的内存拷贝到CentOS6-Base-163.repo文件中即可(已经修改好)
#################################################################
# CentOS-Base.repo
#
# The mirrorsystem uses the connecting IP address of the client and the
# update status ofeach mirror to pick mirrors that are updated to and
# geographicallyclose to the client. You should use thisfor CentOS updates
# unless you aremanually picking other mirrors.
#
# If the mirrorlist=does not work for you, as a fall back you can try the
# remarked outbaseurl= line instead.
#
[base]
name=CentOS-6.4 -Base - 163.com
baseurl=http://mirrors.163.com/centos/6.4/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-6.4 -Updates - 163.com
baseurl=http://mirrors.163.com/centos/6.4/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additionalpackages that may be useful
[extras]
name=CentOS-6.4 -Extras - 163.com
baseurl=http://mirrors.163.com/centos/6.4/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additionalpackages that extend functionality of existing packages
[centosplus]
name=CentOS-6.4 -Plus - 163.com
baseurl=http://mirrors.163.com/centos/6.4/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib -packages by Centos Users
[contrib]
name=CentOS-6.4 -Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6.4/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#####################################################################
5、清理yum缓存
# yum clean all
# yum makecache #将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度
# yum installvim* #测试域名是否可用
构建数据源基本资料
yum repolist all至此,Redhat6可以使用CentOS的yum源在线安装软件了!
6.使用 # yum update
或 # yum upgrade 升级系统
注:两个命令区别:
# yum update
升级所有包,改变软件设置和系统设置,系统版本内核都升级
# yum -y upgrade
升级所有包,不改变软件设置和系统设置,系统版本升级,内核不改变
#其他安装注意:
1.替换yum数据源的过程中/etc/yum.repos.d/:
首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
运行以下命令生成缓存
yum clean all yum makecache2.
其实就是没有权限进行sudo,解决方法如下(这里假设用户名是cuser):
1.切换到超级用户:$ su
2.打开/etc/sudoers文件:$vi /etc/sudoers
3.修改文件内容:按 “i” 进去编辑状态
找到“root ALL=(ALL) ALL”一行,在下面插入新的一行,内容是“xxx ALL=(ALL) ALL”,然后按“Esc”,按”:“,滞后键入命令“wq!”保存并退出。
注:这个文件是只读的,不加“!”保存会失败。
4.退出超级用户:$ exit
5.可以尽情使用sudo了。
3. can't create transaction lock on /var/lib/rpm/.rpm.lock 错误错误原因:权限问题
解决方法:在终端输入“su”和密码,登录root,以root身份登录就不会有提示
4.
移动文件或目录,或是更改其名称使用:mv
from:
1.http://mirrors.163.com/.help/centos.html
2.http://blog.csdn.net/inkfish/article/details/5168676
2.2 http://www.2cto.com/os/201302/189692.html
3.http://blog.csdn.net/leeafu/article/details/7449353
4.http://blog.csdn.net/fengyifei11228/article/details/8499932