AppImage / AppImageKit

Package desktop applications as AppImages that run on common Linux-based operating systems, such as RHEL, CentOS, openSUSE, SLED, Ubuntu, Fedora, debian and derivatives. Join #AppImage on irc.libera.chat
http://appimage.org
Other
8.77k stars 563 forks source link

Cannot run AppImage with wrong permissions on AppRun file #1272

Closed probonopd closed 1 year ago

probonopd commented 1 year ago

@bksubhuti commented

Furthermore, I cannot get appimages to on Lubuntu 22.04 with libfuse2 installed. It says permission denied if I launch from the command line. Yet if I extract and run, it works fine. You will surely hear more of more trouble from others (who care to comment) as time passes. Remember that 1/100 people will comment.

I tested the following:

Please give me reproducible steps for the non-working situation @bksubhuti.

Now, for GUI applications:

bksubhuti commented 1 year ago

I noticed my script was using appimage 13 version.. so i changed it to what you had. I still had the same problems.. permission denied. nothing shows in the double click and commandline says the same.. trust me .. i'm giving all permissions.. it is executable and no need to ask permission . I know that.

I got my instructions from the medium article that say it hates snaps and those who need to build hate snaps even more.

as usual, after failing in appimage normal way, I ran my extracted and zip thing and it worked perfectly.
libfuse2 is surely installed. You will also need libsqlite3-dev DO THIS BEFORE RUNNING If you run into a problem, you have to delete the directory found in .local/share/tipitaka_pali_reader

Here is a script I use with DigitalOcean.com I wasted another .046 cents building again.. (don't worry about it.. just kidding).

This takes about 8 minutes to build. I did hand feed a few parts of my last build to fix to the same thing you you put.. (old commands are in comments). I just forget the wget so I think this should run smooth.

Let me know what you get.

#!/bin/bash

# Update and upgrade the system
sudo apt update
sudo apt upgrade -y

# Install Flutter
sudo snap install flutter --classic

# Install required dependencies
sudo apt-get install libgtk-3-0 libblkid1 liblzma5 -y
# Uncomment the following line if needed:
# sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev -y

# Check Flutter installation
flutter doctor

# Install additional tools
sudo apt install p7zip-full p7zip-rar unzip python3-pip python-pip zip -y
pip install gdown

# Clone the repository
mkdir git
cd git
git clone https://github.com/bksubhuti/tipitaka-pali-reader.git
cd tipitaka-pali-reader/assets/database

# Download and extract the necessary files
gdown 1II8XYSQw0JzZxJk2J4QT9XyN2SnqT9qm
unzip tipitaka_pali.zip
sh split.sh
rm *.zip
cd ../..

# Build the Flutter app for Linux
flutter build linux --release

cd TipitakaPaliReader.AppDir

cp -r ~/git/tipitaka-pali-reader/build/linux/x64/release/bundle/* .

# Navigate back to the project root
cd ..

# Download the AppImage tool
#wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage

# Build the AppImage
#ARCH=x86_64 ./appimagetool-x86_64.AppImage TipitakaPaliReader.AppDir/ tipitaka_pali_reader.AppImage
./appimagetool-x86_64.AppImage TipitakaPaliReader.AppDir/ tipitaka_pali_reader.AppImage

 chmod +x tipitaka_pali_reader.AppImage
 ./tipitaka_pali_reader.AppImage --appimage-extract
 mv squashfs-root TPR
 zip -r TPR.zip TPR

# Uncomment the following line if you want to copy the flutterstuff.zip file to the server
# scp ~/Desktop/flutterstuff.zip root@SERVER_IP:/root/tipitaka-pali-reader/

# Uncomment the following line if you want to copy the AppImage to a specific directory on your local machine
# scp root@137.184.81.217:git/tipitaka-pali-reader/tipitaka_pali_reader.AppImage C:\Users\bksub\Downloads
# scp root@137.184.81.217:git/tipitaka-pali-reader/TPR.zip C:\Users\bksub\Downloads
probonopd commented 1 year ago

Can you please give me a link to the AppImage that is not working properly for you.

I will test it on Lubuntu 22.04.

bksubhuti commented 1 year ago

If it works, i'd rather see you use a virtual machine rather than live disk. There are other things one a live disk that are not included in a live disk. This does work on Ubuntu 23.04 (now long longer have). but I can only afford one sys for testing and prefer lubuntu because lubuntu does not have extra stuff. best for compatibility testing which is 90% why I have the partition. (I prefer mate or ubuntu gnome)

bksubhuti commented 1 year ago

I should also mention, when I build with github automations using 20.04. It does not work even with the zip method on Lubuntu. it did work on Ubuntu gnome 23.04.

probonopd commented 1 year ago

Again, can you please give me a link to the AppImage that is not working properly for you.

We should run it through the automated test for https://appimage.github.io/.

bksubhuti commented 1 year ago

hold on.. i'll upload it

bksubhuti commented 1 year ago

https://www.dropbox.com/s/0zpo85v2eal3leq/tipitaka_pali_reader.AppImage?dl=0

here is the file. Please take a look at my script and see if anything was wrong with the older code commented out or the newer one. I have same results both ways.

probonopd commented 1 year ago
chmod +x ./tipitaka_pali_reader.AppImage
./tipitaka_pali_reader.AppImage --appimage-extract
ls -lh squashfs-root/AppImage
-rw-r--r--  1 user  wheel    59B 25 Juni 10:22 AppRun

Do you see what is wrong here? Quite obvious.

bksubhuti commented 1 year ago

I'm hardly a linux guru.
It looks like your command is chmod +x ./tipitaka_pali_reader.AppImage

While my command was chmod +x tipitaka_pali_reader.AppImage

the difference is the ./
The only thing I know about this dot-slash is that if I want to run the program, I type that. Changing the file permission usually does not require dot-slash

So you are saying it works? after that command is modified?

probonopd commented 1 year ago

Hint: Your AppRun file inisde the AppImage has the wrong permissions

probonopd commented 1 year ago

@TheAssassin should we add something like

  // Check for the existence of the file "AppRun" in the source directory
  // and check whether it has 0755 permissions; if not, print a warning
  // and exit with an error code. If it is a symlink, resolve it.
  gchar *apprun_path = g_build_filename(source, "AppRun", NULL);
  if (g_file_test(apprun_path, G_FILE_TEST_EXISTS)) {
    GFile *apprun_file = g_file_new_for_path(apprun_path);
    GFileInfo *apprun_info =
        g_file_query_info(apprun_file, G_FILE_ATTRIBUTE_UNIX_MODE,
                          G_FILE_QUERY_INFO_NONE, NULL, NULL);
    if (apprun_info != NULL) {
      if ((g_file_info_get_attribute_uint32(apprun_info,
                                            G_FILE_ATTRIBUTE_UNIX_MODE) &
           0755) != 0755) {
        fprintf(stderr, "Error: AppRun file does not have 0755 permissions. "
                        "Please fix it, then retry.\n");
        return 1;
      }
    }
  }

  // Check whether the source directory has 0755 permissions
  GFile *source_dir = g_file_new_for_path(source);
  GFileInfo *source_info =
      g_file_query_info(source_dir, G_FILE_ATTRIBUTE_UNIX_MODE,
                        G_FILE_QUERY_INFO_NONE, NULL, NULL);
  if (source_info != NULL) {
    if ((g_file_info_get_attribute_uint32(source_info,
                                          G_FILE_ATTRIBUTE_UNIX_MODE) &
         0755) != 0755) {
      fprintf(stderr, "Error: AppDir does not have 0755 permissions. "
                      "Please fix it, then retry.\n");
      return 1;
    }
  }
bksubhuti commented 1 year ago

Yes.. I see that instruction in the instructions does have that step. https://odilondamasceno.medium.com/creating-appimage-with-flutter-d19ef8b53158

I think what happened was I lost the files or it was not added to git .. so I added them again, but did not do that step to mark the apprun it as x since I only followed the recipe and forgot that it seems

probonopd commented 1 year ago

Please retry and see whether it works then. Also, please upload your AppImage to GitHub Releases in your GitHub repository. Thanks!

bksubhuti commented 1 year ago

however, according to my knowledge.. I'm just doing a work around for a bigger issue of fuselib2 As you can see in my other discussion, the other person had libfuse2 deleted from his OS. I think he uses pop!OS . My zip file still worked with him. There is also an issue with running. sudo apt install fuse (which installs fuse 3) reboot on ubuntu 23.04 and you will not reboot. You will crash.

So this whole thing related to my appimage not working is a separate issue (but I appreciate your help and commitment).

Yes.. I will try again. I'm sure it will work. It will take a few days.. I have to study.
I will try to upload to flathub as well. (I'm a monk). I have exams. :)

probonopd commented 1 year ago

No. This has nothing to do with fuse at all. AppRun must be chmod 0755 or else your AppDir/AppImage is broken.

probonopd commented 1 year ago

The package to install is libfuse2 (not fuse).

probonopd commented 1 year ago

Yes.. I will try again. I'm sure it will work.

Please post the new URL over at https://github.com/AppImage/appimage.github.io/pull/3182 once it is available, then I can re-run the test. Thanks!

bksubhuti commented 1 year ago

Yes.. it works.. Your help was appreciated. This will be good for our package.

probonopd commented 1 year ago

Is the fixed one available for download?

bksubhuti commented 1 year ago

uh.. now it is online.. I don't know how to upload to gihub releases just yet. But can do soon. I have github workflows working but it only goes down to 20.04

I have it uploaded for you at same link as before. I have libfuse2 installed on my Lubuntu 20.04 . I'm not sure if the static build happened or not. I think it is best to try to upload to appimagehub . I will try to learn what to do in the next few days.

bksubhuti commented 1 year ago

https://github.com/bksubhuti/tipitaka-pali-reader/releases/tag/v2.3.4-52

probonopd commented 1 year ago

@bksubhuti thank you very much, the test succeeded :+1:

bksubhuti commented 1 year ago

What was the test? (permission for AppRun or is fuse static linked now? I used the version you gave me to build it, but I did not test with libfuse2 removed from Lubuntu.

probonopd commented 1 year ago

This test: https://github.com/AppImage/appimage.github.io/pull/3182

bksubhuti commented 1 year ago

the screenshot is just showing the initial setup screen you will need to delay the screen shot by 2 or 3 minutes.