ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

第四周作业

2022-01-16 16:33:15  阅读:125  来源: 互联网

标签:centos basearch 作业 releasever https yum 四周 com



1、自建yum仓库,分别为网络源和本地源
(1),  在互联网上找到yum源网址,并把版本号和位数改为变量来增加通用性 
        https://mirrors.cloud.tencent.com/centos/$releasever/BaseOS/$basearch/os/
        https://repo.huaweicloud.com/centos/$releasever/BaseOS/$basearch/os/
        https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/ 

(2),  执行rpm -q autofs || yum -y install autofs     
               systemctl enable --now autofs
               ls /misc/cd                                    开启光盘并访问,挂载光盘后才能使用本地yum源

(3),  在/etc/yum.repos.d文件夹下创建一个新的文件夹,并把当前文件夹内的所有文件移动到新建的文件夹内
        mkdir dir                   mv *.repo dir

(4),    在当前目录下创建一个以   任意名字.repo结尾的仓库配置文件 ,  一个repo文件能创建多个仓库  
       vim base.repo 
       [AppStream]                                                            #ID
       name=AppStream                                                   #描述
       baseurl=file:///misc/cd/AppStream                           #地址
                      https://mirrors.cloud.tencent.com/centos/$releasever/BaseOS/$basearch/os/
                      https://repo.huaweicloud.com/centos/$releasever/BaseOS/$basearch/os/
                      https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
       gpgcheck=0                                                               #检测

       [extras]                                                  
       name=extras
       baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
                     https://repo.huaweicloud.com/centos/$releasever/extras/$basearch/os/
                     https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/os/
       gpgcheck=0

       [epel]
       name=EPEL
       baseurl=https://mirrors.cloud.tencent.com/epel/$releasever/Everything/$basearch/
                     https://mirrors.huaweicloud.com/epel/$releasever/Everything/$basearch/
                     https://mirrors.aliyun.com/epel/$releasever/Everything/$basearch/
       gpgcheck=0

注意网址对齐,centos8需要配两个库AppStream和BaseOS,centos7只需要配一个BaseOS

2、编译安装http2.4,实现可以正常访问,并将编译步骤和结果提交。
答: (1)wget https://dlcdn.apache.org//httpd/httpd-2.4.52.tar.gz

        (2)mv httpd-2.4.52.tar.gz /usr/local/src
                 cd /usr/local/src
                 tar xvf httpd-2.4.52.tar.gz        
                 cd httpd-2.4.52
        
        (3)./config.nice --prefix=/apps/http2.4     执行此命令后报错:checking for APR... no
                  yum -y install apr-devel
                  ./config.nice --prefix=/apps/http2.4    继续执行此命令后报错:checking for APR-util... no
                  yum -y install apr-util-devel
                  ./config.nice --prefix=/apps/http2.4    继续执行此命令后报错:checking for pcre-config... false
                  yum -y install pcre-devel
           
           (4)   make                             执行此命令报错:error: /usr/lib/rpm/redhat/redhat-hardened-ld
                  yum provides /usr/lib/rpm/redhat/redhat-hardened-ld
                  yum -y install redhat-rpm-config-125-1.el8.noarch
                  make
           (5)  make install
           (6)  cat INSTALL                  查看帮助文件
                 echo 'PATH=/appshttp2.4/bin/:$PATH' > /etc/profile.d/http2.4.sh
                 . /etc/profile.d/http2.4.sh
                 apachectl start

 

3、利用sed 取出ifconfig命令中本机的IPv4地址
答: ifconfig |sed -nr '2s/.*inet ([0-9.]+)  netmask.*/\1/p'                     注意空格

4、删除/etc/fstab文件中所有以#开头,后面至少跟一个空白字符的行的行首的#和空白字符
答: sed -i '/^#/d' /etc/fstab

5、处理/etc/fstab路径,使用sed命令取出其目录名和基名
答:echo /etc/fstab | sed -nr 's#^(.*)/([^/]+)/?$#\1#p'
       echo /etc/fstab | sed -nr 's#^(.*)/([^/]+)/?$#\2#p'

6、列出ubuntu软件管理工具apt的一些用法(自由总结)
答:apt update                                         索引更新
       apt -y install  xxx                                安装软件 
       apt purge xxx                                     卸载包并卸载配置文件
       apt rvmove xxx                                  卸载包保留配置文件
       apt-file search -x '/sc$'                       开启正则表达式查找以sc结尾的包 (类似centos的yum provides)
       apt show xxx                                      显示包的详细信息

标签:centos,basearch,作业,releasever,https,yum,四周,com
来源: https://blog.csdn.net/know_1/article/details/122524219

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有