Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Build AppImage packages for all distributions but including Arch Linux packages. Powered by JuNest.

License

Notifications You must be signed in to change notification settings

ivan-hc/ArchImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArchImage is the bundling of Arch Linux packages into an AppImage using JuNest.

This allows you to use the latest programs from Arch Linux and AUR on every distribution, old or newer.

Being this a container into an AppImage, it has its own "bubblewrap" or "proot" to work using its inbuilt resources, including GLIBC, so it can run also on 10+ years old GNU/Linux distributions.

From version 5.0, the CLI also supports scripts for SHARUN-based Anylinux AppImages

If you have already installed archimage-cli, please run

archimage-cli -s

...to use the latest version.

Archimage combines the flexibility of JuNest with the portability of an AppImage, offering the ability to package all the software available in the official Arch Linux repositories, the AUR and ChaoticAUR.

SEE IT IN ACTION

In this video, how to create an Archimage 5.0 of Abiword.

Abiword.Archimage.5.0.mp4

Video sped up due to GitHub limitations for media uploads. Real-time 3 minutes and 30 seconds.


Index


Installation

Usage

Hardware Acceleration

Compared to classic AppImage construction

Credits

Related projects


Installation

Download the main script and made it executable:

wget https://raw.githubusercontent.com/ivan-hc/ArchImage/main/archimage-cli
chmod a+x ./archimage-cli

USAGE:

archimage-cli [OPTION]
archimage-cli [OPTION] [PROGRAM]

OPTIONS:

-h,--help		Shows this message.
-v,--version		Shows the version.
-b,--build		Create the script to build the AppImage.
-s,--sync		Update archimage-cli to the latest version.
--devmode-enable	Use the development branch (at your own risk).
--devmode-disable	Undo "--devmode-enable" (see below).

Back to "Index"

What to do

To prevent problems of any kind, dedicate a single directory to the created script, proceed as follows:

  1. create the script;
  2. create an empty directory, the name must not contain spaces, for example "tmp" or "test";
  3. move the script you created to the directory in step 2;
  4. open a terminal in the directory created in step 2;
  5. run the script inside the directory, like this: ./sample-junest.sh

NOTE, older versions are significantly slower to build.

Pay attention to the file extension, it must contain the version of Archimage used, for example

Appname-$VERSION-archimage5.0-x86_64.AppImage

Always try to get the latest version to build your Appimages (see "Extensions (and what they mean)", below).


What NOT to do

Here's what absolutely NOT to do when running a script you created:

  • DO NOT DRAG THE CREATED SCRIPT INTO THE TERMINAL! The script only works if run in place, see point 5 above.
  • DO NOT RUN THE CREATED SCRIPT IN YOUR $HOME DIRECTORY! The script will use the directory where it is run as $HOME. You must follow points 2, 3 and 4 above.
  • DO NOT RUN THE CREATED SCRIPT IN ANY OTHER DIRECTORIES! Create an empty one and dedicate that to the script. Again, just follow points 2, 3 and 4 above.
  • DO NOT USE THE SAME DIRECTORY FOR TWO DIFFERENT APPLICATIONS! Create a new one for each new script created.

Follow the steps at "What to do" and watch the "video example" above.

Referenced issues #19 and #23

Back to "Index"

Extensions (and what they mean)

You can recognize an Archimage by the form of its file name.

$APPNAME_$VERSION-archimage5.0-x86_64.AppImage

...in the example, you see the term "archimage5.0". This term indicates characteristics that differentiate it from other Archimages, whether it's from a specific release or not.

In fact, the script and the CLI don't go hand in hand:

  • The CLI is used to adapt the script based on your primary needs (naming the app, its binary, adding additional repositories, and Nvidia hardware acceleration).
  • The script may change from time to time depending on improvements made to the way AppImages are built.

