Linux(Centos 7.6)软件包安装

Python3.8

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

 Linux软件安装,常见的有三种方式,rpm方式yum方式源码编译安装方式。其中rpm方式可能存在依赖方式,可能会比较麻烦;源码编译安装同样可能会缺少一些编译需要的软件需要安装,也会比较麻烦;相对比较好的方式是yum方式,只要源仓库软件包齐全,安装时,缺少的依赖,会自动进行安装,简单方便。推荐使用yum方式

注:除以上三种方式外,也有其他的一些安装方式,比如有一些应用软件,解压安装包后,里面可能有install的shell脚本或者python脚本,执行这些脚本进行安装。

1.rpm方式安装

1.1.rpm软件包下载上传

1.双击iso文件,使用DVD驱动器加载iso文件,Packages目录下找httpd的软件包。

注:也可以去网络上找对应Linux系统版本的rpm包

2.左上角的搜索框,填写httpd-搜索,找到httpd-后紧接版本号的文件,鼠标选中推出到本地。

3.通过SFTP协议工具(如Xftp)上传httpd软件包,上传到Downloads目录。

[root@localhost ~]# cd Downloads/
[root@localhost Downloads]# ll
total 2780
-rw-r--r--. 1 root root 2844028 Dec 24 16:18 httpd-2.4.6-88.el7.centos.x86_64.rpm
[root@localhost Downloads]# 

 1.2.rpm方式安装软件包

1.rpm方式安装软件包,可能会出现如下情况,错误信息提示:Failed dependencies(错误的依赖),代表安装httpd需要提前安装httpd-tools、libapr-1.so.0相关的软件包、libaprutil-1.so.0相关软件包。

注:这里需要注意,httpd-tools是明确直到缺少什么软件包,可以去镜像或者网络上下载;但是下面两个提示有一些是无法确认具体缺什么,只能找apr相关的软件包,安装后再安装httpd服务,软件包的查找、下载、上传、安装、确认等步骤都很麻烦。像这类软件依赖多的情况,建议使用yum方式安装。

[root@localhost Downloads]# rpm -ivh httpd-2.4.6-88.el7.centos.x86_64.rpm 
error: Failed dependencies:
	/etc/mime.types is needed by httpd-2.4.6-88.el7.centos.x86_64
	httpd-tools = 2.4.6-88.el7.centos is needed by httpd-2.4.6-88.el7.centos.x86_64
	libapr-1.so.0()(64bit) is needed by httpd-2.4.6-88.el7.centos.x86_64
	libaprutil-1.so.0()(64bit) is needed by httpd-2.4.6-88.el7.centos.x86_64

2.部分简单的软件是可以直接使用rpm方式安装的;如free软件包,上传free软件包,直接使用rpm -ivh 软件包文件的名称即可安装,提示already installed即安装完成。

rpm -ivh中,i代表install(安装),v代表verbose(详细信息),h代表hash(打印散列标记)

[root@localhost Downloads]# ll
total 2828
-rw-r--r--. 1 root root 2844028 Dec 24 16:18 httpd-2.4.6-88.el7.centos.x86_64.rpm
-rw-r--r--. 1 root root   47508 Dec 24 16:39 tree-1.6.0-10.el7.x86_64.rpm
[root@localhost Downloads]# rpm -ivh tree-1.6.0-10.el7.x86_64.rpm 
Preparing...                          ################################# [100%]
	package tree-1.6.0-10.el7.x86_64 is already installed
[root@localhost Downloads]# rpm -qa | grep tree
tree-1.6.0-10.el7.x86_64
[root@localhost Downloads]# 

2.yum方式安装

2.1.yum源配置

yum详细的配置步骤见Linux(Centos 7.6)yum源配置

2.2.yum源方式安装软件包

yum方式安装,直接执行yum install 软件包名称(不是文件名称,不带版本号);安装过程可以看到具体还需要安装哪些依赖的软件包(依赖软件包包括apr、apr-util、httpd-tools、mailcap),最后看到Complete!提示即安装完成。

[root@localhost Downloads]# yum install httpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-99.el7.centos.1 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-99.el7.centos.1 for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.

您可能感兴趣的与本文相关的镜像

Python3.8

Python3.8

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

豆是浪个

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值