Local installation of .rpms using YUM

  • I'm asking this question cautiously because I don't want to get this wrong.

    I have a program_name.rpm file saved locally on my server (CentOS 6.5).

    I have installed it previously just by navigating to it and using yum install program_name.rpm which worked fine but it didn't give me any option to specify where it is installed.

    Is it possible to install this rpm to /opt/some_directory instead of it's default install location?

  • Romeo Ninov

    Romeo Ninov Correct answer

    6 years ago

    Use rpm

    rpm -ivh package.rpm
    

    If you want to install it on different place use:

    rpm -ivh -r /new/path package.rpm
    

    but be aware under new root will be recreated the directory structure from package

    this worked great, I don't suppose there is a YUM equivalent?

    To clarify: yum is wrapper around rpm. rpm is the main program to manage packaged in RHEL, SuSE, CentOS and other distributions

    Oh I always thought yum was based on rpm, never realized it was a wrapper, thanks for all your help

    Do you have to be root to run this command?

    Correct, you must be root to run the command

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM