Shell---rpm

Source: Internet
Author: User
Tags gpg

[Email protected] src]# RPM-QPL epel-release-latest-6.noarch.rpm # #查询该rpm包安装了什么
Warning:epel-release-latest-6.noarch.rpm:header V3 rsa/sha256 Signature, key ID 0608b895:nokey
/etc/pki/rpm-gpg/rpm-gpg-key-epel-6
/etc/rpm/macros.ghc-srpm
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/epel.repo
/usr/share/doc/epel-release-6
/usr/share/doc/epel-release-6/gpl

[[email protected] src]# rpm-qpi epel-release-latest-6.noarch.rpm           # # Query the package for some information
Warning:epel-release-latest-6.noarch.rpm:header V3 rsa/sha256 Signature, key ID 0608b895:nokey
Name: Epel-release Relocations: (not relocatable)
Version:6 vendor:fedora Project
Release:8 Build Date:mon 20 11:54:41 AM CST
Install Date: (not installed) Build host:buildvm-05.phx2.fedoraproject.org
Group:system Enviro Nment/base Source rpm:epel-release-6-8.src.rpm
size:22169 license:gplv2
Signature:rsa/8, Mon 2012 11:29 : 5:00pm CST, Key ID 3b49df2a0608b895
Packager:fedora Project
url:http://dl.fedoraproject.org/pub/epel/
Summary:extra Packages for Enterprise Linux repository configuration
Description:
This package contains the Extra Packages for Enterprise Linux (EPEL) repository
GPG key as well as configuration for Yum and up2date.

[[email protected] src]# rpm-i--test jdk-7u79-linux-x64.rpm # Check if the RPM package can be installed.
Package jdk-2000:1.7.0_79-fcs.x86_64 is already installed
Installing package jdk-2000:1.7.0_79-fcs.x86_64 needs 195MB on The/filesystem
[[email protected] src]# echo $?
1

Code:

1#!/bin/Bash2# Rpm-check.SH34# The purpose of this script is to describe, list, and determine if a RPM package can be installed.5# Save the output in a file.6 #7# This script uses a block of code to show.89success=0Tene_noargs= $ One A if[-Z" $" ] -  Then -   Echo "Usage: ' basename $ Rpm-file '" theExit $E _noargs - fi - - { + Echo - Echo "Archive Description:" +Rpm-qpi $1# query description. A Echo at Echo "Archive Listing:" -RPM-QPL $1# query list. - Echo -Rpm-i--test $1# Check if the RPM package can be installed. - if["$?"-eq $SUCCESS] -  Then in   Echo "can be installed." - Else to   Echo "$ cannot be installed." + fi - Echo the} >"$1.test"# REDIRECT all output from the code block to the file. * $ Echo "Results of RPM test in file $1.test"Panax Notoginseng -# Check the RPM's Man page to see the RPM options. the +Exit0

########################## #shell Array ###################

[Email protected] ~]# array[1]=slot_1
[[email protected] ~]# echo ${array[1]}
Slot_1
[[email protected] ~]# echo ${array[*]}
Slot_1
[Email protected] ~]# array[2]=slot_2
[[email protected] ~]# echo ${array[*]}
Slot_1 slot_2
[[email protected] ~]# echo ${array[2]}
Slot_2

Shell---rpm

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.