In this sense, here's what the terms you'll most often see (in my repositories) mean:

  • archimage3.5 - This is an old version, it relies solely on BuubbleWrap, so it won't work on some systems.
  • archimage4.0 - Introduces Nvidia hardware acceleration for the first time in this project.
  • archimage4.2 - Alternates BubbleWrap with PROOT, so it runs on almost any distro. Also, the AppImage supports Delta updates.
  • archimage4.3 - Faster and less resource-intensive build scripts, with greater automation in processes.
  • archimage4.8/4.9 - Build only (no release). Moved the local Nvidia driver directory from ~/.local/share/Conty to ~/.cache/junest_shared.
  • archimage5.0 - Moved the common processes of all scripts into a single script in this repository. Library selection via SHARUN. Reduced build scripts for easier reading and, more importantly, customization.

Back to "Index"

Step by step guide

Before proceeding, make sure you have understood "What to do" and above all "What NOT to do"!

Also, THIS GUIDE APPLIES TO ARCHIMAGE 5.0 OR HIGHER!

Archimage 4.3 or lower are considered OBSOLETE and UNSUPPORTED.

1. Create the script

Use the option -b or --build, example with "obs-studio"

./archimage-cli -b obs-studio
Istantanea_2025-10-22_00-57-36

The first question is about creating an Archimage script (1, default), a SHARUN-based Anylinux script (2) or press any other key to abort.

The two scripts are not much different:

The JuNest-based script supports more configurable variables and an editable AppRun and body in general. The SHARUN-based is efficient, but lacks of configurations. Also the AppRun come from a preset.

