User Tools

Site Tools


mywiki:linux:yumlocaliso

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mywiki:linux:yumlocaliso [2014/11/02 07:42] – [Step # 3: Create config file] shaoguohmywiki:linux:yumlocaliso [2022/04/02 17:29] (current) – external edit 127.0.0.1
Line 8: Line 8:
  
     yum install createrepo     yum install createrepo
-    mkdir -p /mnt/iso/{1,2,3} +    mkdir -p /mnt/dvd 
-    mount -o loop /path/to/centos1.iso /mnt/iso/1+    mount -o loop /dev/sr0/ /mnt/dvd 
 +    mkdir -p /var/ftp/pub/fedora-20-dvd 
 +    cp /mnt/dvd/ /var/ftp/pub/fedora-20-dvd/ -a
  
-====== Step # 2: Create a repository ======+====== Step # 2: Create config file ====== 
 +Create a repo config file in **/etc/yum.repos.d/local.repo.
  
-Use createrepo to generate the necessary XML metadata. Type the following commands+Its content is as below
-    # cd /mnt/iso +<file> 
-    # createrepo . +[local-repo] 
-    #Clean repo, enter+name='local repo based on Fedora 20 DVD ISO' 
-    # yum clean all+baseurl=file:///var/ftp/pub/fedora-20-dvd 
 +enabled=1 
 +gpgcheck=0 
 +</file>
  
-====== Step # 3: Create config file ======+====== Test ====== 
 +#yum repolist all
  
-You need to create a repo config file in **/etc/yum.repos.d/** directory. +Its print log is like below:
-    vi /**etc/yum.repos.d/iso.repo**+
  
-Append following text: 
 <file> <file>
-[My ISO Repository+ 
-baseurl=file:///mnt/iso +[shaoguoh@localhost yum.repos.d]$ yum repolist all 
-enabled=1+Loaded pluginslangpacks, refresh-packagekit 
 +repo id                     repo name                                                status 
 +fedora/20/x86_64            Fedora 20 - x86_64                                       enabled: 38,597 
 +fedora-debuginfo/20/x86_64  Fedora 20 - x86_64 - Debug                               disabled 
 +fedora-source/20/x86_64     Fedora 20 - Source                                       disabled
 </file> </file>
-Save and close the changes. 
  
-Now use yum command to install packages from ISO images:+local-repo                local repo based on Fedora 20 DVD ISO                 enabled 4,071 
 + 
 +<file> 
 + 
 +updates/20/x86_64           Fedora 20 - x86_64 - Updates                             enabled: 20,178 
 +updates-debuginfo/20/x86_64 Fedora 20 - x86_64 - Updates - Debug                     disabled 
 +updates-source/20/x86_64    Fedora 20 - Updates Source                               disabled 
 +updates-testing/20/x86_64   Fedora 20 - x86_64 - Test Updates                        disabled 
 +updates-testing-debuginfo/20/x86_64 Fedora 20 - x86_64 - Test Updates Debug          disabled 
 +updates-testing-source/20/x86_64    Fedora 20 - Test Updates Source                disabled 
 +repolist: 62,846 
 +</file> 
 + 
 # yum install package-name # yum install package-name
 +
 +<file>
 + sudo yum install tftp
 +Loaded plugins: langpacks, refresh-packagekit
 +</file>
 +
 +local-repo                                                 | 3.6 kB  00:00:00
 +
 +<file>
 +Resolving Dependencies
 +--> Running transaction check
 +---> Package tftp.x86_64 0:5.2-10.fc20 will be installed
 +--> Finished Dependency Resolution
 +
 +Dependencies Resolved
 +
 +============================================================================================================================
 + Package                   Arch                        Version                            Repository                   Size
 +============================================================================================================================
 +Installing:
 + tftp                      x86_64                      5.2-10.fc20                        fedora                       36 k
 +
 +Transaction Summary
 +============================================================================================================================
 +Install  1 Package
 +
 +</file>
mywiki/linux/yumlocaliso.1414885338.txt.gz · Last modified: (external edit)