1

I understand how to install an rpm from a given url. Example: RUN yum -y install http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

So that is the easy part.

My question is, how do I do the exact same thing, only with the rpm folder living on my server, and not on a URL

the path on the server for example is /var/opt/project/sphinx-1.3.2-1.x86_64.rpm

I have tried RUN rpm -ivh /var/opt/project/sphinx-1.3.2-1.x86_64.rpm But this returns no file or directory.
How can I install the rpm from the server I am on?

  • what is the output from above command? – taliezin Mar 19 '15 at 16:09
  • Here is what I get: RUN rpm -ivh ./sphinx-1.3.2-1.x86_64.rpm ---> Running in 4c4a63fc8ad8 error: open of ./sphinx-1.3.2-1.x86_64.rpm failed: No such file or directory I have also tried with using /var/opt/project/sphinx-1.3.2-1.x86_64.rpm I guess another part of the question is when you say rpm -ivh (path) is that the absolute path ? – Steven Mar 19 '15 at 16:21
  • and this file sphinx-1.3.2-1.x86_64.rpm exists? – taliezin Mar 19 '15 at 16:24
  • What is this RUN you refer to. Do you type that in a terminal? – Anthon Mar 19 '15 at 16:26
  • The run command is in my dockerfile. The dockerfile is a set of instructions to be executed. so inside of the Dockerfile i tell it RUN rpm -ivh /var/opt/project/sphinx-1.3.2-1.x86_64.rpm But i keep getting /var/opt/project/sphinx-1.3.2-1.x86_64.rpm failed: No such file or directory The dockerfile itself is also located in /var/opt/project – Steven Mar 19 '15 at 16:31
1

Your command is correct - rpm -ihv <path to RPM file>. You can also use yum localinstall <path to RPM file>. You may be looking in the wrong place for the file, or it may not be the file you think it is if you're getting a "no such file or directory" error. You could also have a problem with your path wherein the rpm executable isn't being located.

  • I have triedboth ways, with the absolute path, and no path at all just placing the file in the same directory as the Dockerfile. Both return no file or directory. I did a pwd command in the directory with the file and it says /var/opt/project When you cd into /var/opt/project then do an ls -a command the file isthere. Could it be an issue that these commands are being ran from a Dockerfile, although I specified the absolute path, perhaps i did that wrong. The command looks exactly like this RUN rpm -ivh /var/opt/project/sphinx-1.3.2-1.x86_64.rpm sphinx.rpm is located in /var/opt/project – Steven Mar 19 '15 at 17:13
  • The command [/bin/sh -c rpm -ivh /var/opt/project/sphinx-1.3.2-1.x86_64.rpm] returned a non-zero code: 1 – Steven Mar 19 '15 at 17:16
  • As it turns out this is the correct answer. The issue I had was that this was being ran in a docker container and not on the server where the file was. So I needed to volume mount the file into the container, once I figured that part out, it worked with the commands you provided. – Steven Mar 19 '15 at 20:02
0

Check whether rpm file is present in the following directory, In your case it is located in /var/opt/project/ .

following no file or directory error return becoz it is unable to find the sp*.rpm file from the /var/opt/project/ directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.