Preparation: 1. Prepare the rpm file to be installed.
2. Write the rpm file to the file list pkg. lst (the file name is optional)
3. install. sh
Directory structure
|-Install. sh
|-Pkg. lst
|-Readme.txt
|-Xxxx. rpm
|-Yyyy. rpm
|-Installation process: 1. Put the rpm file to this directory.
2. Write the pkg. lst file list in the rpm file list in the dependent order. An example is as follows:
Gcc-c ++-4.1.2
Glibc-2.5-24
Glibc-common-2.5
Glibc-devel-2.5
Glibc-headers-2.5
Kernel-headers-2.6.18
3. Upload All files in this directory to the Linux machine to be installed (rpm supported)
4. Add install. sh executable permission: chmod a + x install. sh
5. Run the installation script:./install. sh pkg. lst.
(End)
Note: When editing these files under the Window, you must specify the unix line terminator. Otherwise, an error is reported in the unix system. Attachment: installation script install. sh
#! /Bin/basffe [$ #-ne 1]; then echo "Usage: $0 rpmlist" exit 1 fiRPMLIST = $1 ERRFILE = ~ /Rpminst 'date + % Y % m % d % H % m % s '. errfor pkg in 'cat $ rpmlist' do rpm-qa | grep $ pkg &>/dev/null if [$? -Ne 0]; then echo $ pkg is not installed yet, starting to install... rpm-Uvh $ pkg * 2> $ ERRFILE else echo $ pkg already installed. fidone