网站首页

金沙4066官网linux中软件包的安装和卸载,如何查询Linux服务的作用

27 6月 , 2019  

服务列表好办,chkconfig –list
就有了,但是他们都是做什么用的,系统中是否用得到,怎么查?

linux中软件包的安装和卸载 rpm,yum的方式,rpmyum

linux中的软件安装有3种方式

rpm包安装,使用rpm工具安装软件包yum工具安装,使用yum命令自动安装软件包源码包安装,下载源码包,编译安装软件

rpm工具的用法

1、查询rpm是否安装:rpm -qa|grep lvm(lvm为要查询的rpm包名)

[[email protected]
~]# rpm -qa|grep lvm

mesa-private-llvm-3.3-0.3.rc3.el6.x86_64

lvm2-libs-2.02.100-8.el6.x86_64

lvm2-2.02.100-8.el6.x86_64

system-config-lvm-1.1.12-16.el6.noarch

2、查询某rpm包含哪些文件:

[[email protected]
~]# rpm -ql lvm2-2.02.100-8.el6.x86_64

/etc/lvm

/etc/lvm/archive

/etc/lvm/backup

/etc/lvm/cache

/etc/lvm/cache/.cache

3、查询某文件属于哪个rpm包:

[[email protected]
~]# rpm -qf /etc/lvm

lvm2-2.02.100-8.el6.x86_64

4、查询某rpm包被哪些包依赖

[[email protected]
~]# rpm -q –whatrequires device-mapper-persistent-data

lvm2-2.02.100-8.el6.x86_64

5、查询某rpm包依赖哪些内容

[[email protected]
~]# rpm -qR lvm2-2.02.100-8.el6.x86_64

/bin/bash

/bin/sh

/bin/sh

bash >= 4.0

chkconfig

chkconfig

config(lvm2) = 2.02.100-8.el6

device-mapper-persistent-data >= 0.2.8-2

libc.so.6()(64bit)

libc.so.6(GLIBC_2.2.5)(64bit)

libc.so.6(GLIBC_2.3)(64bit)

libc.so.6(GLIBC_2.3.4)(64bit)

libc.so.6(GLIBC_2.4)(64bit)

libdevmapper-event.so.1.02()(64bit)

libdevmapper-event.so.1.02(Base)(64bit)

6、查询rpm包的相关信息

[[email protected]
~]# rpm -qi lvm2-2.02.100-8.el6.x86_64

Name : lvm2 Relocations: (not relocatable)

Version : 2.02.100 Vendor: Red Hat, Inc.

Release : 8.el6 Build Date: Wed 30 Oct 2013 04:10:56 PM HKT

Install Date: Tue 07 Mar 2017 11:36:37 PM HKT Build Host:
x86-028.build.eng.bos.redhat.com

Group : System Environment/Base Source RPM: lvm2-2.02.100-8.el6.src.rpm

Size : 1561629 License: GPLv2

Signature : RSA/8, Wed 30 Oct 2013 09:42:09 PM HKT, Key ID
199e2f91fd431d51

Packager : Red Hat, Inc.

URL :

Summary : Userland logical volume management tools

Description :

LVM2 includes all of the support for handling read/write operations on

physical volumes (hard disks, RAID-Systems, magneto optical, etc.,

multiple devices (MD), see mdadd(8) or even loop devices, see

losetup(8)), creating volume groups (kind of virtual disks) from one

or more physical volumes and creating one or more logical volumes

(kind of logical partitions) in volume groups.

7、查看一个已经安装软件的文档安装位置

[[email protected]
~]# rpm -qd lvm2-2.02.100-8.el6.x86_64

/usr/share/doc/lvm2-2.02.100/COPYING

/usr/share/doc/lvm2-2.02.100/COPYING.LIB

/usr/share/doc/lvm2-2.02.100/INSTALL

/usr/share/doc/lvm2-2.02.100/README

/usr/share/doc/lvm2-2.02.100/VERSION

/usr/share/doc/lvm2-2.02.100/WHATS_NEW

/usr/share/man/man5/lvm.conf.5.gz

/usr/share/man/man8/blkdeactivate.8.gz

/usr/share/man/man8/fsadm.8.gz

/usr/share/man/man8/lvchange.8.gz

/usr/share/man/man8/lvconvert.8.gz

/usr/share/man/man8/lvcreate.8.gz

8、安装rpm

rpm -ivh xxx.rpm(该rpm包本地存在)

9、卸载rpm

rpm -e xxx.rpm

yum工具的用法

1、yum的基础命令

yum list #列出所有可用的软件包

yum install #安装软件包

yum grouplist #列出所有的软件组

yum groupinstall #安装软件组

yum remove #卸载软件

yum update #升级软件,如果不加包名会将系统所有的软件升级,包括系统

