How to install Java on linux with no Internet connectivity (using local repository)
How to install Java on linux with no Internet connectivity (using local repository)
linux A: running in centos 6.6 and connected to the Internet
linux B: running in centos 6.6 and NOT connected to the Internet
here we download java package with dependencies from linux A which is connected to the Internet then configure local repository in linux B with the packages downloaded via linux A. At last java will be installed with dependencies by yum.
###################################################
# from linux A that is connected to the Internet
###################################################
1. install yum-utils for repotrack
yum install -y yum-utils
2. download packages along with all dependencies
repotrack -a x86_64 -p /tmp/packages createrepo java-1.7.0-openjdk
3. remove packages for i686 due to a bug in repotrack
rm -rf /tmp/packages/*i686.rpm
########################################################
# from laptop that is connected to both linux A and B
########################################################
1. copy the packages dir from linux A to local drive
scp -r user@linuxA:/tmp/packages ./
2. copy the packages dir from local drive to linux B
scp -r ./packages user@linuxA:/tmp/
##############################################
# from linux B NOT connected to the Internet
##############################################
1. install createrepo with its dependencies
cd /tmp/packages
rpm -Uvh deltarpm-*
rpm -Uvh python-deltarpm-*
rpm -Uvh libxml2-*
rpm -Uvh createrepo-*
2. change ownership for packages dir
chown -R root.root /tmp/packages
3. run createrepo to create local repo
createrepo /tmp/packages
chmod -R o-w+r /tmp/packages
4. set the repo configuration file
cat > /etc/yum.repos.d/myrepo.repo
------------------8<--------------------
[local]
name=My Local Repo
baseurl=file:///tmp/packages
enabled=1
gpgcheck=0
------------------8<--------------------
5. install java package
yum install java-1.7.0-openjdk

Designed by sketchbooks.co.kr / sketchbook5 board skin