Use CentOS ISO VPS image to build a local yum repository
Here to share the use of iso image to build a local yum warehouse simple steps:
Firs the preparatory work
Download or copy CentOS or RedHat iso image to the local, such as /usr/local/src/CentOS-6.4-x86_64-bin-DVD1.iso
Second, mount iso image
â new mount directory:
mkdir -p /mnt/cdrom1
â¡ direct editing / etc / fstab file (please edit the backup please), add the following:
#Mount iso
/usr/local/src/CentOS-6.4-x86_64-bin-DVD1.iso /mnt/cdrom1 iso9660 loop,defaults 0 0
â¡ the implementation of mount-a automatically detect and activate the mount, if not reported, the implementation of df-h can see the results.
Third, configure and refresh the yum warehouse
â , add yum configuration file:
Ps: completely offline, it is recommended to delete (remove) all online yum source: mv -f /etc/yum.repos.d/* / home /vim /etc/yum.repos.d/local.repo Paste the following, the third line said iso mount directory:
[local-yum]
name=Local Repository
baseurl=file:///mnt/cdrom1
enabled=1
gpgcheck=0
â¡ refresh Check yum is effective:
yum clean all && yum list
If no error above, then the local yum warehouse built, you can use [yum install software name] to install the required software, without the need for networking.
Fourth, a number of iso image approach:
Ps: The following only say that there are differences.
â when mounted, there are a few iso mount a few, such as CentOS 6.4 has two iso:
#Create 2 mount directories
mkdir -p /mnt/cdrom{1,2}
#Mount iso
/usr/local/src/CentOS-6.4-x86_64-bin-DVD1.iso /mnt/cdrom1 iso9660 loop,defaults 0 0
/usr/local/src/CentOS-6.4-x86_64-bin-DVD2.iso /mnt/cdrom2 iso9660 loop,defaults 0 0
#Activate the mount
mount -a
â¡ edit yum configuration file, the path needs to be changed to a path, such as:
[local-yum]
name=Local Repository
baseurl=file:///mnt/
enabled=1
gpgcheck=0
⢠create repo command to create a yum repository:
cd /mnt/
createrepo .
Related Tutorials
CentOS compiler installed under the Apache, PHP, MySQLLocating files on your Linux VPS system using whereis, which, whatis, readlink, find
Using SFTP protocol to access file on your VPS with Filezilla client
SNMP Master Agent setup on Centos 7.4 and Ubuntu 17.04
Enabling sudo for your user on Ubuntu 17.04 and CentOS 7.4