Alpine Linux - what is needed pkgs (Part 5) - repository maintenance (advanced)

Some questions answered here.

  1. How can I share packages list of my partial repository.
  2. How can I maintain multiple snapshots in my partial repository.
  3. 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.
NOTE:
  • 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
NOTE:
  • 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.gz file 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 apk or 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
NOTE:
  • See (1a) above, on how to generate fulllists.
ABOUT: main.lst,community.lst
  • these are lists that fetch-apk.sh uses to download .apk packages.
  • it can be manually created, or
  • auto-generated by fetch-apk.sh main mklist cmd, or
  • full-list auto-generated by fetch-apk.sh main mkfulllist cmd.
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.gz files.
  • See, APKINDEX spec.[2]
  • apk only knows about packages/versions that is currently in branch/arch/APKINDEX.tar.gz
  • apk can only read APKINDEX.tar.gz reachable from repository listed in /etc/apk/repositories.
Method 1
 # 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.
Method 2

See, performing upgrade below.

  • Caveat:
    • Always do getindex only when you want to create a required snapshot from it.
    • Always avoid mixing edge with stable.
2b. restoring snapshots in your local mirror
  • restoring any previous freeze copy of APKINDEX.tar.gz will 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 Graph/structure:
  • 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
NOTE:
  • Caveat: Always do getindex only 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/
NOTE:
  • 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
-
NOTE:
  • Do not run lbu commit if just wanting to test and update your local repository. Just do a reboot.
  • May require a reboot, if running a desktop.

Downloads

While old git repository is in search of new host, here is temporary/alt one.

Author

V.Krishn


Resources


Edit - History - Print - Recent Changes - Search
Page last modified on November 22, 2025, at 06:49 AM