CentOS 6.2
废话不多说,说说过程:
(1) http 安装 centos 6.2
假设: 1> 本机有grub , 将 iso 中isolinux中的 boot.cat grub.conf isolinux.bin vmlinuz
boot.msg initrd.img isolinux.cfg splash.jpg vesamenu.c32 拷贝到 本机的/boot中
2> 将centos 6.2的光盘复制到 http服务下例如 /var/www/html 下面,将光盘的iso也复制到这个目录下,有时安装过程可能需要iso中的东西,centos会自动从iso文件中寻找
安装步骤:
1> 进入grub的命令行模式,然后
grub> root (hd0, 0 ) #选择boot所在的分区作为根,根据自己的情况来定
grub> kernel vmlinuz
grub> initrd initrd.img
grub> boot #启动
2> 选择url安装,配置ip神马的就行了
(2) 修改源
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
vim /etc/yum.repos.d/CentOS-Base.repo
- [base]
- name=CentOS-$releasever – Base
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
- baseurl=http://run.hit.edu.cn/centos/$releasever/os/$basearch/
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
- #released updates
- [updates]
- name=CentOS-$releasever – Updates
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
- baseurl=http://run.hit.edu.cn/centos/$releasever/updates/$basearch/
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
- #additional packages that may be useful
- [extras]
- name=CentOS-$releasever – Extras
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
- baseurl=http://run.hit.edu.cn/centos/$releasever/extras/$basearch/
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-$releasever – Plus
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
- baseurl=http://run.hit.edu.cn/centos/$releasever/centosplus/$basearch/
- gpgcheck=1
- enabled=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
- #contrib – packages by Centos Users
- [contrib]
- name=CentOS-$releasever – Contrib
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
- baseurl=http://run.hit.edu.cn/centos/$releasever/contrib/$basearch/
- gpgcheck=1
- enabled=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#yum clean all // 清除缓存
#yum update
#yum install xxx
下载源码包:
wget http://vault.centos.org/6.2/updates/Source/SPackages/kernel-2.6.32-220.7.1.el6.src.rpm
rpm -ivh xx.rpm
cd rpmbuild/SPECS 此rpmbuild是安装后在当前文件夹下的一个文件夹
rpmbuild -bp –target=`uname -m` kernel.spec 此rpmbuild是命令
之后 rpmbuild里有 BUILD,里面就是源代码了
yumdownloaer 的使用。
Ncurses 提供字符终端处理库,包括面板和菜单。
yum install ncurses-devel
yum 中的几个变量
$releasever,发行版的版本,从[main]部分的distroverpkg获取,如果没有,则根据RedHat-release包进行判断。
$arch,cpu体系,如i686,athlon等
$basearch,cpu的基本体系组,如i686和athlon同属i386,alpha和alphaev6同属alpha。
对yum.conf设定完成,我们就可以好好体验yum带来的方便了。
开机自动启动配置文件,一段时间不用都忘了 /etc/rc.local