1. 程式人生 > >更換國內yum源、yum下載rpm包

更換國內yum源、yum下載rpm包

五週第二次課(11月14日)
7.6 yum更換國內源

yum install -y epel-release #安裝擴充套件源epel

預設yum源地址,國內有163和搜狐速度比較快

[root@wwlinux701 yum.repos.d]# cat CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 [root@wwlinux701 yum.repos.d]#

7.7 yum下載rpm包

•yum install -y 包名 –downloadonly
• ls /var/cache/yum/x86_64/7/
• yum install -y 包名 –downloadonly –downloaddir=路徑
• yum reinstall -y 包名 –downloadonly –downloaddir=路徑 #已經下過會重新安裝
yum 下載rom包:
yum install libaio-devel –downloadonly –downloaddir=/tmp/
yum reinstall 包名 –downloadonly –downloadddir=/tmp/ #已經安裝過的

7.8/7.9 原始碼包安裝
原始碼包放在:cd /usr/local/src/
•wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.34.tar.gz
• tar zxvf httpd-2.2.32.tar.gz
• cd httpd-2.2.32
• ./configure –prefix=/usr/local/apache2
echo $? #上一條命令非0即有問題
這裡寫圖片描述
• make
• make install
這裡寫圖片描述
• 解除安裝就是刪除安裝的檔案