Apt/getpack

From Minux Wiki
Revision as of 02:04, 25 September 2024 by Shorun (talk | contribs)
Jump to navigation Jump to search

this document explains how apt knows what files to download/remove.

Searching for the host server - how apt finds a software package

when told to download "packname", apt will open it's source file and read the first entry, this is %URL%.

it now tries to download %URL%/manifest/%packname%.db, if found it opens it and reads the first line.

if this file doesn't exist or it doesn't state "AIF" then apt will move on to the next server in it's list and repeat this process.

if this line states "AIF", apt found it's source server and remembers this server as a source for this package.

if it fails to find any manifest file on any server it will respond with package not found.

downloading the files - how apt knows what files to download.

apt takes the manifest file it downloaded for this program and reads it, every line tells it about another file

it go's trough this entire file, downloading all of them untill it reaches the end of it's manifest file.

in this file you will find the path as you'd find it on the computer, the actual download url is built in the following manner:

server url + "/repository/" + packname + "filepath"

if it was told to install a new package, apt will also mark this package in it's installed list to remember it for updates.

removing files - how apt knows what files to remove

when told to remove a package, apt will first read the "cleanup" file and delete any file state in there

then, it reads the manifest file and deletes any file stated in there.

it removes the packname from the installed list.

that's it.