Generic YUM usage – lesser known options
Find a package which delivers a certain file:
- # yum whatprovides "*/gnu/stubs-32.h"
- glibc-devel-2.12-1.80.el6.i686 : Object files for development using standard C: libraries.
- Repo : ol6_u3_base
- Matched from:
- Filename : /usr/include/gnu/stubs-32.h
List a package and download the RPM
- # yum list dhcp
- Loaded plugins: refresh-packagekit, security
- Available Packages
- dhcp.x86_64 12:4.1.1-34.P1.0.1.el6 ol6_latest
- # yumdownloader dhcp.x86_64 --destdir /KITS/YUM
- Loaded plugins: refresh-packagekit
- dhcp-4.1.1-34.P1.0.1.el6.x86_64.rpm | 815 kB 00:
List older versions of a package
- # yum --showduplicate list bind-utils
- Loaded plugins: refresh-packagekit, security
- Installed Packages
- bind-utils.x86_64 32:9.8.2-0.10.rc1.el6 @anaconda-OracleLinuxServer-201206261930.x86_64/6.3
- Available Packages
- bind-utils.x86_64 32:9.7.0-5.P2.el6 ol6_latest
- bind-utils.x86_64 32:9.7.0-5.P2.el6_0.1 ol6_latest
- bind-utils.x86_64 32:9.7.3-2.el6 ol6_latest
- bind-utils.x86_64 32:9.7.3-2.el6_1.P1.1 ol6_latest
- ....
Run RPM to upgrade a package with multiple packages
- # rpm -Uvh bind-9.8.2-0.17.rc1.0.2.el6_4.4.x86_64.rpm bind-libs-9.8.2-0.17.rc1.0.2.el6_4.4.x86_64.rpm \
- bind-utils-9.8.2-0.17.rc1.0.2.el6_4.4.x86_64.rpm
Standard YUM commands:
1) Install a package
# yum install glibc-headers-2.12-1.107.el6.x86_64
2) Check, drop and install a newer version of a package
Check the current status of Oracle RDBMS SERVER preinstall package
- # rpm -qa | grep -i preinstall
- oracle-rdbms-server-11gR2-preinstall-1.0-6.el6.x86_64
Deinstall the 11.2 package
- # yum remove oracle-rdbms-server-11gR2-preinstall.x86_64
- Loaded plugins: refresh-packagekit, security
Check whether 12c preinstall package is available from our YUM repository
- # yum list | grep preinstall
- oracle-rdbms-server-12cR1-preinstall.x86_64
Install it
# yum install oracle-rdbms-server-12cR1-preinstall.x86_64
Error: Plugin "refresh-packagekit" can't be imported using YUM
- # yum list
- Plugin "refresh-packagekit" can't be imported
- Loaded plugins: security
- Traceback (most recent call last):
- File "/usr/bin/yum", line 29, in <module>
- yummain.user_main(sys.argv[1:], exit_code=True)
- File "/usr/share/yum-cli/yummain.py", line 285, in user_main
- errcode = main(args)
- File "/usr/share/yum-cli/yummain.py", line 136, in main
- result, resultmsgs = base.doCommands()
- File "/usr/share/yum-cli/cli.py", line 434, in doCommands
- self._getTs(needTsRemove)
- File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 99, in _getTs
- self._getTsInfo(remove_only)
- File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 110, in _getTsInfo
Solution: Remove $ORACLE_HOME/lib from LD_LIBRARY_PATH
- [root@hrac1 Desktop]# env | grep LD
- LD_LIBRARY_PATH=/u01/app/11.2.0/grid/lib:/lib:/usr/lib
- You have new mail in /var/spool/mail/root
- [root@hrac1 Desktop]# export LD_LIBRARY_PATH=/usr/lib
- [root@hrac1 Desktop]# yum list
- Loaded plugins: refresh-packagekit, security
- ol6_u3_base | 1.4 kB 00:00
No comments:
Post a Comment