Updated on 2025-08-05 GMT+08:00

Downloading Packages from Self-Hosted Repos to the Client

The repository password for a self-hosted repo is account-specific. If you are prompted for a password when using different accounts, download the configuration file from the repository's Tutorial tab to obtain it.

Downloading a Maven Artifact to the Client

The client tool is Maven. Ensure that the JDK and Maven have been installed.

  1. Download the settings.xml file from the self-hosted repo page and replace the downloaded configuration file with the new one or modify the settings.xml file of Maven as prompted.

  2. Download the client.

    mvn dependency:get -DremoteRepositories={repo_url} -DgroupId={groupId} -DartifactId={artifactId} -Dversion={version} -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

Downloading an npm Package to the Client

The client tool is npm. Ensure that Node.js (or io.js) and npm have been installed.

  1. Download the NPMRC file from the self-hosted repo page and save the downloaded NPMRC file as an .npmrc file.

  2. Copy the file to the user directory. In Linux, the path is ~/.npmrc. In Windows, the path is C:\Users\<UserName>\.npmrc.
  3. Go to the npm project directory (where the package.json file is stored) and run the following commands to download the npm dependency:

    npm config set strict-ssl false
    npm install ––verbose

Downloading a PyPI Package to the Client

The client tools are Python and PIP. Ensure that Python and PIP have been installed.

  1. Download the pip.ini file from the self-hosted repo page and copy the file to the user directory. In Linux, the path is ~/.pip/pip.conf (C:\Users\<UserName>\pip\pip.ini on Windows)

  2. Install Python:

    pip install {package name}

Downloading a Go Package to the Client

Certificate verification cannot be bypassed on the Go client. You need to add the domain name certificate corresponding to the self-hosted repo to the local certificate trust list and perform the following steps to add the trust certificate:

  1. Export the certificates.

    openssl s_client -connect {host}:443 -showcerts </dev/null 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' |openssl x509 -outform PEM >mycertfile.pem
    openssl x509 -outform der -in mycertfile.pem -out mycertfile.crt

    mycertfile.pem and mycertfile.crt are the downloaded certificates.

  2. Add the certificates to the root certificate trust list.
  3. Run the go commands to download the dependency:

    ##1. Packages of versions earlier than v2.0
    go get -v <moudlename>
    ##2. v2.0 and later versions
    ##a. The ZIP package contains go.mod and the path ends with /vN.
    go get -v {{moduleName}}/vN@{{version}}
    ##b. The ZIP package does not contain go.mod or the first line in go.mod does not end with /vN.
    go get -v {moduleName}}@{{version}}+incompatible

Downloading an RPM Package to the Client

The following section uses the RPM package from Uploading an RPM Package to the Client as an example to describe how to obtain dependencies from the RPM repository.

  1. Download the RPM configuration file by referring to 2 and 3.
  2. 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.
  3. Save the modified configuration file to the /etc/yum.repos.d/ directory on the Linux host.

  4. Download the RPM package: Replace hello with the actual value of component.

    yum install hello

Downloading a Conan Package to the Client

  1. Select the target Conan repository from the self-hosted repo page and click Tutorial on the right to download the configuration file.

    You can replace local Conan configurations with the obtained configuration file (the path is ~/.conan/remotes.json in Linux or C:\Users\<UserName>\.conan\remotes.json in Windows).

  2. Download the Conan dependency from the remote repository:

    $ conan install ${package_name}/${package_version}@${package_username}/${channel} -r=cloud_artifact

  3. Check the downloaded Conan package:

    $ conan search "*"

  4. Remove the package from the local cache:

    $ conan remove ${package_name}/${package_version}@${package_username}/${channel}

Downloading a NuGet Package to the Client

Ensure that you have installed the NuGet.

  1. Select the target NuGet repository from the self-hosted repo page and click Tutorial on the right to download the configuration file NuGet.txt.

  2. Open the file, find the command under NuGet add source, and add the source.

    ##----------------------NuGet add source----------------------##
    nuget sources add -name {repo_name} -source{repo_url} -username {user_name} -password {repo_password}

  3. Open the file, find the statement under NuGet Download, replace <PACKAGE> with the name of the package to be downloaded, and run the download statement. (If a configuration source exists, use the configured source name as the parameter following -source.)

    ##----------------------NuGet Download----------------------##
    nuget install <PACKAGE>

