Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fedora 40 KDE #496

Closed
davidsoles opened this issue Apr 26, 2024 · 130 comments · Fixed by #522
Closed

Fedora 40 KDE #496

davidsoles opened this issue Apr 26, 2024 · 130 comments · Fixed by #522

Comments

@davidsoles
Copy link

Hi,
After the migration from Fedora 39 to 40, AM does not install correctly. When I run am -h or any other command, it says modules are missing.
What am I overlooking?

@Samueru-sama
Copy link
Contributor

Hi, After the migration from Fedora 39 to 40, AM does not install correctly. When I run am -h or any other command, it says modules are missing. What am I overlooking?

There has been some big recent changes to AM with group permissions and you may need to reinstall it, however there is a bug and the owner went to sleep just recently 😅

@davidsoles In the meantime remove am by running am -r am (or directly delete the contents inside /opt/am if that doesn't work) and reinstall am:

wget https://raw.githubusercontent.com/ivan-hc/AM/main/INSTALL && chmod a+x ./INSTALL && sudo ./INSTALL

And in APP-MANAGER change line 185 where it says if ! groups "$USER" | grep -qw sudo to if ! groups "$USER" | grep -qw root and it should work now.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

@davidsoles what version of AM?

has @Samueru-sama said, in the last version 6.6.3 we have added some security fixes to let more admins of the same system to use all the options, while non privileged users are only allowed to read the lists and use the apps, they can't handle their directories.

If you face problems in running any option of AM, just remove it this way:

sudo /opt/am/remove

and then, install it again (but first remove any INSTALL script from your $HOME):

wget https://raw.githubusercontent.com/ivan-hc/AM/main/INSTALL && chmod a+x ./INSTALL && sudo ./INSTALL

I've just merged the PR of @Samueru-sama to fix that #498

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

@Samueru-sama I've expanded the message to warn unprivileged users, trying to explain them the steps to follow:

Istantanea_2024-04-26_15-38-35

another user also had the same issue #499

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

@davidsoles is it working now?

@davidsoles
Copy link
Author

No. Is not working...
Screenshot_20240426_123843

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

Have you removed the old INSTALL script?

@davidsoles
Copy link
Author

Yes. I removed the INSTALL file, the folder in /opt/am and the am folder in $HOME/.cache

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

From the output, it seems that the modules are not downloaded. Try to run any command

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

I've found an issue here, now fixed 5a80d81

I don't know how, but I used the same installer without problems.

@davidsoles
Copy link
Author

Exactly. The installation process is failing. The modules folder is empty. None of the command are working.
am -h --> error
am -u --> error
I checked the list of dependencies and they all match.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

retry to re-install now, download the INSTALL script again

@davidsoles
Copy link
Author

davidsoles commented Apr 26, 2024

Same error.
Screenshot_20240426_125455
Screenshot_20240426_125648

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

OK, this is because the new installer checks for modules from the branch, so all you can see is an html file...and its strange, because on my debian machines this wont happen.

Edit the INSTALL script you downloaded and change this line:

MODULES=$(wget -q https://api.github.com/repos/ivan-hc/AM/contents/modules?ref="$AMBRANCH" -O - | grep download_url | cut -d '"' -f 4)

with

MODULES=$(wget -q https://api.github.com/repos/ivan-hc/AM/contents/modules -O - | grep download_url | cut -d '"' -f 4)

then reinstall using this script

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

I'm going testing this on Fedora.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

its strange, I've a VM of Fedora KDE and to installing AM has no problems... apart that I had to run the three commands one by one, I don't know why

wget https://raw.githubusercontent.com/ivan-hc/AM/main/INSTALL
chmod a+x ./INSTALL
sudo ./INSTALL

the long version does not work

@davidsoles
Copy link
Author

I'll try to do the same.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

please, thy now to install, a new PR was merged and worked https://github.com/ivan-hc/AM/pull/511/files

@davidsoles
Copy link
Author

Same error.

dsoles@beelink:~$ wget https://raw.githubusercontent.com/ivan-hc/AM/main/INSTALL && chmod a+x ./INSTALL && sudo ./INSTALL
INSTALL              100% [===========================================================>]    1.43K    --.-KB/s
                          [Files: 1  Bytes: 1.43K [4.06KB/s] Redirects: 0  Todo: 0  Err]
mv: cannot stat 'tmp/*.am': No such file or directory
chmod: cannot access './*.am': No such file or directory
rmdir: failed to remove 'tmp': Directory not empty
dsoles@beelink:/opt$ ll
total 0
drwxrwxr-x. 1 root   wheel  82 Apr 26 13:22 am
drwxr-xr-x. 1 dsoles root   10 Apr 24 18:27 brave.com
drwx--x--x. 1 dsoles root   12 Apr 24 18:01 containerd
drwxr-xr-x. 1 dsoles root  198 Apr 24 20:37 idea
drwxr-xr-x. 1 dsoles root  184 Apr 24 18:23 sublime_merge
drwxr-xr-x. 1 dsoles root  250 Apr 24 18:23 sublime_text
dsoles@beelink:/opt$ cd am/
dsoles@beelink:/opt/am$ tree
.
├── APP-MANAGER
├── modules
│   └── tmp
│       └── index.html
├── remove
└── x86_64-apps

3 directories, 4 files
dsoles@beelink:/opt/am$

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

I'm sorry for the inconvenience, I suggest uninstalling and reinstalling.

I downgraded from version 6.6.3 to version 6.6.2 to solve this and other issues.

AM is still not ready for this feature. Sorry.

@davidsoles
Copy link
Author

But in 6.6.2 I still get the same error. Don't feel pressured. I'll wait.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

The 6.6.3 release have changed permissions in the directories managed by AM, included the installed apps. You shold reinstall AM and chmod/chown the affected directories.

AM normally have always given the ownership to the first user that have installed AM. After this, all should act normally.

@davidsoles
Copy link
Author

My installation is completely new. I formatted my computer and installed Fedora 40 KDE, which was released on Wednesday.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

From about 30 minutes, AM has been restored to the 6.6.2 version, the last working one.

So also the INSTALL script is the same of the previous release and should work as always (since it is the same from 2 years).

If the issue persists also after a clean installation of AM, then the issue is somewhere else. I need to see some logs.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 26, 2024

@davidsoles @iPooPaLot I think I'll perform my tests on a VM of Fedora 40 to see if something is changed. Its not a distro I'm familiar with, but I'll try my best to solve this.

From the script INSTALL, this is the part that checks for modules:

# DOWNLOAD MODULES
MODULES=$(wget -q https://api.github.com/repos/ivan-hc/AM/contents/modules -O - | grep download_url | cut -d '"' -f 4)
for module in $MODULES; do
	for v in $module; do
		cd /opt/am/modules
		mkdir tmp
		cd tmp
		wget -q "$v"
		cd ..
		mv tmp/*.am ./
		chmod a+x ./*.am
		rmdir tmp
	done
done

and this is what the "$MODULE" variable should show:

Istantanea_2024-04-26_21-39-03 png

are you able to test this function into a SHELL?

@davidsoles
Copy link
Author

davidsoles commented Apr 26, 2024

Yes, I am debugging right now the downloading part, but I had to use jq command to extract the download_url part from the JSON file. I don't know who is returning the wrong info (grep or cut).

MODULES=$(wget -qO- https://api.github.com/repos/ivan-hc/AM/contents/modules | jq -r '.[].download_url')

@davidsoles
Copy link
Author

The output of your file in Fedora 40 is:

dsoles@beelink:~$ wget -q https://api.github.com/repos/ivan-hc/AM/contents/modules -O - | grep download_url | cut -d '"' -f 4
clean.am
dsoles@beelink:~$

@Samueru-sama
Copy link
Contributor

wget -q https://api.github.com/repos/ivan-hc/AM/contents/modules -O - | grep download_url | cut -d '"' -f 4

That's really weird, both work on my end:

image

@iPooPaLot
Copy link

I setup the global config file wget2rc inside /etc with the --user-agent option and am now works again.

Screenshot from 2024-04-27 10-16-03

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 27, 2024

I've not understand how it works

@iPooPaLot
Copy link

I've not understand how it works

magic.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 27, 2024

I must know what I can do to help Fedora users and others in case of problems.

@iPooPaLot
Copy link

Have the INSTALL script create the wget2rc file.

@Samueru-sama
Copy link
Contributor

Samueru-sama commented Apr 27, 2024

@davidsoles @iPooPaLot @Samueru-sama I've finally managed a way to use the wget binary from here, this is the script

I think it if better if you use the statically linked wget from busybox instead. I tested it with a few scripts and it had no issues.

The debian wget is not statically linked and it is likely that on some distros it will break.

You can also use a sed function that looks for wget2 in the system and if true changes wget for wget --user-agent="Wget/1.24.5" as you were told in the issue (similar to how you already silence the scripts).

EDIT: nothing to do, I still get AppStream errors about missing icons (that are in place instead, dammit)

@ivan-hc I don't have issues on my appimage, just that I had to make a dummy icon for it, I just updated it as well to include jq since they also release a statically linked binary as well.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 27, 2024

@Samueru-sama the solution has been already found by @iPooPaLot

Have the INSTALL script create the wget2rc file.

however I'm not familiar with wget2 and configuration files.

I've already talked with the upstream, I suggest to see our disscussion rockdaboot/wget2#314

Anyway, I'd like to know the opinion of @iPooPaLot and @davidsoles and other Fedora users out there on what I should do.

As far as I know, speaking with the wget2 developer, Fedora made a hasty decision, and it's up to Fedora 40 users to report the bug so they can improve support. They would definitely help improve wget2 itself.

As far as I'm concerned, I can only provide workarounds, and I could very well provide the same solution I provided to libfuse2: install wget 1.x with AM

NOTE, I will not offer to install wget directly with the INSTALL script, at most I can add a check to the main CLI, so that users are aware of the problems that the Fedora team has purposely brought to their users.

At most I could offer to create a configuration file in $HOME, but nothing more. I've decided to be more strict in what I choose to do with AM from now on.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 27, 2024

@davidsoles @iPooPaLot @Samueru-sama

What can you do to help me?

  • first I need a function in APP-MANAGER, above, to check if you are using "wget2", and if so add the option to a ".wget2rc" file to add in the "$HOME" or where favorite;
  • secondly, I need you to include the "WGET2RC" variable in APP-MANAGER, to indicate the path to the configuration file;
  • third, you need to install some apps, in order to check if what I wrote above works.

This should work for AppMan, but I'm not sure regarding "AM".

We try to avoid workarounds such as adding wget among the installable apps and deal with the novelty in the most standard way possible... given that what passes for Fedora will sooner or later become law for all distributions.

Stick to the discussion I had with the developer, and if you have any questions for him, please ask.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 27, 2024

@iPooPaLot what you wrote exactly in the wget2rc file?

@Samueru-sama
Copy link
Contributor

Samueru-sama commented Apr 27, 2024

@Samueru-sama the solution has been already found by @iPooPaLot

It's the same solution. just applied differently.

however I'm not familiar with wget2 and configuration files.

if command -v wget2 >/dev/null 2>&1; then
	mkdir /etc/wget && echo '--user-agent="Wget/1.24.5"' >> /etc/wget/wget2rc
fi

first I need a function in APP-MANAGER, above, to check if you are using "wget2", and if so add the option to a ".wget2rc" file to add in the "$HOME" or where favorite

The issue with having the config in home is that wget2 may not read the file when AM doing sudo operations. It will work with appman but not sure with am, better use /etc instead, however that will require elevated privileges.

@iPooPaLot
Copy link

@iPooPaLot what you wrote exactly in the wget2rc file?

--user-agent="Wget/1.24.5"

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 27, 2024

this does not work for me

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 27, 2024

I think it if better if you use the statically linked wget from busybox instead. I tested it with a few scripts and it had no issues.

The debian wget is not statically linked and it is likely that on some distros it will break.

@Samueru-sama it may work on Arch Linux, not on Fedora (I've tested it), the one from Debian is the one that works for me

@iPooPaLot
Copy link

The am -u works fine, but when trying to install fastfetch it shows an error.

Screenshot from 2024-04-27 17-22-47

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 27, 2024

am -u works also for unprivileged users... if no app or module must be replaced. Just remove a module from /opt/am/module and you will see

I think I'll upload wget at this point

@Samueru-sama
Copy link
Contributor

@Samueru-sama it may work on Arch Linux, not on Fedora (I've tested it), the one from Debian is the one that works for me

Alright I booted a fedora40 iso and it is true 😕 busybox wget gives missing TLS certificate errors.

This shit is a nightmare lol.

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 28, 2024

I'm going merging this to close the issue #522

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 28, 2024

@Samueru-sama what if i switch all api.github.com related references from

wget -q https://api.github.com/repos/$REPO/releases -O -

to

curl -L -s https://api.github.com/repos/$REPO/releases

?

@nazdridoy is your $HeaderAuthWithGITPAT compatilbe?

@Samueru-sama
Copy link
Contributor

@Samueru-sama what if i switch all api.github.com related references from

wget -q https://api.github.com/repos/$REPO/releases -O -

to

curl -L -s https://api.github.com/repos/$REPO/releases

?

@nazdridoy is your $HeaderAuthWithGITPAT compatilbe?

If it works then great. I don't see a reason not to do it.

I also found a way to hack json to be filtered with sed and grep. For example this works with both wget and wget2:

wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed 's/"/ /g; s/ /\n/g' | grep -o 'https.*continuous.*tool.*86_64.*mage$'

Sed is removing all " and replacing it with empty spaces, then it turns all spaces into new lines. that way the info is split into a list that grep can then match. Which in the example above a single grep with wildcards can find the right url. (the $ indicates end of line and prevents .zsync from being grepped).

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 28, 2024

@Samueru-sama let talk at #524

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 28, 2024

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 28, 2024

What if i switch all api.github.com related references from

wget -q https://api.github.com/repos/$REPO/releases -O -

to

curl -L -s https://api.github.com/repos/$REPO/releases

?

@nazdridoy is your $HeaderAuthWithGITPAT compatilbe?

@nazdridoy UP!

@ivan-hc
Copy link
Owner

ivan-hc commented Apr 28, 2024

@nazdridoy for example

curl -Ls $HeaderAuthWithGITPAT https://api.github.com/repos/$RESPONSE/releases

and

curl -Ls --header "Authorization: token $2" 'https://api.github.com/repos/ivan-hc/AM/releases'

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants