mywiki:linux:yumlocaliso
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| mywiki:linux:yumlocaliso [2014/11/02 07:40] – created shaoguoh | mywiki:linux:yumlocaliso [2022/04/02 17:29] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| Setup yum repositories to update or install package from Local ISO Image | Setup yum repositories to update or install package from Local ISO Image | ||
| - | Creation of yum repositories is handled by a separate tool called createrepo, which generates the necessary XML metadata. If you have a slow internet connection or collection of all downloaded ISO images, use this hack to install rpms from iso images. | + | Creation of yum repositories is handled by a separate tool called |
| ====== Step # 1: Mount an ISO file ====== | ====== Step # 1: Mount an ISO file ====== | ||
| 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 | + | mount -o loop /dev/sr0/ /mnt/dvd |
| + | mkdir -p /var/ | ||
| + | cp / | ||
| - | ====== Step # 2: Create | + | ====== Step # 2: Create |
| + | Create a repo config file in **/ | ||
| - | Use createrepo to generate the necessary XML metadata. Type the following commands: | + | Its content is as below: |
| - | # cd /mnt/iso | + | < |
| - | # createrepo . | + | [local-repo] |
| - | # | + | name=' |
| - | # yum clean all | + | baseurl=file:/// |
| + | enabled=1 | ||
| + | gpgcheck=0 | ||
| + | </ | ||
| - | ====== | + | ====== |
| + | #yum repolist all | ||
| - | You need to create a repo config file in / | + | Its print log is like below: |
| - | vi / | + | |
| - | Append following text: | ||
| < | < | ||
| - | [My ISO Repository] | + | |
| - | baseurl=file:///mnt/iso | + | [shaoguoh@localhost yum.repos.d]$ yum repolist all |
| - | enabled=1 | + | Loaded plugins: langpacks, refresh-packagekit |
| + | repo id repo name status | ||
| + | fedora/20/x86_64 | ||
| + | fedora-debuginfo/20/x86_64 | ||
| + | fedora-source/ | ||
| </ | </ | ||
| - | Save and close the changes. | ||
| - | Now use yum command to install packages from ISO images: | + | local-repo |
| + | |||
| + | < | ||
| + | |||
| + | updates/ | ||
| + | updates-debuginfo/ | ||
| + | updates-source/ | ||
| + | updates-testing/ | ||
| + | updates-testing-debuginfo/ | ||
| + | updates-testing-source/ | ||
| + | repolist: 62,846 | ||
| + | </ | ||
| + | |||
| # yum install package-name | # yum install package-name | ||
| + | |||
| + | < | ||
| + | sudo yum install tftp | ||
| + | Loaded plugins: langpacks, refresh-packagekit | ||
| + | </ | ||
| + | |||
| + | local-repo | ||
| + | |||
| + | < | ||
| + | Resolving Dependencies | ||
| + | --> Running transaction check | ||
| + | ---> Package tftp.x86_64 0: | ||
| + | --> Finished Dependency Resolution | ||
| + | |||
| + | Dependencies Resolved | ||
| + | |||
| + | ============================================================================================================================ | ||
| + | | ||
| + | ============================================================================================================================ | ||
| + | Installing: | ||
| + | | ||
| + | |||
| + | Transaction Summary | ||
| + | ============================================================================================================================ | ||
| + | Install | ||
| + | |||
| + | </ | ||
mywiki/linux/yumlocaliso.1414885250.txt.gz · Last modified: (external edit)
