4.list the software package installed using YUM Use the list function, can search for specific software with the name of the package. For example, to search for a name for the gcc package, use this command. [root@devops ~]# yum list gcc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.grandcloud.cn * extras: mirrors.grandcloud.cn * updates: mirrors.grandcloud.cn base | 3.7 kB 00:00 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 2.1 MB 00:06 Installed Packages gcc.x86_64 4.4.7-3.el6 @base Available Packages gcc.x86_64 4.4.7-4.el6 base [root@devops ~]# 5. Check the hisotry of YUM If you want to view the Yum command history, as long as you use the following command. [root@devops ~]# yum history Loaded plugins: fastestmirror ID | Login user | Date and time | Action(s) | Altered ------------------------------------------------------------------------------- 8 | root <root> | 2014-03-04 22:24 | Erase | 2 7 | root <root> | 2014-03-04 22:22 | Install | 4 6 | root <root> | 2014-02-27 18:16 | Install | 2 5 | root <root> | 2014-01-07 10:53 | Install | 1 4 | root <root> | 2013-07-31 17:58 | I, U | 52 3 | root <root> | 2013-07-31 17:58 | Install | 1 2 | root <root> | 2013-07-31 17:53 | Install | 1 1 | System <unset> | 2012-12-17 09:06 | Install | 218 history list [root@devops ~]# 6.Erase YUM cache By default, Yum will store all data of sotware libiray in /var/cache/yum/, if you want to clear all cache file , you should periodically run the following command, to clear all cache content [root@devops ~]# yum clean all Loaded plugins: fastestmirror Cleaning repos: base extras updates Cleaning up Everything Cleaning up list of fastest mirrors [root@devops ~]# 7.Update linux system using yum update command If you want the system keep up to date with all safety and binary packages for you, run the following command. It will install all patches and the latest security updates. [root@devops ~]# yum update Loaded plugins: fastestmirror Determining fastest mirrors * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.163.com base | 3.7 kB 00:00 base/primary_db | 4.4 MB 00:04 extras | 3.4 kB 00:00 extras/primary_db | 19 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 2.1 MB 00:01 Setting up Update Process Resolving Dependencies --> Running transaction check ---> Package authconfig.x86_64 0:6.1.12-10.el6 will be updated ---> Package authconfig.x86_64 0:6.1.12-13.el6 will be an update ---> Package bash.x86_64 0:4.1.2-9.el6_2 will be updated ---> Package bash.x86_64 0:4.1.2-15.el6_4 will be an update ---> Package bfa-firmware.noarch 0:3.0.0.0-1.el6 will be updated ... Total download size: 134 M Is this ok [y/N]: n 8. Searching Package using YUM command If you don’t remember the exact name of package, you can use the search function, to find all available packages name matching. For example, want to search a software package mactch “GCC” word. you can use “yum search ” command likely the below example. [root@devops ~]# yum search gcc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.163.com ========================================================= N/S Matched: gcc ========================================================= gcc-c++.x86_64 : C++ support for GCC gcc-gnat.x86_64 : Ada 95 support for GCC gcc-java.x86_64 : Java support for GCC gcc-objc.x86_64 : Objective-C support for GCC gcc-objc++.x86_64 : Objective-C++ support for GCC libgcc.x86_64 : GCC version 4.4 shared support library mingw32-gcc.x86_64 : MinGW Windows cross-compiler (GCC) for C compat-gcc-34.x86_64 : Compatibility GNU Compiler Collection compat-gcc-34-c++.x86_64 : C++ support for compatibility compiler compat-gcc-34-g77.x86_64 : Fortran 77 support for compatibility compiler gcc.x86_64 : Various compilers (C, C++, Objective-C, Java, ...) gcc-gfortran.x86_64 : Fortran support libgcj.x86_64 : Java runtime library for gcc libgcj-devel.x86_64 : Libraries for Java development using GCC libgcj-src.x86_64 : Java library sources from GCC4 preview libgomp.x86_64 : GCC OpenMP v3.0 shared support library libmudflap.x86_64 : GCC mudflap shared support library libmudflap-devel.x86_64 : GCC mudflap support mingw32-gcc-c++.x86_64 : MinGW Windows cross-compiler for C++ mingw32-gcc-gfortran.x86_64 : MinGW Windows cross-compiler for FORTRAN mingw32-gcc-objc.x86_64 : MinGW Windows cross-compiler support for Objective C mingw32-gcc-objc++.x86_64 : MinGW Windows cross-compiler support for Objective C++ Name and summary matches only, use "search all" for everything. [root@devops ~]#
9. Get the info of software package using YUM command If you want to get some information about packages, just execute the following command. [root@devops ~]# yum info gcc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.163.com Installed Packages Name : gcc Arch : x86_64 Version : 4.4.7 Release : 3.el6 Size : 19 M Repo : installed From repo : base Summary : Various compilers (C, C++, Objective-C, Java, ...) URL : http://gcc. License : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions Description : The gcc package contains the GNU Compiler Collection version 4.4. : You'll need this package in order to compile C code. Available Packages Name : gcc Arch : x86_64 Version : 4.4.7 Release : 4.el6 Size : 10 M Repo : base Summary : Various compilers (C, C++, Objective-C, Java, ...) URL : http://gcc. License : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions Description : The gcc package contains the GNU Compiler Collection version 4.4. : You'll need this package in order to compile C code.
10. List all available packages in the yum database using YUM list command If you want tolist all the available packages in the Yum database, just using “yum list” command [root@devops ~]# yum list | more Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.163.com Installed Packages MAKEDEV.x86_64 3.24-6.el6 @anaconda-CentOS-201207061011.x86_64/6.3 acl.x86_64 2.2.49-6.el6 @anaconda-CentOS-201207061011.x86_64/6.3 aic94xx-firmware.noarch 30-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 atmel-firmware.noarch 1.3-7.el6 @anaconda-CentOS-201207061011.x86_64/6.3 attr.x86_64 2.4.44-7.el6 @anaconda-CentOS-201207061011.x86_64/6.3 audit.x86_64 2.2-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 audit-libs.x86_64 2.2-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 authconfig.x86_64 6.1.12-10.el6 @anaconda-CentOS-201207061011.x86_64/6.3 autoconf.noarch 2.63-5.1.el6 @base automake.noarch 1.11.1-4.el6 @base b43-openfwwf.noarch 5.2-4.el6 @anaconda-CentOS-201207061011.x86_64/6.3 basesystem.noarch 10.0-4.el6 @anaconda-CentOS-201207061011.x86_64/6.3 bash.x86_64 4.1.2-9.el6_2 @anaconda-CentOS-201207061011.x86_64/6.3 bfa-firmware.noarch 3.0.0.0-1.el6 @an 11. List all installed packages using YUM command List all installed packages to, just execute the following command, it will show all of the installed packages. [root@devops ~]# yum list installed | more Loaded plugins: fastestmirror Installed Packages MAKEDEV.x86_64 3.24-6.el6 @anaconda-CentOS-201207061011.x86_64/6.3 acl.x86_64 2.2.49-6.el6 @anaconda-CentOS-201207061011.x86_64/6.3 aic94xx-firmware.noarch 30-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 atmel-firmware.noarch 1.3-7.el6 @anaconda-CentOS-201207061011.x86_64/6.3 attr.x86_64 2.4.44-7.el6 @anaconda-CentOS-201207061011.x86_64/6.3 audit.x86_64 2.2-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 audit-libs.x86_64 2.2-2.el6 @anaconda-CentOS-201207061011.x86_64/6.3 authconfig.x86_64 6.1.12-10.el6 @anaconda-CentOS-201207061011.x86_64/6.3 ...
done! Enjoy it..
Related Articles:
|
|