yum provides “/*/vim” #通过vim命令搜索软件包

2.yum源的配置文件

[[email protected]
~]# ls /etc/yum.repos.d/ #这个目录下存放yum的配置文件

CentOS-Base.repoCentOS-Debuginfo.repoCentOS-Media.repoCentOS-Vault.repo

CentOS-CR.repoCentOS-fasttrack.repoCentOS-Sources.repo

3.yum search搜索软件包

[[email protected]
~]# yum search vim #搜索和vim相关的软件包

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

* base:mirrors.zju.edu.cn

* extras:mirrors.zju.edu.cn

* updates:mirrors.zju.edu.cn

1、man 服务名

===================================== N/S matched: vim

protobuf-vim.x86_64 : Vim syntax highlighting for Google Protocol
Buffers descriptions

vim-X11.x86_64 : The VIM version of the vi editor for the X Window
System

vim-common.x86_64 : The common files needed by any version of the VIM
editor

vim-enhanced.x86_64 : A version of the VIM editor which includes recent
enhancements

vim-filesystem.x86_64 : VIM filesystem layout

vim-minimal.x86_64 : A minimal version of the VIM editor

名称和简介匹配 only,使用“search all”试试。

4.yum list |grep 搜索软件包,更加精确

[[email protected]
~]# yum list|grep vim

vim-common.x86_642:[email protected]

vim-enhanced.x86_642:[email protected]

vim-filesystem.x86_642:[email protected]

vim-minimal.x86_642:[email protected]

protobuf-vim.x86_642.5.0-8.el7base

vim-X11.x86_642:7.4.160-2.el7base

yum搭建本地仓库

  1. 挂载光驱到mnt目录下

  2. 先将yum的配置文件做一个备份cp -r /etc/yum.repos.d/
    /etc/yum.repos.d.bak/

3.
进入yum.repos.d目录下,将所有的文件都删除掉[[email protected]
~]# cd /etc/yum.repos.d #进入yum.repos.d
目录[[email protected]
yum.repos.d]#
lsCentOS-Base.repoCentOS-Debuginfo.repoCentOS-Media.repoCentOS-Vault.repoCentOS-CR.repoCentOS-fasttrack.repoCentOS-Sources.repo[[email protected]
yum.repos.d]# rm -rf ./* #删除所有的文件

4.
创建一个文件dev.repo[[email protected]
yum.repos.d]# vim dev.repo

#将以下内容写进dev.repo:[dvd] #仓库的名字name=install dvd
#自定义一个描述的字符串baseurl=file:///mnt #rpm的位置enable=1
#是否可用gpcheck=0 #是否检测

5.将之前的yum缓存清除,yum clean
all[[email protected]
yum.repos.d]# yum clean all

  1. 这时就可以使用yum安装本地的软件包

rpm,yum的方式,rpmyum
linux中的软件安装有3种方式
rpm包安装,使用rpm工具安装软件包yum工具安装,使用yum命令自…

最广泛使用的查询方式man

比如

# man abrtd

ABRTD(8)                          ABRT Manual                       
ABRTD(8)

NAME

      abrtd – automated bug reporting tool麓s daemon.

SYNOPSIS

      abrtd [-dsv[v]…]

DESCRIPTION

      abrtd is a daemon that watches for application crashes. When a
crash

      occurs, it collects the problem data (core file, application鈥檚
command

      line etc.) and takes action according to the type of application
that

      crashed and according to the configuration in the abrt.conf config

      file. There are plugins for various actions: for example to report
the

      crash to Bugzilla, to mail the report, or to transfer the report
via

      FTP or SCP. See the manual pages for the respective plugins.

2、rpm -qi

当然,也会有一些服务通过man查询不到, 比如 blk-availability 、
abrt-ccpp。

我们可以通过启动脚本对应的rpm包来查询,知道这个rpm包的作用,也就知道这个服务的作用了。

rpm -qi `rpm -qf /etc/rc.d/init.d/服务名` # 注意是反引号

看Description部分,一般就是这个rpm包的作用了,至少能看出来和哪些功能相关。

[root@localhost ~]# rpm -qi `rpm -qf
/etc/rc.d/init.d/blk-availability`

Name        : lvm2                        Relocations: (not relocatable)

Version    : 2.02.98                          Vendor:
CentOS

Release    : 9.el6                        Build Date: Fri 22 Feb 2013
02:21:40 PM CST

Install Date: Wed 19 Mar 2014 05:06:26 PM CST      Build Host:
c6b8.bsys.dev.centos.org

Group      : System Environment/Base      Source RPM:
lvm2-2.02.98-9.el6.src.rpm

Size        : 1417702                          License: GPLv2

Signature  : RSA/SHA1, Sun 24 Feb 2013 01:39:56 AM CST, Key ID
0946fca2c105b9de

Packager    : CentOS BuildSystem <>

URL        :

Summary    : Userland logical volume management tools

Description :

LVM2 includes all of the support for handling read/write operations on

physical volumes (hard disks, RAID-Systems, magneto optical, etc.,

multiple devices (MD), see mdadd(8) or even loop devices, see

losetup(8)), creating volume groups (kind of virtual disks) from one

or more physical volumes and creating one or more logical volumes

(kind of logical partitions) in volume groups.

金沙4066官网 1


相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图