I have an Alpine Linux 3.11.3 server (cold iron) that seemingly experienced an unknown event that is causing an issue that is preventing it from communicating on the network, and after countless hours of troubleshooting we've decided to try to do an incremental Alpine upgrade to see if that will resolve the issue (perhaps it has a corrupt kernel, driver, or ??).

I've spent a considerable amount of time researching how to do an apk upgrade from a local repository and, after many unsuccessful attempts to update the offline Alpine Linux 3.11.3 machine to Alpine Linux 3.11.13 (which I have running on the same net), I just can't seem to find a way to do it.

Does anyone know how this can be done?

What I've done thus far, with no success:

  1. From the online Alpine Linux 3.11.13 machine:
    • I then copied the contents of the apk cache directory (/etc/apk/cache) to a USB stick
  2. On the offline Alpine Linux 3.11.3 machine:
    • Commented-out the online repositories that were configured in the /etc/apk/repositories file and then un-commented the line pertaining to /media/usb, per the guidance here: https://wiki.alpinelinux.org/wiki/Upgrading_Alpine#Upgrading_an_Alpine_Linux_Hard-disk_installation
    • Inserted the USB stick and checked to be sure that it was readable and that all of the files were present (by running the command: ls /media/usb)
    • Ran the command: apk update
      • Received the error: "No such file or directory"
    • I then setup apk cache (as per instructions here: https://wiki.alpinelinux.org/wiki/Package_management)
    • Copied the contents of the USB stick to the apk cache directory (/etc/apk/cache)
    • Re-ran the command: apk update - Again, received the error: "No such file or directory"
    • Ran the following additional commands, they all resulted with the same error:
      • apk update --allow-untrusted
      • apk update --repository /usb/media
      • apk update --allow-untrusted --repository /usb/media

I've found info on how to an apk add for specific packages from a local source (such as a USB stick/CD-ROM or other local directory), such as here: https://wiki.alpinelinux.org/wiki/Package_management#Add_a_local_Package, but I can't find any guidance on doing this sort of thing with an apk upgrade

Any help would be greatly appreciated.

1 Answer 1


The apk update command refreshes your local cache of the apk repository. What you're wanting is apk add <package> or apk upgrade to upgrade all packages. If the network is not working, you can add --no-network to the command line: apk --no-network upgrade

  • Thank you very much for your response, @Speeddymon. I tried using the --no-network flag and it resulted in similar manner and with no success. I was also unsuccessful with the other flags that are available for apk (that are listed using the command apk --help --verbose), such as --cache-dir CACHEDIR, --repository REPO, --repositories-file REPOFILE, etc.., either by themselves or in combo with each other. I gave up trying and had to deploy a replacement server and locally copied existing data to it.
    – G-Mo
    Jul 17, 2023 at 20:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .