Page Contents

Overview

Bintray is a fully-fledged YUM repository for RPM packages and works seamlessly with the YUM client. You can use the YUM client to resolve RPM packages from Bintray, and upload RPM packages using any compatible command line tool such as cURL.

Tip
To get code snippets formulated for your specific username and repository, use the Set Me Up button.

Downloading Files

To download files using Bintray’s REST API, please refer to Downloading Using APIs.

Resolving RPM Packages with YUM

You can resolve RPM packages from Bintray in two ways:

  • Run the following to get a generated .repo file:

wget https://bintray.com/[USERNAME]/<REPOSITORY_NAME>/rpm -O bintray-[USERNAME]-<REPOSITORY_NAME>.repo

or

  • Copy the snippet below into a bintray-[USERNAME]-<REPOSITORY_NAME>.repo file on your Linux machine:

#bintray-[USERNAME]-<REPOSITORY_NAME> - packages by jaycroaker from Bintray
[bintray-USERNAME-REPOSITORY_NAME]
name=bintray-[USERNAME]-<REPOSITORY_NAME>
baseurl=https://dl.bintray.com/[USERNAME]/<REPOSITORY_NAME>
gpgcheck=0
enabled=1

sudo mv  bintray-[USERNAME]-<REPOSITORY_NAME>.repo /etc/yum.repos.d/

Uploading Files

Distributing files via Bintray includes three steps: creating a version, uploading the files and publishing the files as follows:

  1. Creating a Version: Uploaded files are associated with a specific version of a package. In some cases, the upload process creates the version automatically; in other cases you need to create a target version through the Bintray UI or using the REST API.

  2. Uploading: You can upload (or deploy) your files using cURL as described below. After uploading your files, the files have a status of "un-published". This means that in the Bintray UI, they are only visible to you and can only be downloaded with your username and API Key. While your uploaded files are still "un-published", you can still discard them before anyone sees or downloads them. The Bintray UI indicates files that are un-published and provides links to publish or discard them.

  3. Publishing: Once you are ready to expose your uploaded files, you can publish them and make them visible and available to all Bintray users. Files can be published via the Bintray UI, or via the REST API, both as part of the upload, or separately. In some cases, uploading the files publishes them automatically, so you can skip this step.

The cURL command to upload RPM packages is as follows:

 curl -T <FILE.EXT> -ujaycroaker:<API_KEY> https://api.bintray.com/content/[USERNAME]/<REPOSITORY_NAME>/<PACKAGE_NAME>/<VERSION_NAME>/<FILE_TARGET_PATH>

Once the file is uploaded, Bintray automatically calculates the repository-wide RPM metadata.

YUM Groups

A YUM group is a set of RPM packages collected together for a specific purpose. For example, you might collect a set of "Development Tools” together as a YUM group. A group is specified by adding a groups XML file that contains the metadata of the group including pointers to all the RPM packages that it includes.

You can create a YUM repository with a group built in, using the yum_groups_file parameter in the Create Repository REST API call.

Bintray supports attaching a YUM Group file to the YUM calculation essentially mimicking the createrepo -g command. A group file can also be created by running the following command:

 sudo yum-groups-manager -n "My Group" --id=mygroup --save=mygroups.xml --mandatory yum glibc rpm

Attaching YUM Groups

The process of attaching YUM group metadata to a repository is simple:

  1. Create an XML file in the groups format used by YUM. You can either just type it out manually using any text editor, or run the yum-groups-manager command from yum-utils.

  2. Deploy the created XML groups file to one of the repository’s repodata folders (note that you may only deploy one YUM groups file to each repodata folder in the repository).
    Make sure your groups file name matches the name specified in your RPM repository configuration.

    YUM groups file

  3. Manually invoke a YUM metadata calculation on the repository.

The metadata calculation performs the following actions:

  • Creates the corresponding .gz file and deploys it next to the deployed group XML file.

  • Attaches the group information (both the XML and the .gz file) to the repomd.xml file.

YUM Group Commands

The following table lists some useful YUM group commands:

Command Descripton

yum groupinstall <Group ID>

Install the YUM group. The group must be deployed to the root of the YUM local repository.

yum groupremove <Group ID>

Remove the RPM group

yum groupinfo <Group ID>

List the RPM packages within the group.

yum grouplist | more

List the YUM groups

Setting Group Properties

YUM group properties can be set in the /etc/yum.config file as follows:

Setting Allowed values Description

overwrite_groups

0 or 1

Determines YUM’s behavior if two or more repositories offer package groups with the same name:
- If set to 1 then the group packages of the last matching repository will be used.
- If set to 0 then the groups from all matching repositories will be merged together as one large group.

groupremove_leaf_only

0 or 1

Determines YUM’s behavior when the groupremove command is run.
- If set to 0 (default) then all packages in the group will be removed.
- If set to 1 then only those packages in the group that aren’t required by another package will be removed.

enable_group_conditionals

0 or 1

Determines whether YUM will allow the use of conditionals packages.
- If set to 0 then conditionals are not allowed
- If set to 1 (default) package conditionals are allowed.

group_package_types

optional, default, mandatory

Default: default, mandatory
Tells YUM which type of packages in groups will be installed when groupinstall is called.