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" to work using its inbuilt resources, including GLIBC, so it can run also on 10+ years old GNU/Linux distributions.


Index


Installation

Usage

Compared to classic AppImage construction

Files removed by default

Troubleshooting

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.

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

EXAMPLE

In this video I will show all the steps that I will describe in this section (Archimage 3.4.2):

simplescreenrecorder-2024-06-16_21.19.47_edit.mkv.mp4

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"

Step by step guide

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

  1. Create the script, use the option -b or --build, example with "firefox" (see the above "video"):
./archimage-cli -b firefox
  1. The script will ask you if you want to specify the name of the binary or leave blank if the name is the same of [PROGRAM]. Being the executable /usr/bin/firefox of "firefox" named "firefox", press ENTER to leave blank. Some apps, have a different name for their executable (for example "handbrake" have /usr/bin/ghb, so just write "ghb" for it). If you're not sure about thename 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.
  2. 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...), leave blank if no dependency is needed.
  3. The next questions are about implementing or not all dependences, choose "Y" to bundle all the dependences, or "N" to do this in other steps.
  4. This phase, shown in the video, has a last message asking you to use a standard configuration with the following defaults if you press "Y":
  • a package availability check in the Arch User Repository (if so, enable AUR and installs "binutils", "gzip" and "basedevel", all of them are only required to compile from and will not be included in the AppImage package)
  • the AUR is enabled
  • installs "ca-certificates"
  • includes keywords for the internet connections and audio trying to enable them
  • the file "/usr/lib/dri/swrast_dri.so" will NOT be included if not needed If you press "N" (or leave blank) instead, you have a lot of configurations you can do by your own.
  1. Run the script.

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 is a Type3 AppImage, i.e. one that 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
  |
  |_/.cache/
  |
  |_/.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;
  • ".cache" is usually empty and used by YAY during the temporary JuNest session.

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, like this:

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

to see the missing libraries, or

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

to see the missing files.

I redirect you to the guide on the usage of LD_DEBUG, at https://www.bnikolic.co.uk/blog/linux-ld-debug.html

Dotfiles tip

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

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

I suggest you empty it or remove/recreate it 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.


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.

For example, an OBS Studio ArchImage equals 650MB in total, I managed to get it to 260MB by removing what wasn't necessary, while now (since Archimage2.x was released) is about 180MB.

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

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

  • hardware acceleration is absent (for now), see #20

Files removed by default

After the line "# REMOVE SOME BLOATWARES" I added a list of functions that you can use with Archimage 2.x and above. You can edit the script as you like to add/remove files in case they are not enough for your experiments.


Back to "Index"

Troubleshooting

  1. If the AppImage is already bundled, extract the AppImage using ./*.AppImage --appimage-extract
  2. Execute the AppRun file:
./AppRun

In case you wont to parse dotfiles in your $HOME directory, use the AppDir itself as a custom $HOME, like this:

cd ./*.AppDir
HOME="$(dirname "$(readlink -f $0)")"
./AppRun

It is now possible to read errors related to the application.

For more verbose output, use LD_DEBUG, like this (for example, to know what are the missing libraries):

LD_DEBUG=libs ./AppRun

I redirect you to the guide on the usage of LD_DEBUG, at https://www.bnikolic.co.uk/blog/linux-ld-debug.html

See also

If you have any doubts you can open an issue or search for a solution among the existing ones (here).


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

Packages

No packages published

Languages