Alpine Linux
- HomePage
- Create-bootable-images
- Create-what-is-only-needed-repo
- Create-alpine-rescue-disk
- Boot-dance-everything-in-usr-folder
- True-diskless-boot
- Diskless-install-on-devices-with-2gb-ram
- Diskless-install-on-devices-with-1gb-ram
- About-diskless-boot
- How-to-share-you-apks-repo
- How-to-manage-shared-apks-repo
- How-to-manage-shared-apks-repo-2
Alpine Linux - what is needed pkgs (Part 5) - repository maintenance (advanced)
Some questions answered here.
- How can I share packages list of my partial repository.
- How can I maintain multiple snapshots in my partial repository.
- How can I upgrade my install using my partial repository.
- Content on this page only applies to disk-less boots.
- To be read in continuation with (Part 4).
- if you find something missing, its likely they are being referenced in conjunction with (Part 4).
- Target audience: Alpine Linux advanced
About directory structure of shared apks repository
This section explains directory structure as in, (Part 4).
About fetch-apk.sh (advanced)
fetch-apk.sh is script,
- That lets you download your applications packages along-with their dependencies.
- Downloaded .apk pkgs can be then can be organized like local repository mirror.
sh fetch-apk.sh [main|community] [getindex|mklist|fetch|mkfulllist] [upgrade]
1a. make full .apk list of your local mirror
localhost:/media/sda1/apks2/v3.22# sh fetch-apk.sh main mkfulllist
>>> set branch: main >>> Saving current full list to main/main-x86_64--v3.22.2-206-ge2cfd1f9853.lst
localhost:/media/sda1/apks2/v3.22# sh fetch-apk.sh community mkfulllist
>>> set branch: community >>> Saving current full list to community/community-x86_64--v3.22.2-214-g33de1eff6af.lst
- These saved list can be shared with your friends/team-members for quick download and setup of mirror like yours.
- Remember, you would also need to share your current
APKINDEX.tar.gzfile that corresponds with this full-list. - See, (Part 4)#indexfreeze
- Sharable list can also be created my other methods or manually done.
- There are other ways to use
apkor write a script, to generate this dependency resolved list.
1b. using shared full .apk(pkgs) list from your local mirror
localhost:/media/sda1/apks2/v3.22# cp main/main-x86_64--v3.22.2-206-ge2cfd1f9853.lst main.lst
- See (1a) above, on how to generate fulllists.
ABOUT: main.lst,community.lst
- these are lists that
fetch-apk.shuses to download .apk packages. - it can be manually created, or
- auto-generated by
fetch-apk.sh main mklistcmd, or - full-list auto-generated by
fetch-apk.sh main mkfulllistcmd.
localhost:/media/sda1/apks2/v3.22# sh fetch-apk.sh main fetch
This will download all .apk packages in main.lst
2a. creating multiple snapshots in your local mirror
- See, (Part 4)#indexfreeze
Multiple snapshots requires some manual work, and understanding of your saved APKINDEX.tar.gzfiles.
See, APKINDEX spec.[2]
apkonly knows about packages/versions that is currently in branch/arch/APKINDEX.tar.gz
apkcan only readAPKINDEX.tar.gzreachable from repository listed in/etc/apk/repositories.
# cd /media/sda1/apks2/v3.22
# sh fetch-apk.sh main getindex
# lbu commit
# reboot
## AFTER REBOOT
# cd /media/sda1/apks2/v3.22
# apk update
# sh fetch-apk.sh main mklist
# sh fetch-apk.sh main fetch
# mv *.apk main/x86_64/
## --- do a repeat for community/ ---
# apk fix; lbu commit
# reboot
- Caveat:
- Creating new snapshot after prolonged period can get messy, as primarily issue, internet may not be available.
- Currently, workaround is complex and beyond scope of this article.
See, performing upgrade below.
- Caveat:
- Always do
getindexonly when you want to create a required snapshot from it. - Always avoid mixing edge with stable.
- Always do
2b. restoring snapshots in your local mirror
restoring any previous freeze copy of APKINDEX.tar.gzwill restore/rollback your snapshot to that index.
eg:
# cd /media/sda1/apks2/v3.22
# rm -f main/x86_64/APKINDEX.tar.gz
# cp main/x86_64/APKINDEX-v3.22.2-206-ge2cfd1f9853.tar.gz main/x86_64/APKINDEX.tar.gz
# apk update
# lbu commit
# reboot # and done
#TODO
- multiple snapshots
- directory graph/structure side-by-side(image/png, or svg)
- game of index
WIP (work in progress)
- TODO:
3a. performing upgrade from your local mirror
- EXPERIMENTAL
a.
# cd /media/sda1/apks2/v3.22
# sh fetch-apk.sh main getindex # Get/update to latest index
# sh fetch-apk.sh community getindex # Get/update to latest index
# apk update
# apk upgrade -U -a
- Caveat: Always do
getindexonly when you want to create a required snapshot from it.
b.
# cd /media/sda1/apks2/v3.22
# sh fetch-apk.sh main mklist upgrade
# sh fetch-apk.sh main fetch upgrade
-
c.
# cd /media/sda1/apks2/v3.22
# mv *.apk main/x86_64/
- Repeat: b+c for branch community.
d.
# cd /media/sda1/apks2/v3.22
# apk upgrade -U -a
# apk fix
-
e.
# cd /media/sda1/apks2/v3.22
# lbu commit
-
Do not run lbu commitif just wanting to test and update your local repository. Just do a reboot.
May require a reboot, if running a desktop.
Downloads
- apklist-3.18.x-20251121.tgz Δ ... 7,509 bytes ... November 21, 2025, at 05:55 PM
- apklist-3.22.x-20251121.tgz Δ ... 3,800 bytes ... November 21, 2025, at 05:55 PM
Author
V.Krishn
Resources