软件包管理

1 RPM

简介

RPM(RedHat Package Manager),是红帽系linux操作系统的软件包管理工具,类似于windows中的setup.exe能够进行软件包的更新、卸载、安装甚至直接从源码包中build一个软件出来。

非红帽系操作系统如Ubuntu的软件包安装管理就是apt,apt get进行软件暗安装

RPM包的名称格式

如Apache-1.3.23-11.i386.rpm,Apache代表软件名称,1.3.23-11代表版本号,i386表示运行环境为intel64位处理器。

基本命令
rpm -qa 查询所有安装的rpm软件包

选项说明

  • -q:查询

  • -a:查询所有的包

  • -i:查询指定的包的详细信息

[root@hadoop100 ~]# rpm -qa | grep redis
redis-3.2.12-2.el7.x86_64
[root@hadoop100 ~]# rpm -qa | grep firefox
firefox-68.10.0-1.el7.centos.x86_64
[root@hadoop100 ~]# rpm -qi firefox
Name : firefox
Version : 68.10.0
Release : 1.el7.centos
Architecture: x86_64
Install Date: Thu 11 Aug 2022 09:06:35 PM PDT
Group : Unspecified
Size : 241030932
License : MPLv1.1 or GPLv2+ or LGPLv2+
Signature : RSA/SHA256, Wed 08 Jul 2020 09:21:14 AM PDT, Key ID 24c6a8a7f4a80eb5
Source RPM : firefox-68.10.0-1.el7.centos.src.rpm
Build Date : Tue 07 Jul 2020 11:51:10 AM PDT
Build Host : x86-01.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : https://www.mozilla.org/firefox/
Summary : Mozilla Firefox Web browser
Description :
Mozilla Firefox is an open-source web browser, designed for standards
compliance, performance and portability.
rpm -e 卸载软件
  • -nodeps:卸载的时候不要考虑安装包之间的依赖关系,直接卸载即可
[root@hadoop100 ~]# rpm -e redis
warning: /etc/redis.conf saved as /etc/redis.conf.rpmsave
rpm-i 安装软件

选项说明

  • -i:安装

  • -v:显示详细信息

  • -h:显示进度条

  • --nodeps:不检查依赖

npm存在的问题
  • 安装必须要有rpm安装包

  • 安装、卸载都需要考虑软件包之间的依赖关系

2 YUM

简介
基本命令

yum [选项][参数]

  • -y:一路yes

  • install:安装rpm软件包

  • update:更新rpm软件包

  • check-update:检查更新

  • remove:删除指定rpm软件包

  • list:显示软件包信息

  • clean:清除过期缓存

  • deplist:显示yum软件包的依赖关系

修改yum源

配置文件

less /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
# [base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

yum会去自动查找IP最近的源,一般情况下不需要修改

想要修改可以先备份一下配置文件,然后使用wget下载repos文件

wget \http://mirrors.ailiyun.com/repo/Centos-7.repo

wget \http://mirrors.163.com/.help/Centos7-Base-163.repo

克隆虚拟机

Linux(四)软件包管理的更多相关文章

  1. Linux的软件包管理

    此博客的环境任意. 主题Linux的软件包管理 一软件管理工具 1编译安装      2rpm包管理          3yum管理 二软件运行和编译 1ABI 应用程序的二进制接口 ABI:Appl ...

  2. linux RPM软件包管理

    linux RPM软件包管理 目录 1.软件包的介绍 2.rpm包管理 3.rpm包管理前端工具 1.软件包的介绍 在我们在对软件包管理前,先对软件包有个很好的了解,这样更方便我们来对其进行管理. 软 ...

  3. 【Linux基础】Linux下软件包管理(rpm-deb-yast-yum)

    软件包管理是指系统中一种安装和维护软件的方法.通常软件以包的形式存储在仓库(repository)中,能满足许多人所有需要的软件. 在GNU/Linux(以下简称Linux)操作系统中,RPM和DPK ...

  4. Linux - rpm 软件包管理

    rpm 是 Red-Hat Package Manager(rpm 软件包管理器)的缩写 rpm 的命名规则: 第一部分为 rpm 软件包的名称,第二部分是版本号,第三部分是版本发布次数,第四部分是软 ...

  5. linux中软件包管理

    一.流行的软件包管理有两种: Debian Linux的Deb软件包和 Redhat Linux的Rpm软件包, Debian Linux首先提出将应用程序的二进制文件.配置文档.man/info帮助 ...

  6. linux系统管理-软件包管理

    概述: inux家族中的软件包管理有很多工具. 一种是在debiton系列的linux中,以像ubuntu的apt-get为代表.对于此种方式的管理方式,个人感觉挺简单方便的, 一种是在Fedora和 ...

  7. Linux学习-软件包管理安装

    rpm RPM是Red-Hat Package Manager(RPM软件包管理器)的缩写 软件包类型 二进制包:已经使用GCC编辑后的 tar源码包:需要编译 rpm包获取方式 1,系统镜像   需 ...

  8. Linux学习 -- 软件包管理

    1 软件包类型 源码包 脚本安装包  install.sh  不常用 二进制包(rpm包.系统默认包) RedHat -- rpm包 Debian,Ubuntu -- beb包 2 RPM包命令管理 ...

  9. linux下软件包管理

    挂载光盘:mkdir /mnt/cdrommount /dev/cdrom  /mnt/cdrom 1.rpm包管理1.安装一个包  rpm –ivh < rpm package name> ...

  10. [Linux] 019 软件包管理简介

    1. 软件包分类 源码包 脚本安装包 二进制包(RPM 包.系统默认包) 2. 源码包 (1)源码包的优点 开源,如果有足够的能力,可以修改源代码 可以自由选择所需的功能 软件是编译安装,所以更加适合 ...

随机推荐

  1. sql server clr json to table

    背景 SQL SERVER 2016 之前版本不支持 直接解析json 步骤: 1 vs 数据库项目 2 生成dll 3 加入信任 DECLARE @hash AS BINARY(64) = (SEL ...

  2. Docker安装一些软件

    1.Docker开始远程访问 vim /lib/systemd/system/docker.service 在ExecStart的值最最后面追加:空格+-H tcp://0.0.0.0:2375 sy ...

  3. C++生成均匀分布的随机实数

    #include<random> #include<iostream> int main() { //定义均匀分布对象,均匀分布区间(a,b)为(2,6) std::unifo ...

  4. 第二节 printf语句和C++中的判断结构

    第二节 printf语句和C++中的判断结构 1.1printf语句作用 保留几位小数:%.4lf 保留四位小数 %.3lf 保留三位小数, 格式化输出:整数:printf("%5d!&qu ...

  5. Anaconda与conda、pip与conda的区别 - 搬运

    Anaconda与conda.pip与conda的区别 风影忍着   转自:https://zhuanlan.zhihu.com/p/379321816     作为一个Python初学者,在请教资深 ...

  6. File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent

    IDEA编译报以下错误 File encoding has not been set, using platform encoding UTF-8, i.e. build is platform de ...

  7. boost编译指定python版本号

    1.执行如下 bootstrap 语句,会在目录下生成 project-config.jam 文件 .\bootstrap --with-python="C:\Users\yzy\Anaco ...

  8. C#的Event事件

    一直不明白事件,今天写了一下,做个笔记吧. 先建一个类,里面有一个方法,返回bool型 public class Subject { public bool IsPass(int x) { Conso ...

  9. Python ArcPy批量拼接长时间序列栅格图像

      本文介绍基于Python中ArcPy模块,对大量不同时相的栅格遥感影像按照其成像时间依次执行批量拼接的方法.   在前期的文章Python arcpy创建栅格.批量拼接栅格中,我们介绍了利用Pyt ...

  10. GPSSworld仿真(一):程序题——单窗口排队系统

    3.3 一个仓库共存放了2000吨货物,货物以三种规模出库,少量(10吨),中等(20吨),大量(50吨),分别以10±5分,15分,30±10分的速率出库.如果没有货位达到的情况下,一个仓库能维持供 ...