Uploading/Obtaining an RPM Component Using Linux Commands
This section describes how to use Linux commands to upload a component to a self-hosted RPM repo and obtain a dependency from the repository.
Prerequisites
- An RPM component is available.
- A Linux host that can connect to the public network is available.
- You have created a self-hosted RPM repo.
Releasing a Component to a Self-Hosted RPM Repo
- Log in to the DevCloud homepage and access the self-hosted RPM repo. Click Operation Guide on the right of the page.
- In the dialog box that is displayed, click Download Configuration File.
- On the Linux host, run the following command to upload an RPM component:
curl -u {{user}}:{{password}} -X PUT https://{{repoUrl}}/{{component}}/{{version}}/ -T {{localFile}}
In this command, user, password, and repoUrl can be obtained from the RPM upload command in the configuration file downloaded in the previous step.
- user: character string before the colon (:) between curl -u and -X
- password: character string after the colon (:) between curl -u and -X
- repoUrl: character string between https:// and /{{component}}
component, version, and localFile can be obtained from the RPM component. The hello-0.17.2-54.x86_64.rpm component is used as an example.
- component: software name, for example, hello.
- version: software version, for example, 0.17.2.
- localFile: RPM component, for example, hello-0.17.2-54.x86_64.rpm.
The following figure shows the complete command.
- After the command is successfully executed, go to the self-hosted repo and find the uploaded RPM component.
Obtaining a Dependency from a Self-Hosted RPM Repo
The following procedure uses the RPM component released in Releasing a Component to a Self-Hosted RPM Repo as an example to describe how to obtain a dependency from a self-hosted RPM repo.
- Download the configuration file of the self-hosted RPM repo by referring to Releasing a Component to a Self-Hosted RPM Repo.
- Open the configuration file, replace all {{component}} in the file with the value of {{component}} (hello in this file) used for uploading the RPM file, delete the RPM upload command, and save the file.
- Save the modified configuration file to the /etc/yum.repos.d/ directory on the Linux host.
- Run the following command to download the RPM component: Replace hello with the actual value of component.
yum install hello
Feedback
Was this page helpful?
Provide feedbackFor any further questions, feel free to contact us through the chatbot.
Chatbot