linux中,当执行rpm -e删除一个软件包时,都做了些什么事
问题描述:
今天在通过rpm进行删除软件包时,出现了问题,就引发了我对于rpm包执行删除动作时的一些行为做了思考,之前找了很多的文章,后来想如果有debug日志信息,那么不就都清楚了吗
通过打印rpm -e执行删除的调试信息
[root@testvm03 log]# rpm -e -vv mysql-server-5.1.73-8.el6_8.x86_64 D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key D: loading keyring from rpmdb D: opening db environment /var/lib/rpm cdb:mpool:joinenv D: opening db index /var/lib/rpm/Packages rdonly mode=0x0 D: locked db index /var/lib/rpm/Packages D: opening db index /var/lib/rpm/Name rdonly mode=0x0 D: read h# 323 Header sanity check: OK D: added key gpg-pubkey-c105b9de-4e0fd3a3 to keyring D: Using legacy gpg-pubkey(s) from rpmdb D: read h# 350 Header V3 RSA/SHA1 Signature, key ID c105b9de: OK D: ========== --- mysql-server-5.1.73-8.el6_8 x86_64/linux 0x2 D: opening db index /var/lib/rpm/Requirename rdonly mode=0x0 D: ========== recording tsort relations D: Requires: ha_archive.so.0()(64bit) YES (added provide) D: Requires: ha_blackhole.so.0()(64bit) YES (added provide) D: Requires: ha_example.so.0()(64bit) YES (added provide) D: Requires: ha_federated.so.0()(64bit) YES (added provide) D: Requires: ha_innodb_plugin.so.0()(64bit) YES (added provide) D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth) D: 0 0 0 0 1 -mysql-server-5.1.73-8.el6_8.x86_64 D: erasing packages D: closed db index /var/lib/rpm/Requirename D: closed db index /var/lib/rpm/Name D: closed db index /var/lib/rpm/Packages D: closed db environment /var/lib/rpm D: opening db environment /var/lib/rpm cdb:mpool:joinenv D: opening db index /var/lib/rpm/Packages create mode=0x42 D: sanity checking 1 elements D: running pre-transaction scripts D: computing 99 file fingerprints D: computing file dispositions D: opening db index /var/lib/rpm/Basenames create mode=0x42 D: 0x0000fd00 4096 799876 374295 / D: ========== +++ mysql-server-5.1.73-8.el6_8 x86_64-linux 0x2 D: read h# 350 Header V3 RSA/SHA1 Signature, key ID c105b9de: OK D: erase: mysql-server-5.1.73-8.el6_8 has 99 files, test = 0 D: opening db index /var/lib/rpm/Name create mode=0x42 D: opening db index /var/lib/rpm/Triggername create mode=0x42 D: erase: %preun(mysql-server-5.1.73-8.el6_8.x86_64) scriptlet start D: erase: %preun(mysql-server-5.1.73-8.el6_8.x86_64) execv(/bin/sh) pid 2114 + '[' 0 = 0 ']' + /sbin/service mysqld stop + /sbin/chkconfig --del mysqld D: erase: waitpid(2114) rc 2114 status 0 secs 1.078 D: fini 040755 2 ( 600, 600) 4096 /var/run/mysqld D: fini 100640 1 ( 600, 600) 1672 /var/log/mysqld.log backup warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave D: fini 040755 4 ( 600, 600) 4096 /var/lib/mysql D: erase rmdir of /var/lib/mysql failed: Directory not empty D: fini 100644 1 ( 0, 0) 10376 /usr/share/mysql/mysql_test_data_timezone.sql D: fini 100644 1 ( 0, 0) 2855 /usr/share/mysql/mysql_system_tables_data.sql D: fini 100644 1 ( 0, 0) 17285 /usr/share/mysql/mysql_system_tables.sql D: fini 100644 1 ( 0, 0) 45560 /usr/share/mysql/mysql_fix_privilege_tables.sql D: fini 100644 1 ( 0, 0) 2441 /usr/share/mysql/my-small.cnf D: fini 100644 1 ( 0, 0) 4673 /usr/share/mysql/my-medium.cnf D: fini 100644 1 ( 0, 0) 4662 /usr/share/mysql/my-large.cnf D: fini 100644 1 ( 0, 0) 19751 /usr/share/mysql/my-innodb-heavy-4G.cnf D: fini 100644 1 ( 0, 0) 4688 /usr/share/mysql/my-huge.cnf D: fini 100644 1 ( 0, 0) 641349 /usr/share/mysql/fill_help_tables.sql D: fini 100644 1 ( 0, 0) 416238 /usr/share/mysql/errmsg.txt D: fini 100644 1 ( 0, 0) 1626 /usr/share/mysql/config.small.ini D: fini 100644 1 ( 0, 0) 2382 /usr/share/mysql/config.medium.ini D: fini 100644 1 ( 0, 0) 4528 /usr/share/mysql/config.huge.ini D: fini 100644 1 ( 0, 0) 12527 /usr/share/man/man8/mysqlmanager.8.gz D: fini 100644 1 ( 0, 0) 1691 /usr/share/man/man8/mysqld.8.gz D: fini 100644 1 ( 0, 0) 1448 /usr/share/man/man1/resolveip.1.gz D: fini 100644 1 ( 0, 0) 1650 /usr/share/man/man1/resolve_stack_dump.1.gz D: fini 100644 1 ( 0, 0) 1859 /usr/share/man/man1/replace.1.gz D: fini 100644 1 ( 0, 0) 1838 /usr/share/man/man1/perror.1.gz D: fini 100644 1 ( 0, 0) 4970 /usr/share/man/man1/mysqltest.1.gz D: fini 100644 1 ( 0, 0) 416 /usr/share/man/man1/mysqlman.1.gz D: fini 100644 1 ( 0, 0) 4548 /usr/share/man/man1/mysqlimport.1.gz D: fini 100644 1 ( 0, 0) 3187 /usr/share/man/man1/mysqlhotcopy.1.gz D: fini 100644 1 ( 0, 0) 2298 /usr/share/man/man1/mysqldumpslow.1.gz D: fini 100644 1 ( 0, 0) 5381 /usr/share/man/man1/mysqld_safe.1.gz D: fini 100644 1 ( 0, 0) 5592 /usr/share/man/man1/mysqld_multi.1.gz D: fini 100644 1 ( 0, 0) 5695 /usr/share/man/man1/mysqlcheck.1.gz D: fini 100644 1 ( 0, 0) 1609 /usr/share/man/man1/mysqlbug.1.gz D: fini 100644 1 ( 0, 0) 12134 /usr/share/man/man1/mysqlbinlog.1.gz D: fini 100644 1 ( 0, 0) 1654 /usr/share/man/man1/mysql_zap.1.gz D: fini 100644 1 ( 0, 0) 3797 /usr/share/man/man1/mysql_upgrade.1.gz D: fini 100644 1 ( 0, 0) 1833 /usr/share/man/man1/mysql_tzinfo_to_sql.1.gz D: fini 100644 1 ( 0, 0) 1997 /usr/share/man/man1/mysql_setpermission.1.gz D: fini 100644 1 ( 0, 0) 1543 /usr/share/man/man1/mysql_secure_installation.1.gz D: fini 100644 1 ( 0, 0) 2752 /usr/share/man/man1/mysql_install_db.1.gz D: fini 100644 1 ( 0, 0) 2165 /usr/share/man/man1/mysql_fix_privilege_tables.1.gz D: fini 100644 1 ( 0, 0) 1426 /usr/share/man/man1/mysql_fix_extensions.1.gz D: fini 100644 1 ( 0, 0) 2035 /usr/share/man/man1/mysql_convert_table_format.1.gz D: fini 100644 1 ( 0, 0) 2181 /usr/share/man/man1/mysql.server.1.gz D: fini 100644 1 ( 0, 0) 5443 /usr/share/man/man1/myisampack.1.gz D: fini 100644 1 ( 0, 0) 1835 /usr/share/man/man1/myisamlog.1.gz D: fini 100644 1 ( 0, 0) 13582 /usr/share/man/man1/myisamchk.1.gz D: fini 100644 1 ( 0, 0) 2286 /usr/share/man/man1/myisam_ftdump.1.gz D: fini 100644 1 ( 0, 0) 1508 /usr/share/man/man1/msql2mysql.1.gz D: fini 100644 1 ( 0, 0) 1850 /usr/share/man/man1/innochecksum.1.gz D: fini 100644 1 ( 0, 0) 2441 /usr/share/doc/mysql-server-5.1.73/my-small.cnf D: fini 100644 1 ( 0, 0) 4673 /usr/share/doc/mysql-server-5.1.73/my-medium.cnf D: fini 100644 1 ( 0, 0) 4662 /usr/share/doc/mysql-server-5.1.73/my-large.cnf D: fini 100644 1 ( 0, 0) 19751 /usr/share/doc/mysql-server-5.1.73/my-innodb-heavy-4G.cnf D: fini 100644 1 ( 0, 0) 4688 /usr/share/doc/mysql-server-5.1.73/my-huge.cnf D: fini 040755 2 ( 0, 0) 4096 /usr/share/doc/mysql-server-5.1.73 D: fini 100755 1 ( 0, 0) 1569176 /usr/libexec/mysqlmanager D: fini 100755 1 ( 0, 0) 7590416 /usr/libexec/mysqld D: fini 100755 1 ( 0, 0) 1259136 /usr/lib64/mysql/plugin/ha_innodb_plugin.so.0.0.0 D: fini 120777 1 ( 0, 0) 25 /usr/lib64/mysql/plugin/ha_innodb_plugin.so.0 D: fini 120777 1 ( 0, 0) 25 /usr/lib64/mysql/plugin/ha_innodb_plugin.so D: fini 100755 1 ( 0, 0) 58064 /usr/lib64/mysql/plugin/ha_federated.so.0.0.0 D: fini 120777 1 ( 0, 0) 21 /usr/lib64/mysql/plugin/ha_federated.so.0 D: fini 120777 1 ( 0, 0) 21 /usr/lib64/mysql/plugin/ha_federated.so D: fini 100755 1 ( 0, 0) 33168 /usr/lib64/mysql/plugin/ha_example.so.0.0.0 D: fini 120777 1 ( 0, 0) 19 /usr/lib64/mysql/plugin/ha_example.so.0 D: fini 120777 1 ( 0, 0) 19 /usr/lib64/mysql/plugin/ha_example.so D: fini 100755 1 ( 0, 0) 30288 /usr/lib64/mysql/plugin/ha_blackhole.so.0.0.0 D: fini 120777 1 ( 0, 0) 21 /usr/lib64/mysql/plugin/ha_blackhole.so.0 D: fini 120777 1 ( 0, 0) 21 /usr/lib64/mysql/plugin/ha_blackhole.so D: fini 100755 1 ( 0, 0) 54048 /usr/lib64/mysql/plugin/ha_archive.so.0.0.0 D: fini 120777 1 ( 0, 0) 19 /usr/lib64/mysql/plugin/ha_archive.so.0 D: fini 120777 1 ( 0, 0) 19 /usr/lib64/mysql/plugin/ha_archive.so D: fini 040755 2 ( 0, 0) 4096 /usr/lib64/mysql/plugin D: fini 100755 1 ( 0, 0) 1365648 /usr/bin/resolveip D: fini 100755 1 ( 0, 0) 1369792 /usr/bin/resolve_stack_dump D: fini 100755 1 ( 0, 0) 1369712 /usr/bin/replace D: fini 100755 1 ( 0, 0) 1370544 /usr/bin/perror D: fini 100755 1 ( 0, 0) 187672 /usr/bin/mysqltest D: fini 100755 1 ( 0, 0) 32477 /usr/bin/mysqlhotcopy D: fini 100755 1 ( 0, 0) 7402 /usr/bin/mysqldumpslow D: fini 100755 1 ( 0, 0) 18204 /usr/bin/mysqld_safe D: fini 100755 1 ( 0, 0) 24495 /usr/bin/mysqld_multi D: fini 100755 1 ( 0, 0) 4808 /usr/bin/mysqlbug D: fini 100755 1 ( 0, 0) 3888 /usr/bin/mysql_zap D: fini 100755 1 ( 0, 0) 68176 /usr/bin/mysql_upgrade D: fini 100755 1 ( 0, 0) 1357920 /usr/bin/mysql_tzinfo_to_sql D: fini 100755 1 ( 0, 0) 17473 /usr/bin/mysql_setpermission D: fini 100755 1 ( 0, 0) 8198 /usr/bin/mysql_secure_installation D: fini 100755 1 ( 0, 0) 14646 /usr/bin/mysql_install_db D: fini 100755 1 ( 0, 0) 5834 /usr/bin/mysql_fix_privilege_tables D: fini 100755 1 ( 0, 0) 1261 /usr/bin/mysql_fix_extensions D: fini 100755 1 ( 0, 0) 4245 /usr/bin/mysql_convert_table_format D: fini 100755 1 ( 0, 0) 1671864 /usr/bin/myisampack D: fini 100755 1 ( 0, 0) 1639184 /usr/bin/myisamlog D: fini 100755 1 ( 0, 0) 1756720 /usr/bin/myisamchk D: fini 100755 1 ( 0, 0) 1642392 /usr/bin/myisam_ftdump D: fini 100755 1 ( 0, 0) 10024 /usr/bin/innochecksum D: fini 100755 1 ( 0, 0) 7026 /etc/rc.d/init.d/mysqld D: fini 100644 1 ( 0, 0) 871 /etc/logrotate.d/mysqld D: erase: %postun(mysql-server-5.1.73-8.el6_8.x86_64) scriptlet start D: erase: %postun(mysql-server-5.1.73-8.el6_8.x86_64) execv(/bin/sh) pid 2155 + '[' 0 -ge 1 ']' D: erase: waitpid(2155) rc 2155 status 0 secs 0.002 D: --- h# 350 mysql-server-5.1.73-8.el6_8.x86_64 D: removing "mysql-server" from Name index. D: removing 99 entries from Basenames index. D: opening db index /var/lib/rpm/Group create mode=0x42 D: removing "Applications/Databases" from Group index. D: opening db index /var/lib/rpm/Requirename create mode=0x42 D: removing 68 entries from Requirename index. D: opening db index /var/lib/rpm/Providename create mode=0x42 D: removing 8 entries from Providename index. D: opening db index /var/lib/rpm/Conflictname create mode=0x42 D: removing 1 entries from Conflictname index. D: opening db index /var/lib/rpm/Dirnames create mode=0x42 D: removing 14 entries from Dirnames index. D: opening db index /var/lib/rpm/Requireversion create mode=0x42 D: removing 68 entries from Requireversion index. D: opening db index /var/lib/rpm/Provideversion create mode=0x42 D: removing 8 entries from Provideversion index. D: opening db index /var/lib/rpm/Installtid create mode=0x42 D: removing 1 entries from Installtid index. D: opening db index /var/lib/rpm/Sigmd5 create mode=0x42 D: removing 1 entries from Sigmd5 index. D: opening db index /var/lib/rpm/Sha1header create mode=0x42 D: removing "216aec29bd69c731019b4def5cf20d01f47cd1e0" from Sha1header index. D: opening db index /var/lib/rpm/Filedigests create mode=0x42 D: removing 99 entries from Filedigests index. D: running post-transaction scripts D: closed db index /var/lib/rpm/Filedigests D: closed db index /var/lib/rpm/Sha1header D: closed db index /var/lib/rpm/Sigmd5 D: closed db index /var/lib/rpm/Installtid D: closed db index /var/lib/rpm/Provideversion D: closed db index /var/lib/rpm/Requireversion D: closed db index /var/lib/rpm/Dirnames D: closed db index /var/lib/rpm/Triggername D: closed db index /var/lib/rpm/Conflictname D: closed db index /var/lib/rpm/Providename D: closed db index /var/lib/rpm/Requirename D: closed db index /var/lib/rpm/Group D: closed db index /var/lib/rpm/Basenames D: closed db index /var/lib/rpm/Name D: closed db index /var/lib/rpm/Packages D: closed db environment /var/lib/rpm
主要步骤:
1.检查rpm库,是否有依赖关系
2.执行预删除操作,比如,停掉服务,删除开机启动等内容
3.删除具体的生成的文件,备份配置文件
4.删除rpm库中的文件。
文档创建时间:2019年3月8日15:03:27