yum使用本地光盘作为软件仓库,让它自动的检测依赖关系,并且自动安装依赖的包
1.挂载光驱
#mount /dev/cdrom /mnt 2.备份原来软件仓库配置文件 #cp -a /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.bak 3.编辑原来软件仓库的配置文件 #vim /etc/yum.repos.d/rhel-debuginfo.repo [rhel-debuginfo] name=Red Hat Enterprise Linux //名字随意 baseurl=file:///mnt/Server //软件存放的位置file://打头 enabled=1 //开启文件的位置 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 4.使用yum安装软件 #yum instal mysql-server 5.yum的图像软件 #yum install yumex.noarch 安装完成后在图形界面上使用命令yumex调出yum的程序
tar.gz tar.bz2
#tar -xzvf(xjvf) xxxx.tar.gz #chmod 777 ./xxxx #cd xxxx #./configure //检查软件的运行环境 #make //运行mak脚本,制作一个软件安装文件 #make install //运行make install开始安装软件
有些软件包是以.src.rpm结尾的,这类软件包是包含了源代码的rpm包,在安装时需要进行编译。这类软件包有两种安装方法:
方法一:
1. 执行rpm -ivh your-package.src.rpm
2. cd /usr/src/redhat/SPECS
3. rpmbuild -bp your-package.specs 一个和你的软件包同名的specs文件
4. cd /usr/src/redhat/BUILD/your-package/ 一个和你的软件包同名的目录
5. ./configure 这一步和编译普通的源码软件一样,可以加上参数
6. make
7. make install
方法二:
1. 执行rpm -i you-package.src.rpm
2. cd /usr/src/redhat/SPECS (前两步和方法一相同)
3. rpmbuild -bb your-package.specs 一个和你的软件包同名的specs文件
这时,在/usr/src/redhat/RPM/i386/ (根据具体包的不同,也可能是i686,noarch等等) 在这个目录下,有一个新的rpm包,这个是编译好的二进制文件。执行:
rpm -i new-package.rpm即可安装完成。