Linux下哪些查看使用YUM安装过的包的安装路径呢?
在搞明白这么些题如今,我们先来打探一下YUM。 YUM(全名叫 Yellow dog
Updater,
Modified)是1个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于宝马X3PM包管理,能够从钦赐的服务器自动下载酷威PM包并且安装,能够自行处理信赖性关系,并且一回安装具有依赖的软件包,制止了手动安装的劳动(寻找财富、下载;放到钦定目录安装;处理依赖关系并下载注重关系的包进行设置)。所以用yum安装,实质上是用帕杰罗PM安装,所以LX570PM查询新闻的通令都可用。

Linux怎么样查看YUM的装置目录,linux查看yum

Linux下什么查看使用YUM安装过的包的装置路径呢?
在搞了解这么些难点前,我们先来询问一下YUM。 YUM(全名叫 Yellow dog
Updater,
Modified)是三个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于库罗德PM包管理,能够从钦命的服务器自动下载大切诺基PM包并且安装,能够自动处理依赖性关系,并且一遍安装具有依赖的软件包,防止了手动安装的劳动(寻找能源、下载;放到钦点目录安装;处理正视关系并下载信赖关系的包举行安装)。所以用yum安装,实质上是用PRADOPM安装,所以陆风X8PM查询新闻的一声令下都可用。

 

假诺运用汉兰达PM安装了一些包,一般的话,牧马人PM私下认可安装路径如下:

 

  Directory

Contents of Directory

/etc

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

 

/usr/bin

一些可执行文件

/usr/lib

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

/usr/share/doc

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

/usr/share/man

一些man page文件

 

以MySQL的安装为例,大家选拔奥迪Q5PM情势安装了MySQL的八个包,其实rpm有八个参数-l和-c能够援救大家查阅具体的安装路径。

 

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

-c 显示配置文件列表

 

那就是说我们得以选取“rpm -ql  包名”来查阅具体的设置路径。如下所示:

 

 

 

[[email protected]
~]# rpm -qa | grep -i mysql

MySQL-server-advanced-5.6.20-1.rhel5

MySQL-client-advanced-5.6.20-1.rhel5

[[email protected]
~]# 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

Linux怎样查看YUM的设置目录,Linux平台卸载MySQL计算。/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

 

 

[[email protected]
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

……………………………………………..

 

 

 

[[email protected] ~]# rpm -qc MySQL-server-advanced-5.6.20-1.rhel5

 

/etc/logrotate.d/mysql

 

/etc/my.cnf

 

[[email protected] ~]# 

 

在MySQL的合法文书档案,你能够看到CRUISERPM包所在的装置目录。大家应用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安装过的包的装置路径呢?
在搞精通那几个难点前,大家先来通晓一下YUM。…

在Red
Hat Enterprise Linux Server release 5.7
(Tikanga)上使用LacrossePM情势安装Percona Xtrabackup
2.4.6时蒙受了有的标题,特意计算在此。

怎么着在Linux下卸载MySQL数据库呢?
上面总括、整理了瞬间Linux平台下卸载MySQL的点子。
MySQL的设置首要有二种艺术:二进制包安装(Using Generic
Binaries)、OdysseyPM包安装、源码安装。对应分裂的装置格局,卸载的步调某个分化。作品中如有不足或不规则的地点,敬请提出或补充!

 

 

 

要是运用QX56PM安装了有的包,一般的话,LANDPM默许安装路径如下:

[root@DB-Server
tmp]#yum -y install perl perl-devel libaio libaio-devel
perl-Time-HiRes perl-DBD-MySQL

ENVISIONPM包安装格局的MySQL卸载

 

 

 

  Directory

Contents of Directory

/etc

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

 

/usr/bin

一些可执行文件

/usr/lib

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

/usr/share/doc

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

/usr/share/man

一些man page文件

澳门金沙国际 1

1:
检查是不是安装了MySQL组件。

 

 

[root@DB-Server init.d]# rpm -qa | grep -i mysql

 

MySQL-devel-5.6.23-1.linux_glibc2.5

 

MySQL-client-5.6.23-1.linux_glibc2.5

 

MySQL-server-5.6.23-1.linux_glibc2.5

 

以MySQL的装置为例,大家应用汉兰达PM形式安装了MySQL的四个包,其实rpm有七个参数-l和-c能够帮助大家查阅具体的安装路径。

 

澳门金沙国际 2

 

安装相关注重组件时,境遇conflict
with file的荒唐,如上截图所示,然后安装Percona Xtrabackup
2.4.6是就会遇上上面错误:

如上所示,表明安装了MySQL
5.6.23这一个版本的client、server、devel四个零部件。

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

 

 

-c
显示配置文件列表

[root@DB-Server tmp]# rpm -ivh percona-xtrabackup-24-2.4.6-2.el5.x86_64.rpm 

warning: percona-xtrabackup-24-2.4.6-2.el5.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID cd2efd2a

error: Failed dependencies:

        libev.so.4()(64bit) is needed by percona-xtrabackup-24-2.4.6-2.el5.x86_64

        perl(DBD::mysql) is needed by percona-xtrabackup-24-2.4.6-2.el5.x86_64

2:
卸载前关闭MySQL服务

 

 

 

那就是说我们得以运用“rpm
-ql 
包名”来查阅具体的装置路径。如下所示:

如上所示,既然缺乏组件,那么安装libev.x86_64,
如下所示,本地yum源安装libev.so.4战败,只好从网上下载libev-4.15-1.el5.rf.x86_64.rpm,网址为

2.1 方法1

 

 

[root@DB-Server init.d]# service mysql status

 MySQL running (25673)[  OK  ]

[root@DB-Server init.d]# service mysql stop

 Shutting down MySQL..[  OK  ]

[root@DB-Server init.d]# service mysql status

 MySQL is not running[FAILED]

澳门金沙国际 3

[root@DB-Server tmp]# yum -y install libev.x86_64

Loaded plugins: product-id, security, subscription-manager

Updating Red Hat repositories.

Setting up Install Process

No package libev.x86_64 available.

Nothing to do

 

 

[root@DB-Server tmp]# rpm -ivh libev-4.15-1.el5.rf.x86_64.rpm 

warning: libev-4.15-1.el5.rf.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6

Preparing...                ########################################### [100%]

   1:libev                  ########################################### [100%]

[root@DB-Server tmp]# yum list | grep "perl-DBD-MySQL"

perl-DBD-MySQL.x86_64                      3.0007-2.el5                media   

[root@DB-Server tmp]# yum install perl-DBD-MySQL

澳门金沙国际 4

 

 

 

 

设置
perl-DBD-MySQL时,就会蒙受多量像样上边错误

2.2 方法2

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

 

[root@DB-Server init.d]# ./mysql status

 MySQL running (26215)[  OK  ]

[root@DB-Server init.d]# ./mysql stop

 Shutting down MySQL..[  OK  ]

[root@DB-Server init.d]# ./mysql status

 MySQL is not running[FAILED]

[root@DB-Server init.d]# 

MySQL-server-advanced-5.6.20-1.rhel5

 

澳门金沙国际 5

MySQL-client-advanced-5.6.20-1.rhel5

  file
/usr/bin/msql2mysql from install of mysql-5.0.77-4.el5_6.6.x86_64
conflicts with file from package
MySQL-client-advanced-5.6.20-1.rhel5.x86_64

[root@DB-Server init.d]# chkconfig --list | grep -i mysql

 

mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

 

[root@DB-Server init.d]# 

 

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

  file
/usr/bin/mysql from install of mysql-5.0.77-4.el5_6.6.x86_64 conflicts
with file from package
MySQL-client-advanced-5.6.20-1.rhel5.x86_64

 

/usr/bin/msql2mysql

  file
/usr/bin/mysql_find_rows from install of
mysql-5.0.77-4.el5_6.6.x86_64 conflicts with file from package
MySQL-client-advanced-5.6.20-1.rhel5.x86_64

3.
征集MySQL对应的文件夹音信

/usr/bin/mysql

  file
/usr/bin/mysql_waitpid from install of mysql-5.0.77-4.el5_6.6.x86_64
conflicts with file from package
MySQL-client-advanced-5.6.20-1.rhel5.x86_64

[root@DB-Server
init.d]# whereis mysql

/usr/bin/mysql_config_editor

  file
/usr/bin/mysqlaccess from install of mysql-5.0.77-4.el5_6.6.x86_64
conflicts with file from package
MySQL-client-advanced-5.6.20-1.rhel5.x86_64

mysql: /usr/bin/mysql
/usr/include/mysql /usr/share/mysql
/usr/share/man/man1/mysql.1.gz

/usr/bin/mysql_find_rows

 

最好实用find命令查看MySQL数据库相关的公文,方便前边彻底剔除MySQL。

/usr/bin/mysql_waitpid

澳门金沙国际, 

[root@DB-Server init.d]# find / -name mysql

/etc/rc.d/init.d/mysql

/etc/logrotate.d/mysql

/var/lock/subsys/mysql

/var/lib/mysql

/var/lib/mysql/mysql

/usr/include/mysql

/usr/include/mysql/mysql

/usr/bin/mysql

/usr/share/mysql

/usr/lib64/mysql

/usr/bin/mysqlaccess

遇上那个荒唐是因为尚未安装MySQL-shared-compat组件,安装了MySQL-shared-compat-advanced-5.6.20-1.rhel5.x86_64.rpm后,然后使用yum
install perl-DBD-MySQL就不会遇上conflict with file的荒谬

澳门金沙国际 6

/usr/bin/mysqlaccess.conf

 

 

/usr/bin/mysqladmin

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

MySQL-server-advanced-5.6.20-1.rhel5

MySQL-client-advanced-5.6.20-1.rhel5

[root@DB-Server tmp]# rpm -ivh MySQL-shared-compat-advanced-5.6.20-1.rhel5.x86_64.rpm 

Preparing...                ########################################### [100%]

   1:MySQL-shared-compat-adv########################################### [100%]

[root@DB-Server tmp]# yum install perl-DBD-MySQL

[root@DB-Server tmp]# rpm -ivh percona-xtrabackup-24-2.4.6-2.el5.x86_64.rpm 

warning: percona-xtrabackup-24-2.4.6-2.el5.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID cd2efd2a

Preparing...                ########################################### [100%]

   1:percona-xtrabackup-24  ########################################### [100%]

[root@DB-Server tmp]# 

4:
卸载删除MySQL各种组件

/usr/bin/mysqlbinlog

[root@DB-Server init.d]# 

[root@DB-Server init.d]# rpm -ev MySQL-devel-5.6.23-1.linux_glibc2.5

[root@DB-Server init.d]# rpm -ev MySQL-server-5.6.23-1.linux_glibc2.5

You have new mail in /var/spool/mail/root

[root@DB-Server init.d]# rpm -ev MySQL-client-5.6.23-1.linux_glibc2.5

[root@DB-Server init.d]#

/usr/bin/mysqlcheck

澳门金沙国际 7

/usr/bin/mysqldump

 

/usr/bin/mysqlimport

5:删除MySQL对应的文本夹

/usr/bin/mysqlshow

 

/usr/bin/mysqlslap

反省各样MySQL文件夹是或不是清理删除干净。

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

[root@DB-Server init.d]# whereis mysql

mysql:

[root@DB-Server init.d]# find / -name mysql

/var/lib/mysql

/var/lib/mysql/mysql

/usr/lib64/mysql

[root@DB-Server init.d]# rm -rf /var/lib/mysql

[root@DB-Server init.d]# rm -rf /var/lib/mysql/mysql

[root@DB-Server init.d]# rm -rf /usr/lib64/mysql

[root@DB-Server init.d]# 

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

6:删除mysql用户及用户组

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

一经有需要,删除mysql用户以及mysql用户组。

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

[root@DB-Server ~]# more /etc/passwd | grep mysql

mysql:x:101:501::/home/mysql:/bin/bash

[root@DB-Server ~]# more /etc/shadow | grep mysql

mysql:!!:16496::::::

[root@DB-Server ~]# more /etc/group | grep mysql

mysql:x:501:

[root@DB-Server ~]# userdel mysql

[root@DB-Server ~]# groupdel mysql

groupdel: group mysql does not exist

[root@DB-Server ~]# 

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

 

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

7:确认MySQL是或不是卸载删除

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

[root@DB-Server
init.d]# rpm -qa | grep -i mysql

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

 

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

二进制包/源码安装格局的MySQL卸载

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

假诺是利用二进制包安装的MySQL,那么您用上面发号施令是找不到其余MySQL组件的。所以一旦你不知底MySQL的设置情势,千万不要用上面发号施令来分辨是不是安装了MySQL

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

[root@DB-Server
init.d]# rpm -qa | grep -i mysql

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

 

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

1:
检查MySQL服务并关闭服务进程

 

 

 

率先通过进度查看是还是不是有MySQL的劳动的景观,
如下所示,MySQL服务是运行的。

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

[root@DB-Server init.d]# ps -ef | grep mysql

root      4752  4302  0 22:55 pts/1    00:00:00 more /etc/init.d/mysql.server

root      7176     1  0 23:23 pts/1    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/DB-Server.localdomain.pid

mysql     7269  7176 15 23:23 pts/1    00:00:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/DB-Server.localdomain.err --pid-file=/usr/local/mysql/data/DB-Server.localdomain.pid

root      7321  4302  0 23:23 pts/1    00:00:00 grep mysql

[root@DB-Server init.d]# /etc/init.d/mysql.server status

MySQL running (7269)[  OK  ]

[root@DB-Server init.d]# /etc/init.d/mysql.server stop

Shutting down MySQL..[  OK  ]

[root@DB-Server init.d]# /etc/init.d/mysql.server status

MySQL is not running[FAILED]

[root@DB-Server init.d]# 

/etc/init.d/mysql

澳门金沙国际 8

/etc/logrotate.d/mysql

 

/etc/my.cnf

2:
查找MySQL的安装目录并彻底剔除

/usr/bin/innochecksum

[root@DB-Server init.d]# whereis mysql

 

mysql: /usr/local/mysql

 

[root@DB-Server init.d]# find / -name mysql

 

/var/spool/mail/mysql

 

/usr/local/mysql-5.7.5-m15-linux-glibc2.5-x86_64/include/mysql

 

/usr/local/mysql-5.7.5-m15-linux-glibc2.5-x86_64/bin/mysql

 

/usr/local/mysql-5.7.5-m15-linux-glibc2.5-x86_64/data/mysql

 

/usr/local/mysql

 

/usr/bin/my_print_defaults

澳门金沙国际 9

/usr/bin/myisam_ftdump

[root@DB-Server init.d]# rm -rf /usr/local/mysql-5.7.5-m15-linux-glibc2.5-x86_64/

 

[root@DB-Server init.d]# rm -rf /usr/local/

 

[root@DB-Server init.d]# rm -rf /var/spool/mail/mysql

 

[root@DB-Server init.d]# 

 

/usr/bin/myisamchk

 

/usr/bin/myisamlog

3:
删除一些安排文件

/usr/bin/myisampack

布署文件一般有/etc/my.cnf
或/etc/init.d/mysql.server,视实际安装配备境况而定。

/usr/bin/mysql_convert_table_format

 

/usr/bin/mysql_fix_extensions

4:删除MySQL用户以及用户组

/usr/bin/mysql_install_db

[root@DB-Server ~]# id mysql

 

uid=101(mysql) gid=501(mysql) groups=501(mysql) context=root:system_r:unconfined_t:SystemLow-SystemHigh

 

[root@DB-Server ~]# userdel mysql

/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

……………………………………………..

 

澳门金沙国际 10

 

 

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

 

/etc/logrotate.d/mysql

 

/etc/my.cnf

 

[root@DB-Server ~]# 

 

在MySQL的官方文书档案,你能够见见中华VPM包所在的安装目录。我们运用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,测试表明发现又是正常。
近来不明白那些细节难题。

 

澳门金沙国际 11

 

相关文章