Update Linux Box with yum
One of the system administrator daily task is to keep system up to date and my favorite tool is Yum.
What is yum?
Yum is a software package manager and it’s a tool for system administrator to install, update and remove RPM-based packages in linux box. Their ability to check the package dependencies make it easier for system adminisrator to apply patches and to maintain the system up to date.
Yum features include:
* Support for multiple repositories
* Simple configuration
* Dependency calculation
* Fast operation
* RPM-consistent behavior
* Package group support, including multiple-repository groups
* Simple interface
Usage: yum [options] < grouplist, localinstall, groupinfo, localupdate, resolvedep, erase, deplist, groupremove, makecache, upgrade, provides, shell, install, whatprovides,groupinstall, update, repolist,groupupdate, info, search, check-update, list, remove, clean, grouperase
Normally, I use yum check-update to check any software update from fedora / centos repositories.
You may try it with your linux shell ..
So fire up your ssh client and issue this command once login
[root@xxxx xxxx]# yum check-update updates 100% |=================| 2.3 kB 00:00 primary.sqlite.bz2 100% |=================| 2.6 MB 00:20 fedora 100% |=================| 2.1 kB 00:00 acl.x86_64 2.2.39-6.fc7 updates attr.x86_64 2.4.32-3.fc7 updates bind-libs.x86_64 31:9.4.2-1.fc7 updates bind-utils.x86_64 31:9.4.2-1.fc7 updates coreutils.x86_64 6.9-6.fc7 updates cpio.x86_64 2.6-28.fc7 updates cups.x86_64 1:1.2.12-8.fc7 updates cups-libs.i386 1:1.2.12-8.fc7 updates cups-libs.x86_64 1:1.2.12-8.fc7 updates
After yum finish and list out which software available for updates, then we issue yum update command to setting up update process and also check for any software dependencies.
[root@xxxx xxxx]# yum update Setting up Update Process Resolving Dependencies —> Running transaction check —> Package libselinux-devel.i386 0:2.0.14-10.fc7 set to be updated —> Package bind-utils.x86_64 31:9.4.2-1.fc7 set to be updated —> Package libacl-devel.x86_64 0:2.2.39-6.fc7 set to be updated —> Package coreutils.x86_64 0:6.9-6.fc7 set to be updated —> Package libattr.i386 0:2.4.32-3.fc7 set to be updated —> Package system-config-securitylevel-tui.x86_64 0:1.7.0-6.fc7 set to be updated ………… Transaction Summary ========================================================== Install 3 Package(s) Update 75 Package(s) Remove 2 Package(s) Total download size: 73 M Is this ok [y/N]:y
Transaction summary will calculate how many softwares to be install, update and remove for the system. If we want to proceed just select y and enter.
Downloading Packages: (1/78): perl-Test-Simple- 100% |====================| 108 kB 00:02 (2/78): swig-1.3.33-1.fc7 100% |====================| 3.1 MB 00:22 (3/78): perl-CPAN-1.76_02 100% |====================| 127 kB 00:01 (4/78): elfutils-libelf-0 100% |====================| 50 kB 00:00 (5/78): info-4.11-2.fc7.x 100% |====================| 171 kB 00:01 (6/78): python-urlgrabber 100% |====================| 121 kB 00:00 (7/78): smartmontools-5.3 100% |====================| 305 kB 00:02 (8/78): ncurses-5.6-9.200 100% |====================| 1.0 MB 00:08 (9/78): yum-3.2.7-2.fc7.n 100% |====================| 551 kB 00:04 .... ....
Yum start downloading software / packages.
Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Updating : libselinux ##################### [ 1/155] Updating : libattr ##################### [ 2/155] Updating : libacl ##################### [ 3/155] Updating : ncurses ##################### [ 4/155] ....... ....... Cleanup : libacl-devel ##################### [ 82/155] Cleanup : libacl-devel ##################### [ 83/155] Cleanup : coreutils ##################### [ 84/155 Cleanup : libattr ##################### [ 85/155]
After yum finish download the software, it will run rpm_check_debug and transaction test and if the transaction test succeeded, yum will start updating and cleanup up the softwares.
Removed: kernel.x86_64 0:2.6.22.9-91.fc7 kernel-devel.x86_64 0:2.6.22.9-91.fc7 Installed: kernel.x86_64 0:2.6.23.8-34.fc7 kernel-devel.x86_64 0:2.6.23.8-34.fc7 Dependency Installed: paps-libs.x86_64 0:0.6.8-1.fc7 Updated: acl.x86_64 0:2.2.39-6.fc7 attr.x86_64 0:2.4.32-3.fc7
This is the last stage and summary for the software removed, installed, dependency installed and updated by yum.
Tips:
1.Run yum every night:
# chkconfig yum on
2. Exclude unnecessary packages, example to exclude open office update
# yum --exclude 'openoffice*' update
3. Delete already installed package files
# yum clean packages
Discover the Magic Formula to creating Adsense sites using
Wordpress and make your first dollar in 7 days!