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
- rpm -e --nodeps 無法解除安裝的包怎樣解除安裝 ?
- redhat5 rpm -e --nodeps --allmatches 解除安裝java jdk示例RedhatJavaJDK
- Linux命令之rpm安裝命令Linux
- RPM 解除安裝
- Linux RPM包安裝、解除安裝、升級命令講解Linux
- yum如何解除安裝已安裝的rpm並安裝本地rpm包
- [Linux]rpm,dpkg安裝,查詢,解除安裝,升級Linux
- mysql安裝------RPM包安裝及解除安裝MySql
- rpm包安裝升級與解除安裝
- Linux教程-系統管理-RPM解除安裝篇(轉)Linux
- Linux rpm安裝MySQLLinuxMySql
- Linux命令 rpmLinux
- Linux rpm命令Linux
- linux jdk rpm包安裝LinuxJDK
- (轉)CentOS 下 rpm包與 yum 安裝與解除安裝CentOS
- Yum命令之僅下載rpm安裝包且不安裝
- Postgresql Linux版本安裝——RPM包安裝SQLLinux
- mysql安裝(rpm)MySql
- mysql 5.6 for linux (rpm包安裝)MySqlLinux
- centos(linux): rpm -V 驗證rpm包安裝程式的安全CentOSLinux
- Linux下查詢命令對應的RPM安裝包Linux
- Mysql for Linux安裝配置之—— rpm(bundle)安裝MySqlLinux
- Linux rpm查詢命令以及RPM包驗證Linux
- 徹底解除安裝rpm軟體包的指令碼指令碼
- rpm與src.rpm區別及安裝
- Linux之RPM包管理_RPM包查詢Linux
- MySQL 5.6 RPM安裝MySql
- Linux下用rpm方式安裝MySQLLinuxMySql
- Linux rpm安裝問題解決Linux
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)線上安裝方式LinuxRedhatCentOSMySql
- linux 安裝ps需要先安裝的rpm包Linux
- 無網環境安裝docker之--rpmDocker
- MySQL之——RPM方式安裝MySQL5.6MySql
- zt_Red Hat 5.5中java JDK的解除安裝和安裝rpmJavaJDK
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)離線安裝方式LinuxRedhatCentOSMySql
- linux 環境RPM 安裝MYSQL5.6LinuxMySql
- LINUX下RPM命令基本用法Linux