Solution yum offline installation package dependencies

shell, but do not use yum to install, because yum install required network, some scenarios are offline, so we use offline installation, the next Yum package off the required packages and dependencies.

[ Yum] offline installation method to solve dependencies

The solution is , download all the required rpm package and its dependencies, copied to the target machine is installed, and then set up a local yum repository, delete the local repository after installation is complete.

Reverse Proxy required:  nginx keepalived

Required to build a warehouse:  the createrepo

First, a new CentOS7 mini virtual machine, network download all the required rpm packages and its dependencies

#yum -y install epel-release

#mkdir /root/abc

#yum -y install createrepo --downloadonly --downloaddir=/root/abc

#yum -y install nginx keepalived --downloadonly --downloaddir=/root/abc

 

注: yum  -y  install   XXX    --downloadonly    --downloaddir=/XXX

Installation package xxx to download / xxx position, then remember to specify --downloadonly, just download, no installation. This method will be based on the primary package and your current operating system missing dependencies package together download! Based on your current operating system, meaning that different versions of the operating system (desktop, mini version, etc.) downloaded software dependencies number will be different! The more your operating system has been installed package, then the next down will depend on fewer, so please choose a suitable base operating system!

 

After the download is complete, we can see that there are under / root / abc more rpm packages (the main package and its dependencies), then we use these rpm package to build a local yum repository.

 

Second, copy the downloaded rpm package to the offline target machine (assumed to be / root / abc), setting up a local yum repository (I use xftp direct drag past)

 

The target machine system comes with a warehouse file transfer backup

# mkdir /etc/yum.repos.d/backup

# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup

# yum clean all

Installation packages required to build warehouses, the primary package for the createrepo, install the following order:

 

# Run the following command

  cd /root/abc

  rpm -qa | grep libxml2 | xargs rpm -e --nodeps

  rpm -qa | grep deltarpm| xargs rpm -e --nodeps

  rpm -ivh  deltarpm-3.6-3.el7.x86_64.rpm

  rpm -ivh  python-deltarpm-3.6-3.el7.x86_64.rpm

 

  rpm -ivh  libxml2-2.9.1-6.el7_2.3.x86_64.rpm

  rpm -ivh  libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm

More than two command was not successful, because there is no corresponding .rpm file

 

  

rpm -ivh  createrepo-0.9.9-28.el7.noarch.rpm

Similarly, the lack of dependence of the first two, the first two commands need to install

 

Solution: After downloading the two files, and then re-execute the above 3 commands

 

Proceed with the following command:

# mkdir -p /var/ftp/pub/localrepo

# cp -f /root/abc/* /var/ftp/pub/localrepo

# touch /etc/yum.repos.d/localrepo.repo

#echo "[localrepo]"  >>/etc/yum.repos.d/localrepo.repo

#echo "name=Local Repository" >>/etc/yum.repos.d/localrepo.repo

#echo "baseurl=file:///var/ftp/pub/localrepo" >>/etc/yum.repos.d/localrepo.repo

#echo "gpgcheck=0" >>/etc/yum.repos.d/localrepo.repo

#echo "enabled=1"  >>/etc/yum.repos.d/localrepo.repo

 

#createrepo -v /var/ftp/pub/localrepo

#yum repolist

 

 

Third, the use of local yum repository, install the required packages

Because we have used our software and its required dependencies build a local repository, the installation process yum will order themselves dependent packages installed. createrepo installed above, below no longer loaded.

# yum -y install nginx  keepalived

 

 

Fourth, the installation is complete, remove the set up of a local yum repository, yum repository file system recovery

# rm  -rf /var/ftp/pub/localrepo

# rm  -rf /etc/yum.repos.d/localrepo.repo

# mv  /etc/yum.repos.d/backup/*.repo   /etc/yum.repos.d/

# rm  -rf /etc/yum.repos.d/backup

# yum clean all

 

 

 

 

Guess you like

Origin www.cnblogs.com/rong2019/p/11908374.html