關于Linux如何查看YUM的安裝目錄代碼圖文教程

Linux下如何查看使用YUMLinux過的包的安裝路徑呢? 在搞清楚這個問題前,我們先來了解一下YUM。 YUM(全稱為 Yellow dog UpLinuxr, ModLinuxied)是一個在Fedora和RedHat以及centos中的Shell前端軟件包管理器。基于RPM包管理,能夠從指定的服務器自動下載RPM包并且安裝,可以自動處理依賴性關系,并且一次安裝所有依賴的軟件包,避免了手動安裝的麻煩(尋找資源、下載;放到指定目錄安裝;處理依賴關系并下載依賴關系的包進行安裝)。所以用yum安裝,實質上是用RPM安裝,所以RPMLinux信息的指令都可用。

?

如果使用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? 包名來查看具體的安裝路徑。如下所示:

?

關于Linux如何查看YUM的安裝目錄代碼圖文教程

?

?

[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  .....................................................

?

關于Linux如何查看YUM的安裝目錄代碼圖文教程

?

[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的安裝目錄代碼圖文教程

?

? 版權聲明
THE END
喜歡就支持一下吧
點贊9 分享