LINUX rpm -e --nodeps危險命令之解除安裝elfutils-libelf導致rpm工具不可用
2018年4月24日,一新手練習mysql資料庫安裝其中有一步驟需要安裝 elfutils-libelf-devel-0.164-2.el6.x86_64.rpm elfutils-libelf-0.164-2.el6.x86_64.rpm包,在安裝過程中報錯版本衝突:
[root@centos ~]# rpm -ivh elfutils-libelf-devel-0.164-2.el6.x86_64.rpm elfutils-libelf-0.164-2.el6.x86_64.rpm
Preparing... ########################################### [100%]
file /usr/lib64/libelf.so.1 from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/de/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/en@boldquot/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/en@quot/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/es/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/ja/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/pl/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/uk/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
[root@centos ~]#
然後他就解除安裝了本地低版本的elfutils-libelf:
[root@centos ~]# rpm -e --nodeps elfutils-libelf
接著,再執行 rpm -ivh elfutils-libelf-devel-0.164-2.el6.x86_64.rpm elfutils-libelf-0.164-2.el6.x86_64.rpm 報錯:
[root@centos ~]# rpm -ivh elfutils-libelf-devel-0.164-2.el6.x86_64.rpm elfutils-libelf-0.164-2.el6.x86_64.rpm
rpm: error while loading shared libraries: libelf.so.1: cannot open shared object file: No such file or directory
再執行rpm命令有如下輸出表示rpm工具已經修復:
[root@centos ~]# rpm
RPM version 4.8.0
Copyright (C) 1998-2002 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL
Usage: rpm [-aKfgpWHqVcdilsKiv?] [-a|--all] [-f|--file] [-g|--group] [-p|--package] [-W|--ftswalk] [--pkgid] [--hdrid] [--fileid] [--specfile] [--triggeredby]
[--whatrequires] [--whatprovides] [--nomanifest] [-c|--configfiles] [-d|--docfiles] [--dump] [-l|--list] [--queryformat=QUERYFORMAT] [-s|--state]
[--nofiledigest] [--nomd5] [--nofiles] [--nodeps] [--noscript] [--comfollow] [--logical] [--nochdir] [--nostat] [--physical] [--seedot] [--xdev]
[--whiteout] [--addsign] [-K|--checksig] [--delsign] [--import] [--resign] [--nodigest] [--nosignature] [--initdb] [--rebuilddb] [--aid] [--allfiles]
[--allmatches] [--badreloc] [-e|--erase <package>+] [--excludedocs] [--excludepath=<path>] [--fileconflicts] [--force] [-F|--freshen <packagefile>+]
[-h|--hash] [--ignorearch] [--ignoreos] [--ignoresize] [-i|--install] [--justdb] [--nodeps] [--nofiledigest] [--nomd5] [--nocontexts] [--noorder]
[--nosuggest] [--noscripts] [--notriggers] [--oldpackage] [--percent] [--prefix=<dir>] [--relocate=<old>=<new>] [--replacefiles] [--replacepkgs]
[--test] [-U|--upgrade <packagefile>+] [--quiet] [-D|--define 'MACRO EXPR'] [-E|--eval 'EXPR'] [--macros=<FILE:...>] [--nodigest] [--nosignature]
[--rcfile=<FILE:...>] [-r|--root ROOT] [--querytags] [--showrc] [--quiet] [-v|--verbose] [--version] [-?|--help] [--usage] [--scripts] [--setperms]
[--setugids] [--conflicts] [--obsoletes] [--provides] [--requires] [--info] [--changelog] [--xml] [--triggers] [--last] [--dupes] [--filesbypkg]
[--fileclass] [--filecolor] [--fscontext] [--fileprovide] [--filerequire] [--filecaps]
[root@centos ~]#
總結:LINUX rpm -e --nodeps危險,一定要慎用,否則主機核心被破壞。
[root@centos ~]# rpm -ivh elfutils-libelf-devel-0.164-2.el6.x86_64.rpm elfutils-libelf-0.164-2.el6.x86_64.rpm
Preparing... ########################################### [100%]
file /usr/lib64/libelf.so.1 from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/de/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/en@boldquot/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/en@quot/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/es/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/ja/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/pl/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
file /usr/share/locale/uk/LC_MESSAGES/elfutils.mo from install of elfutils-libelf-0.164-2.el6.x86_64 conflicts with file from package elfutils-libelf-0.152-1.el6.x86_64
[root@centos ~]#
然後他就解除安裝了本地低版本的elfutils-libelf:
[root@centos ~]# rpm -e --nodeps elfutils-libelf
接著,再執行 rpm -ivh elfutils-libelf-devel-0.164-2.el6.x86_64.rpm elfutils-libelf-0.164-2.el6.x86_64.rpm 報錯:
[root@centos ~]# rpm -ivh elfutils-libelf-devel-0.164-2.el6.x86_64.rpm elfutils-libelf-0.164-2.el6.x86_64.rpm
rpm: error while loading shared libraries: libelf.so.1: cannot open shared object file: No such file or directory
這時,rpm已經被破壞缺失libelf.so.1而不能用。
要修復rpm包也很簡單,從別的機器上賦值 libelf.so.1放在/usr/lib64/下(我是從rhel5的機器上覆制過來的):
[root@centos ~]# cp libelf.so.1 /usr/lib64/要修復rpm包也很簡單,從別的機器上賦值 libelf.so.1放在/usr/lib64/下(我是從rhel5的機器上覆制過來的):
再執行rpm命令有如下輸出表示rpm工具已經修復:
[root@centos ~]# rpm
RPM version 4.8.0
Copyright (C) 1998-2002 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL
Usage: rpm [-aKfgpWHqVcdilsKiv?] [-a|--all] [-f|--file] [-g|--group] [-p|--package] [-W|--ftswalk] [--pkgid] [--hdrid] [--fileid] [--specfile] [--triggeredby]
[--whatrequires] [--whatprovides] [--nomanifest] [-c|--configfiles] [-d|--docfiles] [--dump] [-l|--list] [--queryformat=QUERYFORMAT] [-s|--state]
[--nofiledigest] [--nomd5] [--nofiles] [--nodeps] [--noscript] [--comfollow] [--logical] [--nochdir] [--nostat] [--physical] [--seedot] [--xdev]
[--whiteout] [--addsign] [-K|--checksig] [--delsign] [--import] [--resign] [--nodigest] [--nosignature] [--initdb] [--rebuilddb] [--aid] [--allfiles]
[--allmatches] [--badreloc] [-e|--erase <package>+] [--excludedocs] [--excludepath=<path>] [--fileconflicts] [--force] [-F|--freshen <packagefile>+]
[-h|--hash] [--ignorearch] [--ignoreos] [--ignoresize] [-i|--install] [--justdb] [--nodeps] [--nofiledigest] [--nomd5] [--nocontexts] [--noorder]
[--nosuggest] [--noscripts] [--notriggers] [--oldpackage] [--percent] [--prefix=<dir>] [--relocate=<old>=<new>] [--replacefiles] [--replacepkgs]
[--test] [-U|--upgrade <packagefile>+] [--quiet] [-D|--define 'MACRO EXPR'] [-E|--eval 'EXPR'] [--macros=<FILE:...>] [--nodigest] [--nosignature]
[--rcfile=<FILE:...>] [-r|--root ROOT] [--querytags] [--showrc] [--quiet] [-v|--verbose] [--version] [-?|--help] [--usage] [--scripts] [--setperms]
[--setugids] [--conflicts] [--obsoletes] [--provides] [--requires] [--info] [--changelog] [--xml] [--triggers] [--last] [--dupes] [--filesbypkg]
[--fileclass] [--filecolor] [--fscontext] [--fileprovide] [--filerequire] [--filecaps]
[root@centos ~]#
總結:LINUX rpm -e --nodeps危險,一定要慎用,否則主機核心被破壞。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29357786/viewspace-2153301/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux rpm -e --nodeps rpm解除安裝Linux
- Linux命令之rpm安裝命令Linux
- Linux RPM包安裝、解除安裝、升級命令講解Linux
- yum如何解除安裝已安裝的rpm並安裝本地rpm包
- rpm包安裝升級與解除安裝
- centos(linux): rpm -V 驗證rpm包安裝程式的安全CentOSLinux
- Linux rpm查詢命令以及RPM包驗證Linux
- Mysql for Linux安裝配置之—— rpm(bundle)安裝MySqlLinux
- Yum命令之僅下載rpm安裝包且不安裝
- Linux之RPM包管理_RPM包查詢Linux
- mysql安裝(rpm)MySql
- 徹底解除安裝rpm軟體包的指令碼指令碼
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)線上安裝方式LinuxRedhatCentOSMySql
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)離線安裝方式LinuxRedhatCentOSMySql
- 無網環境安裝docker之--rpmDocker
- MySQL 5.7.22 rpm 安裝方式MySql
- Linux 筆記分享十三:RPM 命令管理Linux筆記
- 九、Linux/UNIX操作命令積累【rpm】Linux
- PostgreSQL 10.12 安裝系列 - 本地RPM安裝SQL
- 基於Linux的MySQL5.7RPM包安裝LinuxMySql
- CentOS7(64)環境使用rpm命令安裝gccCentOSGC
- rpm命令講解
- clickhouse-backup(RPM方式安裝)
- Oracle 19c RPM安裝Oracle
- rpm方式離線安裝ansible
- rpm方式安裝redis4.0Redis
- RPM包安裝與介紹
- yum安裝軟體之後如何儲存rpm安裝包
- PostgreSQL 10.12 安裝系列 - Yum+rpm 安裝SQL
- Linux之Yum_rpm_repo詳解Linux
- Linux軟體管理之RPM包1Linux
- 簡單使用rpm命令
- 【18c】Oracle 18.3 RPM安裝Oracle
- RPM包的安裝與升級
- CentOS下使用rpm包安裝MySQLCentOSMySql
- Linux RPM 下載地址Linux
- CentOS8 安裝 MySQL8.0(RPM)CentOSMySql
- mysql8.0.30的RPM包安裝方法MySql