Zypper Repository Setup: Difference between revisions

From Yocto Project
Jump to navigationJump to search
(Should be zypper refresh not update at the end)
(Add note about smart)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{| style="color:black; background-color:#ffcccc" width="100%" cellpadding="10" class="wikitable"
|'''NOTE:''' zypper has been replaced by smart for the upcoming 1.4 version. For 1.4 and newer, please see [[Smart Repository Setup]].
|}
== Requirements ==
== Requirements ==


Setting up a zypper repository from the rpm files created during a Poky build is fairly straightforward. You will need:
Setting up a zypper repository from the rpm files created during a Poky build is fairly straightforward. You will need:


* Apache 2 installed and configured (may not need too much configuration)
* Apache 2 installed and configured (may not need too much configuration); other http servers are available
* createrepo installed
* createrepo installed


Line 17: Line 21:
  </VirtualHost>
  </VirtualHost>


2. cd to the tmp/deploy/rpm directory
2. Reload apache configuration (<code>service httpd reload</code> as root on Fedora)
 
3. cd to the tmp/deploy/rpm directory
  cd /path/to/tmp/deploy/rpm/
  cd /path/to/tmp/deploy/rpm/


3. Create the repository data (if you're updating, add --update to save time)
4. Create the repository data (if you're updating, add --update to save time)
  createrepo .
  createrepo .


4. If you're using SELinux you need to label the files accessible via apache:
5. If you're using SELinux you need to label the files accessible via apache:
  chcon -R -h -t httpd_sys_content_t .
  chcon -R -h -t httpd_sys_content_t .


5. On the target machine add the zypper repo (where somealias is a local alias for the repo):  
6. On the target machine add the zypper repo (where somealias is a local alias for the repo):  
  zypper addrepo -t rpm-md http://server.name/rpm somealias
  zypper addrepo http://server.name/rpm somealias


6. Fetch the repository information:
7. Fetch the repository information:
  zypper refresh
  zypper refresh

Latest revision as of 13:47, 5 February 2013

NOTE: zypper has been replaced by smart for the upcoming 1.4 version. For 1.4 and newer, please see Smart Repository Setup.

Requirements

Setting up a zypper repository from the rpm files created during a Poky build is fairly straightforward. You will need:

  • Apache 2 installed and configured (may not need too much configuration); other http servers are available
  • createrepo installed

Steps

1. Add the directory to your apache config (/etc/httpd/conf/httpd.conf):

<VirtualHost *:80>
  ....
    Alias /rpm /path/to/tmp/deploy/rpm
    <Directory "/path/to/tmp/deploy/rpm/">
      Options +Indexes
    </Directory>
</VirtualHost>

2. Reload apache configuration (service httpd reload as root on Fedora)

3. cd to the tmp/deploy/rpm directory

cd /path/to/tmp/deploy/rpm/

4. Create the repository data (if you're updating, add --update to save time)

createrepo .

5. If you're using SELinux you need to label the files accessible via apache:

chcon -R -h -t httpd_sys_content_t .

6. On the target machine add the zypper repo (where somealias is a local alias for the repo):

zypper addrepo http://server.name/rpm somealias

7. Fetch the repository information:

zypper refresh