Install, update, and delete Spacewalk software packages.

Source: Internet
Author: User

Install, update, and delete Spacewalk software packages.

Link: http://blog.csdn.net/kongxx/article/details/44003721

After the operations in the previous two blogs, we can use Spacewalk to install the system. However, in actual scenarios, we often need to use Spacewalk to manage software packages. For example: install, upgrade, and delete the software package. Let's take a look at how to implement these functions through Spacewalk.


Install software package
Access Systems> select a machine> Software> Packages> Install
* Input Telnet in the Filter (Here we assume you need to install the telnet tool on the client) and select the telnet software package (for example: telnet-0.17-48.el6)
* Click "Install Selected Packages ".
* Click the Confirm button on the "Confirm Package Install" page.
* Then a Pending event is displayed on the Systems> selected machine> Events> pending page.
* Log on to the client and run the rhn_check command. This command will execute the pending event in the previous step.
* Then, you can use "rpm-qa | grep telnet" on the client to view the result. On the Spacewalk, we can also observe that the Pending Event is gone, but there is an additional record in the History Event after the execution is complete.

Upgrade Software Package
If the Repositories contained in the Channel of Spacewalk has a new software version, when you access Systems> Systems, the number of software to be upgraded is displayed in the Packages column of the machine in the list. Access Systems> select a machine> Software> Packages> Upgrade.
* Select the software package to be upgraded and click "Upgrade Packages ".
* Click the Confirm button on the "Confirm Package Upgrade" page.
* Then a Pending event is displayed on the Systems> selected machine> Events> pending page.
* Log on to the client and run the rhn_check command.

Delete a software package
Access Systems> select a machine> Software> Packages> List/Remove
* Enter the software package to be deleted in the Filter and select
* Select the software package to be upgraded and click "Remove Packages ".
* Click the Confirm button on the "Confirm Package Removal" page.
* Then a Pending event is displayed on the Systems> selected machine> Events> pending page.
* Log on to the client and run the rhn_check command.

Finally, because the rhn_check command must be executed on the client to install, upgrade, and delete the software package, we can write a cron job for automatic execution.
For example, we can write a script file to execute the rhn_check command.

# Cat my_rhn_check.sh
#!/bin/bashret=`ps -ef | grep python | grep rhn_check | wc -l`if [ $ret = 0 ]; then    /usr/sbin/rhn_checkfi

Set a cron job to run the check once every minute.
# Crontab-e
* * * * * /root/my_rhn_check.sh

Restart the crond service.
# sudo /etc/init.d/crond restart



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.