How to make rpm auto install dependencies

前端 未结 11 1512
清酒与你
清酒与你 2020-12-07 07:59

I have built two RPM packages

  • proj1-1.0-1.x86_64.rpm
  • libtest1-1.0-1.x86_64.rpm

proj1 depends on

11条回答
  •  醉梦人生
    2020-12-07 08:03

    Create a (local) repository and use yum to have it resolve the dependencies for you.

    The CentOS wiki has a nice page providing a how-to on this. CentOS wiki HowTos/CreateLocalRepos.


    Summarized and further minimized (not ideal, but quickest):

    1. Create a directory for you local repository, e.g. /home/user/repo.
    2. Move the RPMs into that directory.
    3. Fix some ownership and filesystem permissions:

      # chown -R root.root /home/user/repo
      
    4. Install the createrepo package if not installed yet, and run

      # createrepo /home/user/repo
      # chmod -R o-w+r /home/user/repo
      
    5. Create a repository configuration file, e.g. /etc/yum.repos.d/myrepo.repo containing

      [local]
      name=My Awesome Repo
      baseurl=file:///home/user/repo
      enabled=1
      gpgcheck=0
      
    6. Install your package using

      # yum install packagename
      

提交回复
热议问题