8、使用本地光盘制作一个yum源

2021/5/7 7:25:15

本文主要是介绍8、使用本地光盘制作一个yum源,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

8、使用本地光盘制作一个yum源

  • 挂载光盘

  • mount /dev/cdrom /mnt
    在这里插入图片描述

  • 删除yum.repos.d目录下的所有repo文件

  • rm -rf /etc/yum.repos.d/*
    在这里插入图片描述

  • 创建新的文件dvd.repo

  • vim /etc/yum.repos.d/dvd.repo
    在这里插入图片描述

  • 刷新repos缓存生成的缓存

  • yum makecache
    在这里插入图片描述

8.1、利用yum工具下载一个rpm包

8.2、下载一个源码包

在这里插入图片描述

  • 解包阶段
tar zxf httpd-2.4.46.tar.gz
  • 配置阶段(类似于Windows2008的角色服务,安装路径等)
    configure: error: APR not found. Please read the documentation.
    下载路径:http://apr.apache.org/download.cgi
[root@localhost src]# tar -zxf apr-1.7.0.tar.gz
[root@localhost src]# ./configure --prefix=/usr/local/apr
bash: ./configure: 没有那个文件或目录
[root@localhost src]# cd apr-1.7.0
[root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr
  • make
  • make install
    configure: error: APR-util not found. Please read the documentation.
tar -zxf ...
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config

错误:

make[1]: 进入目录“/usr/local/src/apr-util-1.6.1”
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录
 #include <expat.h>
                   ^
编译中断。
make[1]: *** [xml/apr_xml.lo] 错误 1
make[1]: 离开目录“/usr/local/src/apr-util-1.6.1”
make: *** [all-recursive] 错误 1

解决:

yum install -y expat-devel

错误:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
下载安装:
https://www.linuxfromscratch.org/blfs/view/svn/general/pcre.html

错误:
checking for windows.h… no
configure: error: Invalid C++ compiler or C++ compiler flags
安装:yum install -y gcc gcc-c++

在这里插入图片描述
接着安装pcre
./configure
make
make install

安装httpd

[root@localhost ~]# cd /usr/local/src/httpd-2.4.46
[root@localhost httpd-2.4.46]# ./configure --prefix=/usr/local/httpd

妈呀注意配置相关httpd的时候要注意,它依赖于:pcre还有 apr-util

 ./configure --prefix=/usr/local/httpd --with-apr-util=/usr/local/apr-util  --with-pcre=/usr/local/pcre

在这里插入图片描述
终于可以了!
后面就是make&&make install
测试:echo $?
在这里插入图片描述
查看Makefile文件
在这里插入图片描述

进行编译:
make&&make install

查看:

ls /usr/local/httpd

在这里插入图片描述
在这里插入图片描述



这篇关于8、使用本地光盘制作一个yum源的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程