Linux下如何查看使用YUM安装过的包的安装路径呢? 在搞清楚这个问题前,我们先来了解一下YUM。 YUM(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,避免了手动安装的麻烦(寻找资源、下载;放到指定目录安装;处理依赖关系并下载依赖关系的包进行安装)。所以用yum安装,实质上是用RPM安装,所以RPM查询信息的指令都可用。

如果使用RPM安装了一些包,一般来说,RPM默认安装路径如下:

Directory

Contents of Directory

/etc

一些配置文件的目录,例如/etc/init.d/mysql

/usr/bin

一些可执行文件

/usr/lib

一些程序使用的动态函数库

/usr/share/doc

一些基本的软件使用手册与帮助文档

/usr/share/man

一些man page文件

以MySQL的安装为例,我们使用RPM方式安装了MySQL的两个包,其实rpm有两个参数-l和-c可以帮助我们查看具体的安装路径。

-l 显示软件包中的文件列表

-c 显示配置文件列表

那么我们可以使用“rpm -ql  包名”来查看具体的安装路径。如下所示:

[root@DB-Server ~]# rpm -qa | grep -i mysql

MySQL-server-advanced-5.6.20-1.rhel5

MySQL-client-advanced-5.6.20-1.rhel5

[root@DB-Server ~]# rpm -ql MySQL-client-advanced-5.6.20-1.rhel5

/usr/bin/msql2mysql

/usr/bin/mysql

/usr/bin/mysql_config_editor

/usr/bin/mysql_find_rows

/usr/bin/mysql_waitpid

/usr/bin/mysqlaccess

/usr/bin/mysqlaccess.conf

/usr/bin/mysqladmin

/usr/bin/mysqlbinlog

/usr/bin/mysqlcheck

/usr/bin/mysqldump

/usr/bin/mysqlimport

/usr/bin/mysqlshow

/usr/bin/mysqlslap

/usr/share/man/man1/msql2mysql.1.gz

/usr/share/man/man1/mysql.1.gz

/usr/share/man/man1/mysql_config_editor.1.gz

/usr/share/man/man1/mysql_find_rows.1.gz

/usr/share/man/man1/mysql_waitpid.1.gz

/usr/share/man/man1/mysqlaccess.1.gz

/usr/share/man/man1/mysqladmin.1.gz

/usr/share/man/man1/mysqlbinlog.1.gz

/usr/share/man/man1/mysqlcheck.1.gz

/usr/share/man/man1/mysqldump.1.gz

/usr/share/man/man1/mysqlimport.1.gz

/usr/share/man/man1/mysqlshow.1.gz

/usr/share/man/man1/mysqlslap.1.gz

[root@DB-Server tmp]# rpm -ql MySQL-server-advanced-5.6.20-1.rhel5

/etc/init.d/mysql

/etc/logrotate.d/mysql

/etc/my.cnf

/usr/bin/innochecksum

/usr/bin/my_print_defaults

/usr/bin/myisam_ftdump

/usr/bin/myisamchk

/usr/bin/myisamlog

/usr/bin/myisampack

/usr/bin/mysql_convert_table_format

/usr/bin/mysql_fix_extensions

/usr/bin/mysql_install_db

/usr/bin/mysql_plugin

/usr/bin/mysql_secure_installation

/usr/bin/mysql_tzinfo_to_sql

/usr/bin/mysql_upgrade

/usr/bin/mysql_zap

/usr/bin/mysqlbug

/usr/bin/mysqld_multi

/usr/bin/mysqld_safe

/usr/bin/mysqldumpslow

/usr/bin/mysqlhotcopy

/usr/bin/mysqltest

.....................................................

[root@DB-Server ~]# rpm -qc MySQL-server-advanced-5.6.20-1.rhel5

 

/etc/logrotate.d/mysql

 

/etc/my.cnf

 

[root@DB-Server ~]# 

在MySQL的官方文档,你可以看到RPM包所在的安装目录。我们使用rpm -ql 对比验证了一下,基本都OK,但是很奇怪的是,在上面这个版本中,我没有找到/etc/my.cnf,而是/usr/my.cnf

MySQL 5.6

Directory

Contents of Directory

/usr/bin

Client programs and scripts

/usr/sbin

The mysqld server

/var/lib/mysql

Log files, databases

/var/lib/mysql-files

Value of secure_file_priv

/usr/share/info

MySQL manual in Info format

/usr/share/man

Unix manual pages

/usr/include/mysql

Include (header) files

/usr/lib/mysql

Libraries

/usr/share/mysql

Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation

/usr/share/sql-bench

Benchmarks

MySQL 5.7

Files or Resources

Location

Client programs and scripts

/usr/bin

mysqld server

/usr/sbin

Configuration file

/etc/my.cnf

Data directory

/var/lib/mysql

Error log file

For RHEL, Oracle Linux, CentOS or Fedora platforms: /var/log/mysqld.log

For SLES: /var/log/mysql/mysqld.log

Value of secure_file_priv

/var/lib/mysql-files

System V init script

For RHEL, Oracle Linux, CentOS or Fedora platforms: /etc/init.d/mysqld

For SLES: /etc/init.d/mysql

Systemd service

For RHEL, Oracle Linux, CentOS or Fedora platforms: mysqld

For SLES: mysql

Pid file

/var/run/mysql/mysqld.pid

Socket

/var/lib/mysql/mysql.sock

Keyring directory

/var/lib/mysql-keyring

Unix manual pages

/usr/share/man

Include (header) files

/usr/include/mysql

Libraries

/usr/lib/mysql

Miscellaneous support files (for example, error messages, and character set files)

/usr/share/mysql

另外一台测试服务器,使用yum安装了mysql-community-server-5.7.18,测试验证发现又是正常。 暂时不清楚这个细节问题。

Linux如何查看YUM的安装目录的更多相关文章

  1. Linux下查看MySQL的安装路径

    Linux下查看mysql.apache是否安装,并卸载. 指令 ps -ef|grep mysql 得出结果 root               ?        :: /bin/sh /usr/ ...

  2. 查看yum已安装的包

    在linux下如何使用yum查看安装了哪些软件包 列出所有已安装的软件包 yum list installed yum针对软件包操作常用命令: 1.使用 yum 查找软件包 命令:yum search ...

  3. 怎么查看mysql的安装目录,环境:windows+mysql+navicat

    怎么查看mysql的安装目录 如果忘记了MySQL的安装目录,怎么快速找到呢?方法或许很多,作者觉得这种最方便了 环境:windows+mysql+navicat 方法:进入mysql命令行输入:sh ...

  4. windows如何查看jdk的安装目录

    1.检查电脑上是否安装了JDK可以在cmd窗口输入java -version查看是否需安装了JDK 2.查看JDK的安装目录 一种是在cmd窗口输入java -verbose,查看最后一行即为JDK安 ...

  5. Linux 下使用yum 命令安装MySQL

    Linux下使用yum安装MySQL,以及启动.登录和远程访问MySQL数据库. 1.yum安装mysql 1. 查看有没有安装包:   yum list mysql*    #移除已经安装的mysq ...

  6. Linux图片查看软件ImageMagick安装

    在Linux中查看图片,这个需求是非常常见的.总不至于在集群中生成个图片,随便看下效果,也要用filezilla.winscp之类的远程文件传输工具导过来导过去吧,这样效率太低. Linux图片查看常 ...

  7. ch1:python3 查看版本号、安装目录和工作空间目录

    查看python版本: 每次打开python顶端会显示版本号 在程序中判断版本号可以通过import sys  sys.version 在dos下可以通过python -V查看 安装目录:C:\Pyt ...

  8. Linux系统——本地yum仓库安装

    一.yum仓库概述 yum是基于rpm包管理,能够从指定的服务器自动下载rpm包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无需繁琐地一次次下载.安装. 二.yum仓库安装的方式 ...

  9. 怎么查看mysql的安装目录

    如果忘记了MySQL的安装目录,怎么快速找到呢?方法或许很多,作者觉得这种最方便了 环境:windows+mysql+navicat 方法:进入mysql命令行输入:show variables li ...

随机推荐

  1. 《JavaScript总结》深拷贝和浅拷贝

    在javascript中,数据主要分基本类型和引用类型两种. 基本类型的赋值比较简单,但是引用类型的赋值,会存在一些问题,那我们用代码来分析一下. 一.浅拷贝 var one = "测试1& ...

  2. SpringContextHolder 静态持有SpringContext的引用

    import java.util.Map; import org.springframework.context.ApplicationContext; import org.springframew ...

  3. .Net和C#介绍

    一.前言 本文主要针对刚入门以及还需要对基础进行恶补一下的兄弟进行基础介绍,并尽可能的做到客观,如有错误也虚心接受高手门的纠正. 二..Net平台简介 .net即DotNet,首先我先给出微软的定义: ...

  4. [机器学习]回归--Polinomial Regression 多项式回归

    首先我们需要明确一个概念,我们讨论的线性或者非线性针对的是自变量的系数,而非自变量本身,所以这样的话不管自变量如何变化,自变量的系数如果符合线性我们就说这是线性的.所以这里我们也就可以描述一下多项式线 ...

  5. ZAB协议简介

    Zookeeper 使用 Zookeeper Atomic Broadcast (ZAB) 协议来保障分布式数据一致性. ZAB是一种支持崩溃恢复的消息广播协议,采用类似2PC的广播模式保证正常运行时 ...

  6. Perl:undef类型和defined()函数

    undef和defined()函数 undef表示的像是数据库中的"null".它表示空,啥也没有,是完全未定义的.这不等于字符串的空,不等于数值0,它是另一种类型. 在某些时候, ...

  7. java实现带空格字符串的倒序输出

    import org.junit.Test; public class StringtoChar { @Test public void main(){ String str ="hello ...

  8. 在go modules中使用replace替换无法直接获取的package(golang.org/x/...)

    上一篇里我们介绍了使用go get进行包管理. 不过因为某些未知原因,并不是所有的包都能直接用go get获取到,这时我们就需要使用go modules的replace功能了.(当然大部分问题挂个梯子 ...

  9. [转]C# serialPort 串口接收中this.Invoke的使用

    本文转自:https://blog.csdn.net/hjk216/article/details/72677596 转载地址:http://www.ciast.net/post/20160752.h ...

  10. C#实现放大镜

    winform实现一个跟随鼠标移动放大功能 实现步骤: 1.创建一个Form1,一个计时器timer1和一个图片显示控件pictureBox1 2.核心代码 ;//倍率,调节放大倍数,可由TrackB ...