1. 程式人生 > >測試md格式

測試md格式

yum源

## 7.6 yum更換國內源

**恢復備份:**

```

[[email protected] yum.repos.d]# cp ../yum.repos.d.bak/* .

```

**下載yum源:**

```

[[email protected] yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

```

**改名:**

```

[[email protected] yum.repos.d]# mv CentOS7-Base-163.repo ./CentOS-Base.repo

```

**清除緩存:**

```

[[email protected] yum.repos.d]# yum clean all

```

**重新生成緩存:**

```

[[email protected] yum.repos.d]# yum install zsh

```

***

## 7.7 yum下載rpm包

**安裝擴展源:**

```

[[email protected] ~]# yum install -y epel-release

```

**使用yum下載rpm包:**

**僅下載不安裝:**

```

[[email protected] yum.repos.d]# yum install zsh --downloadonly

```

**查詢rpm包是否安裝:**

```

[[email protected] yum.repos.d]# rpm -q zsh

```

**指定下載路徑:**

```

[[email protected] yum.repos.d]# yum install zsh --downloadonly --downloaddir=/tmp/

```

**將已安裝的軟件下載到指定目錄:**

```

[[email protected] yum.repos.d]# yum reinstall vim-enhanced --downloadonly --downloaddir=/tmp/

```

***

## 7.8 源碼包安裝(上)

> 將源碼包放在 /usr/local/src目錄中


**下載apache:**

```

[[email protected] src]# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.32.tar.gz

```

**解壓:**

```

[[email protected] src]# tar -zxvf httpd-2.2.32.tar.gz

```

**安裝apache:**

```

[[email protected] httpd-2.2.32]# ./configure --prefix=/usr/local/apache2

```

**查看上一條命令運行是否正確:**

```

[[email protected] httpd-2.2.32]# echo $?

1

```

* 非0表示上一條命令運行錯誤

> checking for gcc... no表示gcc編譯器不存在

```

[[email protected] httpd-2.2.32]# make

```

**擴展:**

> 1. 配置yum源優先級 http://www.aminglinux.com/bbs/thread-7168-1-1.html

> 2. 把源碼包打包成rpm包 http://www.linuxidc.com/Linux/2012-09/70096.htm

## 7.9 源碼包安裝(下)

```

[[email protected] httpd-2.2.32]# make install

```


測試md格式