yum local library offline installation

//To solve the problem that the nameservice cannot be parsed, resulting in the inability to download the rmp package, offline installation requires that the rmp to be obtained be obtained first, online, or obtained from the yum cache after installation. Pay attention to dependencies, use this to solve:
//Turn to yum's update source, instead of RHN

//os.chdir("/etc/yum.repos.d")


//Of course, put the corresponding gz,py. sh, etc. are first transmitted to the server, and then the server is linked on the virtual machine side, sh is downloaded from the server, and running this sh will automatically pull down all the required resources from the server. Unzip, install, and run, including gz (local rmp source, py , sy, etc.)

//Realize .sh, interact with .py, decompress gz
$ROOT_DIR/ascp ​​$CM_USER@$CM_IP:$CM_SCAPE_ROOT_DIR/release/certus-FlexScape-ver03.tar.gz . $CM_PASSWORD #qpid-cpp -client... lost


$ROOT_DIR/ascp ​​$CM_USER@$CM_IP:$CM_SCAPE_ROOT_DIR/scripts/instalexpect.py . $CM_PASSWORD

//The root directory is the decompressed directory
os.chdir("/root/certus/rpms-release-0.18 ")
//Create source is based on the folder designation of this decompressed package, and future rmp sources are obtained from here
os.system("createrepo -v /root/certus/rpms-release-yum/")

/////python install.py source sql.sh python start.py This realizes the interaction between the front and back.

///////Error is reported because the enter key is used for editing under the window. Linux does not recognize
bad interpreter: No such file or directory




//Preparation for yum offline installation, download the required lib class library, configure offline installation
//install the class library, make it have yum related functions
============ = This is necessary for the yum environment =====================================
os.system("rpm - ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm createrepo-0.9.9-18.el6.noarch.rpm")
//Create a yum local rpm warehouse to solve the problem of dependency update after installing a package. A software package is required when making a yum warehouse: createrepo-0.4.11-3.el5.noarch.rpm can use the rpm -qa|grep createrepo command Check to see if this package is installed. Installation: # rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm After the installation is complete, there will be a createrepo command in the /usr/bin/ directory, you can execute the man createrepo command to view the command. But there is no update function, by registering an RHN (Red Hat Network) account, and then connecting to the RHN Satellite server by yum to solve problems such as update and package dependencies. This method needs to be able to connect to the internet. What if I don't have an RHN account? Register one, or use a local yum repository. The local yum repository is to copy the contents of the system installation CD to the local disk, and configure yum to allow it to access the local disk to resolve package dependencies, but not to update packages.

os.system("createrepo -v /root/certus/rpms-release-yum/")
os.system("createrepo -v /root/certus/rpms-release-0.18/")

//Go to the update source of yum, Instead of RHN

os.chdir("/etc/yum.repos.d")

//Create a new directory
os.system("mkdir bak")

//.repo file is the rmp that needs to depend on the header record of the current rmp , yum will automatically use this file to update dependencies,
All RPM software packages are stored on the server, and then the dependencies of each RPM file are analyzed with related functions, and these data are recorded as files and stored in a specific directory of the server.
Client: If you need to install a certain software, first download the dependency relationship file recorded on the server
(through WWW or FTP), analyze the recorded data downloaded by the server, and then obtain all related software, all at once Download and install.

os.system("mv *.repo ./bak") os.system
("cp /root/certus/local.repo ./")
os.system("yum clean all")
//The package on the server Information is cached locally to improve the speed of searching and installing software, which is equivalent to building an index
os.system("yum makecache")

//Various installations, here is the installation running environment package
yum -y install package name (support *): automatic Select y, fully automatic (various packages)
yum install package name (support *): manually select y or n
yum remove package name (do not support *)
rpm -ivh package name (support *): install rpm package
rpm -e package Name (does not support *): Uninstall rpm package

=========================== This can go, not the environment must====== ==========

os.system("
memcached mod_ssl net-snmp net-snmp-libs net-snmp-utils nfs-utils portmap \
yum-utils openslp tcl libxml2 libyaml")

//Jump to the previously created software repository
os.chdir("/root/certus/rpms -release-0.18")


//First jump to the directory, the following is the installation of a series of rmp packages in the current directory. First jump to the directory, and then the operation is under this directory
os.system("yum - y install expect-5.44.1.15-5.el6_4.x86_64.rpm ")

//1. Install a package # rpm -ivh 2. Upgrade a package # rpm -Uvh 3. Remove a package # rpm -e//touch When it has been installed, it can be uninstalled and installed again to get rmp. There is a certain delay. 
//Upgrade a package
os.system("rpm -Uvh glibc-2.14.1-6.x86_64.rpm glibc-common-2.14.1- 6.x86_64.rpm glibc-devel-2.14.1-6.x86_64.rpm glibc-headers-2.14.1-6.x86_64.rpm")

//Set the on (start) service, chkconfig is not followed by action, Just with the noun is check, with action, state is to set

chkconfig postgresql on

//Start the service
service postgresql start







Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327006385&siteId=291194637