17

Alpine Linux uses apk as its package manager, and its installer files are .apk... Just like Android files are.

Are those related in any way? If yes, how?
If not, what does APK stands for (Alpine PacKage?), and why they choose the same name for their package manager, as this may sound confusing? There's no info on the manager name around the web.

igorsantos07
  • 520
  • 5
  • 13
  • The accepted answer makes me think this question is more suited to Super User... Should it be migrated? – igorsantos07 Apr 24 '17 at 14:32
  • I feel like this question was never answered. Am I being too literal? OP asked what does `apk` stand for. A definite answer would have been something like it stands for **alpine package kit** or we don't know what it originally stands for. Certainly not anything to do with Android. – Daniel Jun 14 '20 at 14:24
  • @igor Do you have any suggestions for an extension?. – Smart Manoj Dec 21 '20 at 15:16
  • @SmartManoj sorry... why would I bother with this? Who am I to suggest to actually change these file extensions? – igorsantos07 Dec 21 '20 at 22:06
  • @igorsantos07 If you didn't, then the question won't be created; An ordinary user – Smart Manoj Dec 22 '20 at 03:00

4 Answers4

11

Android application package .apk file is a software archive containing the program's code, resources, assets, certificates, and manifest file. The archive format is based on the JAR (Java ARchive) which is based on the ZIP archive format. (MIME type: application/vnd.android.package-archive.)

Similarly, Alpine Linux package management .apk files are digitally signed tar.gz archives containing programs, configuration files, and dependency metadata. Its repository is just a folder containing these files and an index file. These .apk files are often called "a-packs", but I'm not sure whether the extension comes from that nickname or vice versa – the origin is pretty irrelevant.

These two usages aren't related in any way and the packages are incompatible together.

In addition to these, an .apk file may also refer to

  • Active Tutor (Project) by 4C Media, Inc.
  • GameSpy Arcade (Service) by IGN Entertainment, Inc.
  • Train Simulator (Packaged Activity) by Microsoft Corporation

It is not that uncommon that different programs have the same file extensions. While file extensions were originally meant to be generic and universal like .txt for plain text and .gfx for graphics (and later .csv for Comma-Separated Variables), they were soon closely associated with certain programs.

One could think that there are plenty of different three-character combinations of A-Z and 0-9 for every program have its own extension as 36^3 results in 46,656 variations. However, as there isn't any authority allocating extensions, programmers tend to use extensions that could be easily associated with the name of their program, like .wks for Microsoft Works and .wpd for WordPerfect document. Therefore we already have conflicts even in widely used file formats:

  • .rpm: RealPlayer Media file / RedHat Package Manager package / RunPaint Multicolor Graphic
  • .qif: QuickTime Image / Quicken Interchange Format / DESQview compressed font archive
  • .gba: GrabIt scripts / Game Boy Advance ROM image
  • In many video file formats the extension only tells about the container, but a file type can contain different types of compression and the same compression can be used across different file types.

Besides confusion, this only causes actual problems when a system associates a file extension to be opened with a certain program, like Windows Explorer. There are other methods than extensions for distinguishing file types like interpreter directives (e.g. #!/bin/bash shebangs at the beginning of a Unix/Linux script) or (registered) MIME type (see RFC 6838), a line of text stating the file type before sending the actual bitstream, like HTTP header Content-Type: text/html; charset=UTF-8. Adobe PDF is a good example as the file begins with %PDF-1.5 (PDF and version) stating this is a PDF file, and it can contain XObjects that are bitstreams of other filetypes, like /Filter/DCTDecode for JPEG images.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122
  • 3
    Awesome response! That reminds me when I had to name my Markdown files as `.mkd` so Nautilus wouldn't call them MegaDrive ROMs (as in `.md`) – igorsantos07 Apr 24 '17 at 14:29
  • 2
    Thanks for the edit, @SmartManoj. Although the `#!/bin/bash` syntax is called a *shebang* (and many other names) in Unix/Linux, the general term for that is still *interpreter directive*. – Esa Jokinen Dec 18 '20 at 17:40
  • Did you get a notification for my edit? https://meta.stackoverflow.com/questions/306419/people-should-get-notified-when-answers-to-their-questions-are-edited – Smart Manoj Dec 19 '20 at 06:33
  • @SmartManoj: Yes. I accepted the edit, but improved that part a bit. – Esa Jokinen Dec 19 '20 at 08:15
  • So [this feature](https://meta.stackoverflow.com/questions/306419/people-should-get-notified-when-answers-to-their-questions-are-edited) is available to all now? – Smart Manoj Dec 19 '20 at 08:55
  • 1
    I don't know which features are globally available and which I have because of the rather good 35k reputation, but I think this conversation is a bit too meta for this comment section. – Esa Jokinen Dec 19 '20 at 12:13
5

It's a accidental coincidence. From Alpine's site and wiki:

Alpine's packaging and development systems are something a hybrid between ArchLinux's, on the one hand, and Gentooand FreeBSD's, on the other. Our package-management and build utilities work much like Arch's one. apk from apk-tools is Alpine's package manager, like Arch's pacman

And

Software packages for Alpine Linux are digitally signed tar.gz archives containing programs, configuration files, and dependency metadata. They have the extension .apk, and are often called "a-packs".

Mikhail Khirgiy
  • 2,003
  • 9
  • 7
0

As stated here

APK stands for Alpine Linux package manager

There is no confusion to normal users as Android .apk files are installed using play store and Alpine .apk tools are installed using the apk tool.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Smart Manoj
  • 113
  • 5
  • so I guess I'm an abnormal user? I see both as software packages (as they are) and there's no reason I couldn't get an Android APK and try to place on my Linux box, or the other way around. There are other places to get them besides their stores / CLI tools. – igorsantos07 Dec 21 '20 at 22:04
  • If you do, you will place it under a folder, right? – Smart Manoj Dec 22 '20 at 02:59
0

Just to finally answer the question what APK actually stands for in Alpine context: According to Alpine docs, the abbreviation stands for Alpine Package Keeper.

This will probably also tell you that it is unrelated to Android APK files (those are an abbreviation for Android Package Kit) and use the same file ending merely by coincidence.

The unfortunate overlap of abbreviations was likely happening because, while Android was likely first to use the abbreviation Android 1.0 was released September 2008 while Alpine 2.0 (which is actually the first released version of Alpine) was only released in August 2010), neither of the two projects were widely used when they came out, so it's likely they just didn't know about the unfortunate choice of file ending

Johannes H.
  • 272
  • 2
  • 11