Linux offline software installation

Local yum file, install
yum offline

Download a package to a specified directory (such as /tmp):
sudo yum install --downloadonly --downloaddir=/tmp
Note that yum will download all dependency packages to the directory you specify, but none Is installed.
In CentOS/RHEL 6 or earlier versions, you need to install a separate yum plugin (yum-plugin-downloadonly) to use –downloadonly, otherwise the following error will be reported:
Command line error: no such option: --downloadonly
command:
sudo yum install yum-plugin-downloadonly install this tool.
Usage: yum -y install --downloadonly --downloaddir=/tmp/aa httpd to download all the software packages and the downloaded directory. It is convenient for subsequent yum database creation and offline yum installation. *

##############################################################################################################

Yumdownloader

Another way to download RPM packages is through a special package download tool-yumdownloader. This tool is a subset of the yum toolkit (contains a suite of help tools for yum package management).
sudo yum install yum-utils
downloads an RPM package: The package downloaded by
sudo yumdownloader
will be saved in the current directory. Unlike the yum command, any dependent packages will not be downloaded.
Example of downloading bzip2:
yumdownloader bzip2
If you need to download dependencies:
yumdownloader httpd --resolve --destdir=/tmp/aa

Author: laity -
Source: CSDN
Original: https://blog.csdn.net/YH_7059/article/details/83784277
Copyright: This article is a blogger original article, reproduced, please attach Bowen link!
############################################## ############################################## ##########

Create a repodata file, which is a process of creating an index for a data packet, so it is also a bit slow.

mkdir /packages/Packages/ Here are all the packages, dependent packages, offline installation (YUM)
createrepo -p -d -o /packages/ /packages/Packages/ is
created in /etc/yum.repo.d/ Create a file ending with .repo in the directory. The writing format is the same as above,
[dvd1]
name=dvd1
baseurl=file:///packages/
enabled=1
gpgcheck=0

After saving, you can use yum, the first one is fine. You can use this method to make DVD2, epel's yum source, and you're done when all three are done! ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
Here is a point: to
install createrepo, use its default repo file. When the repo file of DVD1 is ready, you need to move its default repo file to a place.

You can also use the command: createrepo -p /tmo/aa/ to generate the database file like this
############################## #################################################################################################################################################################################################################################################### ############################################## ###########################

When installing the software, it will still prompt if there are any dependent packages? ? ? , Here you can copy the name of the dependent package and then download it again until the installation is complete.
yum deplist httpd lists all the dependencies of the software, and then download it again! ! ! ! ! ! ! ! ! ! !

Finally, all the software packages are placed in a file, you can use createrepo -p /tmo/aa/ to generate the database file,
and then clear the cache, yum clean all refresh the cache yum repolist.
Now you can install your own software offline, just like the software package under windows, where you go and where you can install it.

Guess you like

Origin blog.csdn.net/Connor_xie/article/details/97618205