Downloading a .NET Package to the Client

Ensure that you have installed the .NET.

  1. Select the target NuGet repository from the self-hosted repo page and click Tutorial on the right to download the configuration file dotnet.txt.

  2. Open the configuration file, find the command under dotnet add source, and add the source.

    ##----------------------dotnet add source----------------------##
    dotnet nuget add source {repo_url} add -n {repo_name} -u {user_name} -p {repo_password}

  3. Find the statement under dotnet download, replace < PACKAGE > with the name of the package to be downloaded, and run the download statement.

    ##----------------------dotnet download----------------------##
    dotnet add package <PACKAGE>

Downloading a Docker Image to the Client

Prerequisites

  • You have installed the Docker client.
  • You have created a Docker registry in the self-hosted repo.

Downloading a Docker image to the client

Run the following command on the local client to download the Docker image:

docker pull {url}/${image_name}:${image_version}

url: repository URL, as shown in the following figure.

image_name: component name.

image_version: component version.

Downloading a Generic Package to the Client

Download the client.

curl -o {{localFileName}} -k -u "{{username}}:{{password}}" -X GET {{repo_url}}/{{filePath}}

localFileName: local path (including the name) for downloading the Generic package.

filePath: path (including the name) of the package in the Generic repository.

Obtain the values of username, password, and repo_url from the downloaded generic.txt file in 2, as shown in the following figure.

Downloading a CocoaPods Package to the Client

Prerequisites

  • You have installed the Ruby client and cocoapods-art plug-in.
  • You have created a CocoaPods repository in the self-hosted repo.

Downloading the provided configuration file to download CocoaPods packages

  1. Select the target CocoaPods repository from the self-hosted repo page and click Tutorial on the right of the page.
  2. Select Download the provided configuration file and click Download Configuration File to download the cocoapods.txt file.
  3. In the Select purpose area, click Download.
  4. Download the local client.

    1. Perform Cocoapods authentication:
      sudo sh -c " echo 'machine {url}
      login {username}
      password {password}' > <.cocoapods_path>/.netrc"

    2. Download the package from the remote repository:
      pod repo-art add {package_name} "{url}"

      package_name: name of the CocoaPods dependency to be downloaded.

      url: repository URL of the self-hosted repo.

    1. Download the artifacts from the CocoaPods repository.
      pod repo-art update {package_name} {url}

      package_name: The CocoaPods dependency cannot be modified.

      url: enter the repository URL of the target self-hosted repo.

    1. Query the downloaded package:
      pod repo-art list
    1. Remove the local dependency:
      pod repo-art remove <repo-name>//repo-name: name of the CocoaPods dependency

Following the command line configuration to download the CocoaPods package

  1. Select the target CocoaPods repository from the self-hosted repo page and click Tutorial on the right of the page.
  2. Select Follow the command line configuration.
  3. Check whether the Rudy client has been installed:

    rudy -v

  4. Install the cocoapods-art plug-in:

    sudo gem install cocoapods-art

  5. Add the self-hosted repo to your CocoaPods client:

    pod repo-art add <repo_name> "{url}"

    repo_name: name of the folder for storing packages of self-hosted repos on the local client.

    url: repository URL of the CocoaPods repository.

  6. In the Select purpose area, click Download.
  7. Download the local client.

    Download the package from the remote repository:

    pod repo-art update {package_name}//package_name: package name.

    Query the downloaded package:

    pod repo-art list

    Remove the local dependency:

    pod repo-art remove <repo-name>//repo-name: name of the CocoaPods dependency

Downloading an OHPM Package to the Client

Download the client.

ohpm install {package name}

package name: name parameter in the return value in Uploading an OHPM Package from the Client, as shown in the following figure.

The following figure indicates the download success.