Create a simple APT Repository

Source: Internet
Author: User

Create a simple APT Repository

As part of my work, my maintained patheat ider relies on some features in cURL and PycURL that have just been merged or are still waiting to be merged. I need to build a Docker container that contains these Debian packages, so I need to quickly build an APT repository.

The Debian repository is essentially a static website and the content is signed by GPG, so it doesn't have to be hosted in a trusted place (unless availability is critical to your program ). I host my blog on Netlify (a static website host). I think it is suitable for this situation. They also support open-source projects.

You can use the following command to install the netlify CLI tool:

  1. sudo apt install npm
  2. sudo npm install -g netlify-cli

To set a repository, follow these steps:

  1. mkdir repository
  2. cp/path/to/*.deb repository/
  3. cd repository
  4. apt-ftparchive packages . > Packages
  5. apt-ftparchive release . > Release
  6. gpg --clearsign -o InRelease Release
  7. netlify deploy

After completing these steps and creating a new website on Netlify, you can also manage the website through the Web interface. You may want to set a custom domain name for your repository, or use Let's Encrypt to enable HTTPS. (If You Want To enable HTTPS, make sure the command containsapt-transport-https.)

To add this repository to your apt Source:

  1. gpg --export-a YOURKEYID |sudo apt-key add -
  2. echo"deb https://SUBDOMAIN.netlify.com/ /"|sudotee-a /etc/apt/sources.list
  3. sudo apt update

You will find that these software packages can be installed. Pay attention to APT pinnng, because you may find that the newer versions in the repository are not the preferred ones according to your policy.

Update: If you want a solution that is more suitable for normal use, refer to repropro. If you want end users to add your apt repository to their system as a third-party repository, view this page On Debian wiki, this section describes how to instruct users to use your repository.

Update 2: One reviewer pointed out that aptly provides more features and removes some repropro restrictions. I have never used aptly, so I can't comment on details, but from the perspective of the website, this is a good tool.

Via: https://iain.learmonth.me/blog/2017/2017w383/

Author: Iain R. Learmonth Translator: geekpi Proofreader: wxy

This article was originally compiled by LCTT and launched with the honor of Linux in China

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.