linux软件管理

一.简介:RPM(原Red Hat Package Manager,现在是一个递归缩写)由 Red Hat 公司提出,被众多 Linux 发行版所采用
也称二进制( binary code)无需编译,可以直接使用。无法设定个人设置,开关功能。软件包示例(注意后缀):mysql-community-common-5.7.12-1.el7.x86_64.rpm
源码包:source code 需要经过GCC,C++编译环境编译才能运行。可以设定个人设置,开关功能。软件包示例:nginx-1.8.1.tar.gz nginx 包名 -1.8.1 版本号 .tar.gz 压缩格
二.RPM包管理
1.YUM工具
简介:Yum(全称为 Yellow dog Updater, Modified) 是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。
基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。
配置YUM仓库/YUM源
1.1本地源:系统安装光盘
1.2.网络源:使用官方源
前提:联网 设置虚拟机网络为NAT
在这里插入图片描述打开Linux网络设置

在这里插入图片描述打开浏览器上网测试
在这里插入图片描述目的:使用国内厂商提供的软件包地址(如:http://alibaba.com/.sadflsdjfjsdalkfdsa)作为YUM的仓库。
阿里云:Base/Extras/Updates: 默认(国外源)
1 清理原先YUM库
yum install wget
mv /etc/yum.repos.d/* /tmp
2 下载阿里源至yum库
wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
3 更新YUM源
yum repolist
yum makecache
EPEL:下载epel配置文件
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
重建缓存:[root@localhost ~]# yum makecache
Nginx:(配置文件):网站
在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述验证在这里插入图片描述``[root@localhost ~]# yum list | grep nginx
collectd-nginx.x86_64 5.8.1-1.el7 epel
munin-nginx.noarch 2.0.63-1.el7 epel
nextcloud-nginx.noarch 10.0.4-2.el7 epel
nginx.x86_64 1:1.18.0-1.el7.ngx nginx-stable
nginx-all-modules.noarch 1:1.16.1-1.el7 epel
nginx-debug.x86_64 1:1.8.0-1.el7.ngx nginx-stable
nginx-debuginfo.x86_64 1:1.18.0-1.el7.ngx nginx-stable
nginx-filesystem.noarch 1:1.16.1-1.el7 epel
nginx-mod-http-image-filter.x86_64 1:1.16.1-1.el7 epel
nginx-mod-http-perl.x86_64 1:1.16.1-1.el7 epel
nginx-mod-http-xslt-filter.x86_64 1:1.16.1-1.el7 epel
nginx-mod-mail.x86_64 1:1.16.1-1.el7 epel
nginx-mod-stream.x86_64 1:1.16.1-1.el7 epel
nginx-module-geoip.x86_64 1:1.18.0-1.el7.ngx nginx-stable
nginx-module-geoip-debuginfo.x86_64 1:1.18.0-1.el7.ngx nginx-stable
nginx-module-image-filter.x86_64 1:1.18.0-1.el7.ngx nginx-stable
nginx-module-image-filter-debuginfo.x86_64
1:1.18.0-1.el7.ngx nginx-stable
nginx-module-njs.x86_64 1:1.18.0.0.4.2-1.el7.ngx nginx-stable
nginx-module-njs-debuginfo.x86_64 1:1.18.0.0.4.2-1.el7.ngx nginx-stable
nginx-module-perl.x86_64 1:1.18.0-1.el7.ngx nginx-stable
nginx-module-perl-debuginfo.x86_64 1:1.18.0-1.el7.ngx nginx-stable
nginx-module-xslt.x86_64 1:1.18.0-1.el7.ngx nginx-stable
nginx-module-xslt-debuginfo.x86_64 1:1.18.0-1.el7.ngx nginx-stable
nginx-nr-agent.noarch 2.0.0-12.el7.ngx nginx-stable
owncloud-nginx.noarch 9.1.5-1.el7 epel
pagure-web-nginx.noarch 5.10.0-11.el7 epel
pcp-pmda-nginx.x86_64 4.3.2-7.el7_8 updates
python2-certbot-nginx.noarch 1.6.0-1.el7 epel
sympa-nginx.x86_64 6.2.56-1.el7 epel
提示:
系统的更新和升级,可以使用基础源(aliyun,163)。
软件的使用建议使用官方源(nginx.com/mysql.com)
3.使用YUM管理RPM包
安装:全新安装 yum -y install 安装包
systemctl start 启动命令
systemctl stop firewalld 关闭防火墙
重新安装 yum -y reinstall
升级安装 yum -y update
yum repolist 查询YUM源

查询HTTP程序 yum list httpd 带@ 是已经安装的。
yum -y remove 卸载程序
查询工具和软件包的关系
yum provides
三.RPM工具
1.管理红帽系统/centos系统,rpm包的基本工具
2.YUM功能相同
3.优点不需要配置,直接使用
4.无法解决依赖关系
5.无法自行下载软件包
安装:找到安装包挂载 mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
检查软件包是否存在
cd /mnt/cdrom/Packages
在这里插入图片描述查询
rpm -q wget
卸载:rpm -e wget
资源包管理:官方网站,可以获得最新的软件包
实战案例: 下载tengine
在这里插入图片描述部署Tengine :下载源码包的命令 [root@localhost ~]# wget http://tengine.taobao.org/download/tengine-2.3.2.tar.gz
准备编译环境如编译器[root@localhost ~]# yum -y install gcc make zlib-devel pcre pcre-devel openssl-devel
解压:[root@localhost ~]# useradd www [root@localhost ~]# tar xvf tengine-2.3.2.tar.gz [root@localhost ~]# cd tengine-2.3.2
配置:[root@localhost tengine-2.3.2]#./configure --user=www --group=www --prefix=/usr/local/nginx
编译 make 安装 make install
启动测试:[root@localhost tengine-2.3.2]# /usr/local/nginx/sbin/nginx
systemctl stop firewalld 关闭防火墙
使用浏览器访问本机的IP,如果能看到NGINX的网页,说明部署成功。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值