开发者

Easy way to host a debian update repository

开发者 https://www.devze.com 2023-03-21 02:02 出处:网络
I have a project where I create a single .deb file, which should be installed by a linux client. For this I would like to use apt-get install mypackage.

I have a project where I create a single .deb file, which should be installed by a linux client. For this I would like to use apt-get install mypackage.

Being quite new to this area, I am now looking for the most simple way of hosting my own debian update repository, which will only have to contain mypackage.deb.

开发者_如何学运维I quickly looked at mini-dinstall which looked promising, but they seem to work with .changes, rather than .deb packages. So I am not sure if this is what I need.

So summarized the workflow should look something like this:

  1. I create the debian package mypackage.deb
  2. I tell some daemon to update the update repository: fancy-update-daemon add mypackage.deb
  3. The client is able to install or update using standard apt commands: apt-get install mypackage

Thanks for your help


The really simple way of creating a repository is to create a "trivial" repository instead of an "automatic" repository. You can do this with the "dpkg-scanpackages" command in the dpkg-dev package.

$ mkdir repository
$ cp foo.deb repository
$ dpkg-scanpackages repository /dev/null | gzip -9c > repository/Packages.gz

Then in your sources.list, instead of having something like:

deb http://wherever/repository suite component

You leave off the suite and component and just have:

deb http://wherever/repository

For more info (like the difference between a trivial and automatic repository) see The repository HOWTO (for something this simple, you can ignore the fact that this documentation calls itself "obsolete")


Create Packages.gz:

@server> cd debian-repo
@server> dpkg-scanpackages ./ /dev/null | gzip > Packages.gz

Create new file /etc/apt/sources.list.d/my-server.list (at client)

deb http://my-server/debian-repo ./

Now get the list of available packages and install foo.

@client> apt-get update
@client> apt-get install foo


.changes files are generated while building a debian package. A .changes file is not a package by itself: it contains information about the build (including .debs that were generated).

While I haven't used mini-dinstall, it seems like the right way to go. It should use the .deb files that were generated during the build and upload them correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号