The JuNest-based Appimage (Archimage) is a portable container, so it relies on its own resources, while mounts few other files and directories using BubbleWrap or Proot (depending on system's restrictions), so it is not much integrated with the host system. On the contrary, SHARUN-based AppImages are more independent and work in harmony with other applications.

To learn more about Anylinux AppImages, visit https://github.com/pkgforge-dev/Anylinux-AppImages

Choose the script you prefer.

NOTE, both the scripts use JuNest in Bubblewrap mode (requires unrestricted Namespaces) in the build process. See here for more context.

2. Add binary name

The CLI will ask you if you want to specify the name of the binary or leave blank if the name is the same of [PROGRAM]. In most cases we can leave blank, but for some applications, like OBS Studio, the executable name is different, in our case it is obs

Istantanea_2025-10-22_01-25-18

If you're not sure about the name of the main executable, use https://archlinux.org/packages/ or read the PKGBUILD if the app is hosted on the AUR. By default, the script will use "yay" to install all the programs in JuNest.

3. Add extra dependencies

The script will ask you to add a list of additional packages you want to include into the AppImage (with the syntax app1 app2 app3...)

Istantanea_2025-10-22_01-26-21

Leave blank if no dependency is needed. In our example, I add python. You can add many more packages, according to your needs.

3,5. AUR, want to use ChaoticAUR instead? The hidden question

Between question 3 (add dependencies) and 4 (enable multilib) exists another hidden question

402320114-ab650430-a2da-4663-ae9d-c4d97d3f4103

this question come up only if the program is not hosted on the official repositories, so it come from AUR.

In this case binutils, gzip and base-devel are enabled by default. You can choose to enable ChaoticAUR to save time and resources while compiling the program. For example gimp-git lasts 5 minutes or less from ChaoticAUR, while from AUR it can take 30 minutes or more (with the risk that it fails).

Of course, this question will not come up with obs-studio, since it is on the official Arch Linux repositories.

4. Enable multilib

Want to enable the "multilib" repo? It is usally needed for 32bit libraries, used in programs like WINE and frontends like Bottles

Istantanea_2025-10-22_01-32-26

in our case, we can leave blank or press "N". We don't need 32 bits libraries at all in this case.

5. Enable hardware acceleration for Nvidia users (only Archimage)

Do you want to allow hardware acceleration? The variable NVIDIA_ON is set to "0" by default. Press "y" to set it to "1".

This will enable Nvidia users to use your application where hardware acceleration is needed.

Istantanea_2025-10-23_18-34-52

To learn more on how hardware acceleration works with Archimages, see "Hardware Acceleration".

Ending message

At the end of the wizard you will have a message that will remembe4r you to run the script into an empty directory.

Again, make sure you have understood "What to do" and above all "What NOT to do"!

Also, see the Test the AppImage section to debug and improve your AppImage.


Requirements of an AppImage

To be valid, an AppImage must contain, in the root of the .AppDir directory:

  1. a valid .desktop file (the application one is selected by default, otherwise a custom one is created);
  2. an icon, whose name (without extension) must correspond to the "Icon=" entry of the .desktop file at point 1;
  3. the binary file must be contained in the $PATH (/usr/bin) of the AppImage, and must correspond to the "Exec=" entry of the .desktop file at point 1.

If this requirement is not met, no AppImage will be created.


Archimage structure

An Archimage does not require libfuse2 to function.

Unlike many other AppImages, its structure, other than the requirements above, resembles a $HOME directory:

App.AppDir/
  |
  |_/App.desktop
  |
  |_/app.png
  |
  |_/.local/share/junest/
  |
  |_/.junest/

Hidden directories are those used in a normal Junest installation:

  • ".junest" contains the Arch Linux system;
  • ".local/share/junest" contains the JuNest files to start Arch Linux in a container.
Istantanea_2025-10-22_01-46-25

The Archimage is first built, and then reassembled with only the essential files indicated in the script you created.


Test the AppImage

Once the script has finished and the AppImage has been created, run the AppImage from the terminal, and check that there are no errors (e.g. libraries not found, missing dependencies...):

./Sample-1.2.3-x86_64.AppImage

For more verbose output, use LD_DEBUG.

To see the missing libraries, run

LD_DEBUG=libs ./Sample-1.2.3-x86_64.AppImage

to see the missing files, run

LD_DEBUG=files ./Sample-1.2.3-x86_64.AppImage

To learn more about LD_DEBUG usage, see https://www.bnikolic.co.uk/blog/linux-ld-debug.html

Dotfiles tip

To not flood your $HOME and ~/.config directories with dotfiles, I recommend creating a .home and a .config directory with the same name as the AppImage:

mkdir -p Sample-1.2.3-x86_64.AppImage.home Sample-1.2.3-x86_64.AppImage.config
./Sample-1.2.3-x86_64.AppImage

If your file manager supports custom actions (for example Thunar in XFCE4), you can right-click on an AppImage using this command

grep -Eaoq -m 1 'github.com/AppImage/AppImageKit/wiki/FUSE' %f && chmod a+x %f && mkdir -p %f.home %f.config

I suggest you empty/remove/recreate these direcftories at the end of each test, in order to rewrite the dotfiles using a clean configuration.

Repeat the build

If you encounter any problems after testing, manually edit the script by adding dependencies or keywords in the respective listed variables, then run the script again to build the AppImage.

./sample-junest.sh

This will repeat the construction of the AppImage starting from the shortcomings of the Arch Linux container.

On-screen messages will tell you what's happening.

Wait until the end and try the AppImage again.

Run the tests until you get the desired result.

How to add missing libraries manually

On top of the script (under APP, DEPENDENCES, etcetera...) you can see the following variables:

BINSAVED="SAVEBINSPLEASE"
SHARESAVED="SAVESHAREPLEASE"
lib_browser_launcher="gio-launch-desktop libasound.so libatk-bridge libatspi libcloudproviders libdb- libdl.so libedit libepoxy libgtk-3.so.0 libjson-glib libnssutil libpthread.so librt.so libtinysparql libwayland-cursor libX11-xcb.so libxapp-gtk3-module.so libXcursor libXdamage libXi.so libxkbfile.so libXrandr p11 pk"
LIBSAVED="SAVELIBSPLEASE $lib_browser_launcher"

Set keywords to searchan include in names of directories and files in /usr/bin (BINSAVED), /usr/share (SHARESAVED) and /usr/lib (LIBSAVED).

The "$lib_browser_launcher" set of keyword is intended to allow the links inside an AppImage (for example in the Info dialog) to be clicked to launch the host's browser. They come up after a long search using Firefox. Any improvement is wellcome.

Here are the more common scenarios in which you may need to edit the three main variables. If while launching the AppImage from the command line, it prompts (for example)...

  • "capocchia: command not foud", add capocchia to BINSAVED
  • "Cannot load libcapocchia.so: file not found" or "Cannot find libcapocchia.so: No such file or directory", add libcapocchia or just capocchia to LIBSAVED
  • "Cannot read /usr/share/some/program/capocchia.svg", add some to SHARESAVED

Once you have done so, repeat the build.

NOTE, if the same error about the same file persists, this may mean that such file was not installed in JuNest during the build. In this case, use your favourite search engine (I use startpage.com) and search

libcapocchia.so archlinux

And see the results, then try to find the exact package required. In our example, you have found that such library is in the package capocchia, so add this to DEPENDENCES

DEPENDENCES="" #SYNTAX: "APP1 APP2 APP3 APP4...", LEAVE BLANK IF NO OTHER DEPENDENCIES ARE NEEDED

...so change the above to

DEPENDENCES="capocchia" #SYNTAX: "APP1 APP2 APP3 APP4...", LEAVE BLANK IF NO OTHER DEPENDENCIES ARE NEEDED

...then repeat the build.

Since you have already added the capocchia keyword to LIBSAVED, this time the error should disappear.

Maybe another error about another missing ligrary and not included may come up. If so, repeat the steps you have done for the capocchia package and the libcapocchia.so library of our example.

PS: as far as I know, there is not (yet) a package or a library with that kind of name... but if I am wrong, I suppose it would be a tool that does random things. It would be an idea for someone.

PPS: I'm obviously kidding. Please don't hate me.

How to debloat an Archimage

From version 5, you can find all configurable variables on top of the script, and among them, you can see the following ones

ETC_REMOVED="makepkg.conf pacman"
BIN_REMOVED="gcc"
LIB_REMOVED="gcc"
PYTHON_REMOVED="__pycache__/"
SHARE_REMOVED="gcc icons/AdwaitaLegacy icons/Adwaita/cursors/ terminfo"

Set the items you want to manually REMOVE. Complete the path in /etc/, /usr/bin/, /usr/lib/, /usr/lib/python*/ and /usr/share/ respectively.

For example, suppose that we have a directory some/dir under /usr/lib:

  • to remove its content, write some/dir/
  • to remove only "dir", use some/dir
  • to remove the content of "some", write some/
  • to remove "some", write only some (note, all files and directories starting with "some" in /usr/lib will be removed)

The "rm" command will take into account the listed object/path and add an asterisk at the end, completing the path to be removed. Some keywords and paths are already set. Remove them if you consider them necessary for the AppImage to function properly.

Repeat the build to see your AppImge even smaller. Pay attention to not remove too many things or the AppImage may not work anymore. If this happens, revert your changes and repeat the build,


Customize your script

Once you created the script, it is yours and only yours. You can add/remove functions as you like.

Of course, DO IT ON YOUR OWN RISK!


Launcher and icon

By default, the builder searches the JuNest container for the launcher and icons. However, you can manually add a .desktop and .png/.svg file next to the script so that it is included instead of what the script would otherwise look for.


Back to "Index"

Hardware Acceleration

From version 5.0, Archimage handles a copy of the system's Nvidia drivers into a temporary "$HOME/.cache/junest_shared" directory, shared with other Archimages 5.0 or higher.

To enable the check, set the NVIDIA_ON variable 1.

This is the logic in the AppRun

CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"
[ -z "$NVIDIA_ON" ] && NVIDIA_ON=0
if [ -f /sys/module/nvidia/version ] && [ "$NVIDIA_ON" = 1 ]; then
   nvidia_driver_version="$(cat /sys/module/nvidia/version)"
   JUNEST_DIRS="${CACHEDIR}/junest_shared/usr" JUNEST_LIBS="${JUNEST_DIRS}/lib" JUNEST_NVIDIA_DATA="${JUNEST_DIRS}/share/nvidia"
   mkdir -p "${JUNEST_LIBS}" "${JUNEST_NVIDIA_DATA}" || exit 1
   [ ! -f "${JUNEST_NVIDIA_DATA}"/current-nvidia-version ] && echo "${nvidia_driver_version}" > "${JUNEST_NVIDIA_DATA}"/current-nvidia-version
   [ -f "${JUNEST_NVIDIA_DATA}"/current-nvidia-version ] && nvidia_driver_conty=$(cat "${JUNEST_NVIDIA_DATA}"/current-nvidia-version)
   if [ "${nvidia_driver_version}" != "${nvidia_driver_conty}" ]; then
      rm -f "${JUNEST_LIBS}"/*; echo "${nvidia_driver_version}" > "${JUNEST_NVIDIA_DATA}"/current-nvidia-version
   fi
   HOST_LIBS=$(/sbin/ldconfig -p)
   libnvidia_libs=$(echo "$HOST_LIBS" | grep -i "nvidia\|libcuda" | cut -d ">" -f 2)
   libvdpau_nvidia=$(find /usr/lib -type f -name 'libvdpau_nvidia.so*' -print -quit 2>/dev/null | head -1)
   libnv_paths=$(echo "$HOST_LIBS" | grep "libnv" | cut -d ">" -f 2)
   for f in $libnv_paths; do strings "${f}" | grep -qi -m 1 "nvidia" && libnv_libs="$libnv_libs ${f}"; done
   host_nvidia_libs=$(echo "$libnv_libs $libnvidia_libs $libvdpau_nvidia" | sed 's/ /\n/g' | sort | grep .)
   for n in $host_nvidia_libs; do libname=$(echo "$n" | sed 's:.*/::') && [ ! -f "${JUNEST_LIBS}"/"$libname" ] && cp "$n" "${JUNEST_LIBS}"/; done
   libvdpau="${JUNEST_LIBS}/libvdpau_nvidia.so"
   [ -f "${libvdpau}"."${nvidia_driver_version}" ] && [ ! -f "${libvdpau}" ] && ln -s "${libvdpau}"."${nvidia_driver_version}" "${libvdpau}"
   export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${JUNEST_LIBS}":"${LD_LIBRARY_PATH}"
fi

For the old Archimage 4.x series, hardware accelleration was provided by Conty. The drivers were placed in a "$HOME/.local/share/Conty" directory. If you already use a Conty container or run 4.x Archimages (see the name of the AppImage), you will be able to use the same Conty directory.


Back to "Index"

Compared to classic AppImage construction

In the past AppImages were built using .deb packages or guessing instructions to make them work. With the "ArchImage" method all you have to do is the reverse, i.e. "delete" what is no longer needed.

This is a list of the AppImages I've built until I wrote this brief guide:

Application Stars
Abiword
Aisleriot
Avidemux
Bottles
Celestia "Enanched"
Emacs
Evince
Gedit
GIMP Stable/Git/Hybrid
GNOME Boxes
Gnome-calculator
Gnumeric
Handbrake
Hypnotix
Inkscape
KDE-games
KDE-utils
LibreOffice Still/Fresh
MPV
OBS-Studio
ocenaudio
Rhythmbox
SpaceCadet Pinball (AUR)
Torcs
Transmission-gtk
VirtualBox KVM
VLC Stable/Git
Database of pkg2appimaged packages* (Various sources)

*NOTE, the last one in the table above is a database containing small random apps and games that you may need. The Archimages contained in this repository are:

Application
Anki
Asunder
Audacious
Chromium BSU
Falkon
FileZilla
kwave
Poedit
Webcamoid

Advantages

  • compatibility with all versions of Linux starting from kernel 2.6, therefore also older distributions than those normally indicated by the classic AppImage developers;
  • easy and immediate compilation;
  • AppRun script very minimal and easy to configure;
  • all programs for Arch Linux within AppImage's reach, therefore one of the most extensive software parks in the GNU/Linux panorama.

Disadvantages

  • the AppImage can be bloated if you don't set a list of removable items manually
  • being a container, it must contain its own set of programs (for example coreutils, awk and sed) as it cannot use the ones on the host

Back to "Index"

Credits

This project wont be possible without:


Related projects


ko-fi.com PayPal.me "Index"

About

Build AppImage packages for all distributions but including Arch Linux packages. Powered by JuNest.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages