如何通过linux存储库安装我的程序(例如,使用apt-get)?

时间:2021-11-06 20:49:59

I have created a program and I would like it to be installable via commands such as 'apt-get' on linux, but I have no idea where to even begin to achieve this. Could someone help and explain what I need to do to achieve this?

我已经创建了一个程序,我希望它可以通过Linux上的'apt-get'等命令进行安装,但我不知道在哪里开始实现这一点。有人可以帮助解释我需要做些什么才能实现这一目标吗?

Thanks.

谢谢。

1 个解决方案

#1


4  

To be able to install your own package via apt-get you need to:

要通过apt-get安装自己的软件包,您需要:

  1. Package your application as a deb.
  2. 将您的申请打包为deb。
  3. Add your package to an apt-repository.
  4. 将您的包添加到apt-repository。
  5. Configure your distribution to use said apt-repository.
  6. 配置您的发行版以使用所述apt-repository。

Creating a package and a repository takes a bit of work. A step by step will be quite long and depend a lot on the app your packaging. There are multiple ways of creating packages, and multiple ways of creating repositories. In general though, here are some pointers for utilities that can help you:

创建包和存储库需要一些工作。一步一步将很长,并且很大程度上取决于你的包装。有多种创建包的方法,以及多种创建存储库的方法。一般来说,这里有一些可以帮助您的实用程序的指针:

Creating packages:

创建包:

Have a look at FPM. It's a nice and easy utility that can create packages for multiple formats, including deb. Have a look at this guide for an idea of how to use it.

看看FPM。这是一个很好的简单实用程序,可以创建多种格式的包,包括deb。请查看本指南,了解如何使用它。

Creating a repository:

创建存储库:

I've mostly used reprepro for this in the past. Check out this guide. The above guide also includes how to use the repo after it has been published.

我过去主要使用reprepro。查看本指南。上述指南还包括如何在发布后使​​用回购。

#1


4  

To be able to install your own package via apt-get you need to:

要通过apt-get安装自己的软件包,您需要:

  1. Package your application as a deb.
  2. 将您的申请打包为deb。
  3. Add your package to an apt-repository.
  4. 将您的包添加到apt-repository。
  5. Configure your distribution to use said apt-repository.
  6. 配置您的发行版以使用所述apt-repository。

Creating a package and a repository takes a bit of work. A step by step will be quite long and depend a lot on the app your packaging. There are multiple ways of creating packages, and multiple ways of creating repositories. In general though, here are some pointers for utilities that can help you:

创建包和存储库需要一些工作。一步一步将很长,并且很大程度上取决于你的包装。有多种创建包的方法,以及多种创建存储库的方法。一般来说,这里有一些可以帮助您的实用程序的指针:

Creating packages:

创建包:

Have a look at FPM. It's a nice and easy utility that can create packages for multiple formats, including deb. Have a look at this guide for an idea of how to use it.

看看FPM。这是一个很好的简单实用程序,可以创建多种格式的包,包括deb。请查看本指南,了解如何使用它。

Creating a repository:

创建存储库:

I've mostly used reprepro for this in the past. Check out this guide. The above guide also includes how to use the repo after it has been published.

我过去主要使用reprepro。查看本指南。上述指南还包括如何在发布后使​​用回购。