软件包管理

查找/var 目录下不属于root、lp、gdm的所有文件

find /var ! \( -user root -o -user lp -o -user gdm \)

统计/etc/init.d/functions文件中每个单词的出现次数,并排序

egrep -o "\<[[:alpha:]]+\>" /etc/init.d/functions|sort|uniq -c|sort -n
sed -r 's/[^[:alpha:]]+/\n/g' /etc/init.d/functions |sort |uniq -c |sort -n

利用sed取出ifconfig命令中本机IPV4地址

[root@localhost ~]# ifconfig|grep 'inet '|sed -n '1p'|sed 's/^.*inet //g'|sed 's/ *netmask.*$//g'
192.168.88.160

yum

yum list            #列出可安装软件
yum install         #安装软件
yum update          #更新软件
yum remove          #删除软件
yum info            #查看软件包信息
yum clean all      #清除缓存
 

创建yum仓库

[Based]                                     #yum的ID,必须唯一
name=CentOS-$releasever - Base              #描述信息
baseurl=https://mirrors.aliyun.com/centos/7.3.1611/         #镜像服务器地址
gpgcheck=0                                                  #取消验证                
#--enablerepo=[repo]        激活一个或多个仓库(支持通配符)
#--disablerepo=[repo]       禁掉一个或多个仓库(支持通配符) 

安装软件包

yum -y install tree ftp lftp telnet

编写系统初始化脚本

[root@localhost ~]#vi reset.sh
#!/bin/bash
#
#****************************************************************************************
#Author          :                              Tery.xu
#QQ              :                              937543378
#Date            :                              2019-04-15
#FileName        :                              reset.sh
#URL             :                              https://www.jianshu.com/u/4ad081c39248
#Description     :                              The test script
#Copyright (C)   :                              2019  All rights reserved
#****************************************************************************************
echo "PS1='\[\e[1;32m\][\u@\h \w]\\$\[\e[0m\]' " >> /root/\.bashrc
echo "[Based]\n                                    
name=CentOS-$releasever - Base\n              
baseurl=https://mirrors.aliyun.com/centos/7.3.1611/\n        
gpgcheck=0\n" >> /etc/yum.repo.d/Based.repo
yum repolist
echo "vi=vim" >>/root/\.bashrc  

源码编译Apache

[root@localhost ~]#yum grouplist
[root@localhost ~]#yum -y groupinstall Development Tools
[root@localhost ~]#rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring httpd-2.4.25.tar.bz2...
  100%    6248 KB    6248 KB/sec    00:00:01       0 Errors  
[root@localhost ~]#ls
 httpd-2.4.25.tar.bz2
 [root@localhost ~]#tar xvf httpd-2.4.25.tar.bz2 
 [root@localhost ~]#cd httpd-2.4.25/
 [root@localhost ~/httpd-2.4.25]#rpm -q httpd 
httpd-2.4.6-88.el7.centos.x86_64
[root@localhost ~/httpd-2.4.25]#yum -y remove httpd
[root@localhost ~/httpd-2.4.25]#./configure 
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... no
configure: error: APR not found.  Please read the documentation.
[root@localhost ~/httpd-2.4.25]#yum -y install apr-devel
[root@localhost ~/httpd-2.4.25]#yum -y install apr-util-devel
[root@localhost ~/httpd-2.4.25]#yum -y install pcre-devel
[root@localhost ~/httpd-2.4.25]#./configure
[root@localhost ~/httpd-2.4.25]#make
[root@localhost ~/httpd-2.4.25]#make install
[root@localhost ~/httpd-2.4.25]#apachectl start
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 软件包基础 包管理器 二进制应用程序的组成部分:二进制文件,库文件,配置文件,帮助文件 程序包管理器 debian...
    毛利卷卷发阅读 5,042评论 0 2
  • 目录:软件运行环境介绍包管理器rpm 包管理器的使用yum rpm包管理器前端工具的使用编译安装 一、软件运行环境...
    哈喽别样阅读 3,696评论 0 0
  • 1 软件包分类 1、源码包 《c语言的源代码》 脚本安装包 二进制包(RPM包、系统默认包) 《 01的机器语言...
    yeying12321阅读 3,772评论 0 1
  • 第一节 软件包管理简介 1.软件包分类 1)源码包 脚本安装包 2)二进制包 系统默认包,对于redhat系列是r...
    littlexjing阅读 3,375评论 0 0
  • RPM包管理器 二进制应用程序的组成部分:二进制文件、库文件、配置文件、帮助文件 包命名: 库文件: 管理及查看本...
    JevonWei阅读 1,837评论 0 0

友情链接更多精彩内容