How to uninstall OpenLDAP in RedHat?
Solution 1
Can you make a backup of the configuration and :
yum remove openldap
rpm -e openldap.package_name
yum install openldap
And copy your configuration files back
Solution 2
You're trying to remove the wrong package.
openldap provides only the library files (libldap, liblber, etc.) and it's required by pretty much everything on the system. So when you try to remove it yum goes through the list of dependencies which is pretty much all of it.
The configuration files that you deleted are part of the openldap-servers package (and possibly openldap-clients package). You can remove them as usual: yum remove openldap-servers
.
You can check to which package the files belong to by running yum provides <full path or */file>
ex. yum provides /etc/openldap/slapd.d
or yum provides */ldap.conf
Related videos on Youtube
LinuxBegineer
Updated on September 18, 2022Comments
-
LinuxBegineer almost 2 years
I have installed OpenLDAP with yum, but I have accidentally deleted some of the config files. I am not able to recover them. I want to uninstall it. I tried the following command but it ends with an error:
--> Processing Dependency: PackageKit-glib = 0.5.8-20.el6 for package: PackageKit-gtk-module-0.5.8-20.el6.x86_64 --> Running transaction check ---> Package PackageKit-device-rebind.x86_64 0:0.5.8-20.el6 will be erased ---> Package PackageKit-gstreamer-plugin.x86_64 0:0.5.8-20.el6 will be erased ---> Package PackageKit-gtk-module.x86_64 0:0.5.8-20.el6 will be erased --> Finished Dependency Resolution Error: Trying to remove "yum", which is protected You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
Can someone please tell how to uninstall it properly so I can install it again and make the config changes?
-
Anthon almost 9 yearsWhere is the command. It looks like you remove
yum
withyum
(did you cut and paste a command and pasted it twice before hitting return?) -
LinuxBegineer almost 9 years# yum remove openldap
-
-
LinuxBegineer almost 9 yearsThere was a problem importing one of the Python modules required to run yum. The error leading to this problem was: libldap-2.4.so.2: cannot open shared object file: No such file or directory Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.6.6 (r266:84292, May 1 2012, 13:52:17) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]
-
mjturner almost 9 years@LinuxBegineer You've deleted parts of OpenLDAP, which now prevents
yum
from running. The solution is to download the OpenLDAP RPM for RHEL 6 and install that manually usingrpm
. That should fixyum
. -
LinuxBegineer almost 9 yearsNo i accidentally deleted only config file which is inside /etc/openldap/slapd.d/* nothing else
-
mjturner almost 9 years@LinuxBegineer Ok. Well, the same suggestion applies - download the OpenLDAP RPM for RHEL6 and reinstall it using
rpm
. -
LinuxBegineer almost 9 yearsI think u did not check my question in detail
-
Mathieu Coavoux almost 9 yearsYour configuration files have not been removed if you did only a yum remove. If you've errors while trying to install openldap back as "no such files or directory" it can mean that openldap as not been removed properly. Those commands stand to remove it properly and install it again. So far if your configuration disappeared from the disk you'd check if you have any backup.
-
LinuxBegineer almost 9 yearsThese error when i am trying to run 'yum remove openldap' There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: libldap-2.4.so.2: cannot open shared object file: No such file or directory Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.6.6 (r266:84292, May 1 2012, 13:52:17) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]
-
LinuxBegineer almost 9 yearsNow for every command i am getting below exception There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: libldap-2.4.so.2: cannot open shared object file: No such file or directory Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.6.6 (r266:84292, May 1 2012, 13:52:17) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]
-
Mathieu Coavoux almost 9 yearsCan you try to reinstall libldap only?
-
LinuxBegineer almost 9 yearsyum install libldap end with the above error
-
Mathieu Coavoux almost 9 yearsWhat's your OS version?
-
LinuxBegineer almost 9 yearsRed Hat enterprises Linux Server Releases6.3(Santiago)
-
Mathieu Coavoux almost 9 yearsCan you check if the rpm is still in the cache :
find /var/cache -name libldap*.rpm
if yes try a rpm -ivh on it otherwise link and do the same -
nkms almost 9 yearsWell, it seems you have deleted the openldap package (or part of it - definitely the lib), so you'll have to find the package for your system and installed it manually. yum will not work, rpm however it will. I'm not sure what system you are running (version 2.4.23 is outdated for rhel6/7 - it's using vers 2.4.39). If it's a rhel/centos 6 download the latest and install: wget ftp.ntua.gr/pub/linux/centos/6/os/x86_64/Packages/… && rpm -ivh openldap-2.4.39-6.el7.x86_64.rpm
-
LinuxBegineer almost 9 yearsIts not in cache and just browsed the link u provided it have around 500+ result
-
nkms almost 9 yearsYou'll need access to redhat network (rhn.redhat.com) to download the package manually (yumdownloader will not work). If you don't have access you can download the equivalent centos package (it will work) but if you don't want to upgrade to latest version (2.4.39) you'll need to find a repository which keeps older versions of packages (check vault.centos.org).
-
Mathieu Coavoux almost 9 yearsTry with for find ldap . I can give you the link to the rpm but I need a u name -a pls
-
LinuxBegineer almost 9 yearsfind: `ldap': No such file or directory But still i am able to start or stop openldap and i did not get " I can give you the link to the rpm but I need a u name -a pls " "
-
Mathieu Coavoux almost 9 years
find / -name *ldap*.rpm
anduname -a
-
LinuxBegineer almost 9 yearsfor first one no output and second one "Linux mdfdevapp2 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux "
-
Mathieu Coavoux almost 9 years
-
LinuxBegineer almost 9 yearsSO if i will download rpm and install it again it will download dependency as well?
-
Mathieu Coavoux almost 9 yearsThe openldap shall include the dependency broken. Could you try the latest command before download it from the site
yum install --downloadonly --downloaddir=/tmp libldap
andrpm -ivh /tmp/package_name
-
LinuxBegineer almost 9 yearsEvery yum command end with
yum install --downloadonly --downloaddir=/tmp libldap
There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: libldap-2.4.so.2: cannot open shared object file: No such file or directory Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.6.6 (r266:84292, May 1 2012, 13:52:17) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] -
LinuxBegineer almost 9 yearsThanks i have rum rpms of ldap now yum command also working
-
Mathieu Coavoux almost 9 yearsGlad to hear that