Linux workflow "apt-get update"

I am developing an update / update service with a standalone SDK for Linux devices.

The idea is to replicate Linux update / update services to a standalone device. A “stand-alone” device is capable of reaching the “Internet”, but only through messaging using the SDK and other devices (multi-hop). Devices have different architectures, so a device that has "Internet" capabilities (a gateway) should be able to request and download packages that need to be updated to / from another architecture. the gateway device should be able to cache downloaded requested packets from updates (act like a CDN), avoiding repo requests.

A standalone device does not have an IP address, and the way it communicates does not matter, because a standalone SDK ensures that the Internet is accessible across multiple hosts.

What I need - I need someone to provide me some help or guidance on updating / updating a workflow on Linux.

What I have found so far:

  • Update

    • update command loads the file /etc/apt/sources.list
    • I don’t know how the update resolves every line in the /etc/apt/sources.list file, it looks like it has a function where it loads the “deb” “link” and “arguments” corresponding to the corresponding repo folders.
    • after that, it starts to download all the relevant “Packages” files in each allowed link.
  • refresh

    • maps updated local Batch files to Batch files in the repo.

Is there any source code for update / update? I did some search queries in apt repos, but I could not find update / update functions.

+5
source share
1 answer

@spectras As far as setting up a proxy server for a gateway is, it does not serve my purpose. A non-automatic device makes an update request by the gateway. We can assume that the gateway has no restrictions on the Internet. I think that you do not need to make the gateway a mirror. I'm more interested in the update / update mechanism for replicating this process to a standalone SDK.

At the moment, my problem is that the standalone device is ARM and the gateway is x64, and when I request an update from sources.list from the hand in the x64 architecture, the update binary responds with an incorrect architure error.

Therefore, I need to know how I can force the gateway to ignore archives and download package updates according to sources.list, I set it to load regardless of architecture.

@BenjaminW. While I posted this question, I started moving around and downloading apt sources and realized that apt-get loads binary files like the ones you mentioned (update and update). Thanks for the advice. However, now I'm trying to better understand how the update and update mechanism works: - I know that the update downloads /etc/apt/lists/sources.list - I transfer sources.list from a standalone device (ARM) to a gateway device (x64) and I launch update on the gateway. - Updating the gateway reads source.list, which I place there from ARM, and when it starts to fix it, the errors "Skipping receiving a configured file ... does not support architecture ..." are displayed

What I'm trying to do is to force the gateway to ignore the architecture and force the use of source.list from ARM. I just need a packages file.

Do you have any other thoughts or alternative approach?

0
source

Source: https://habr.com/ru/post/1271294/


All Articles