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

Installation in Debian 9 fails at the post-install script #6

Closed
amper5and opened this issue Oct 18, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@amper5and
Copy link

commented Oct 18, 2017

Tried to install on Debian 9 with:

curl https://mega.nz/linux/MEGAsync/Debian_9.0/amd64/megacmd_0.9.4-3.1_amd64.deb --output megacmd.deb
apt install ./megacmd.deb -y

At the end of the install I get the following:

dpkg: error processing package megacmd (--configure):
 subprocess installed post-installation script returned error exit status 255
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Errors were encountered while processing:
 megacmd
E: Sub-process /usr/bin/dpkg returned an error code (1)

However mega-cmd seems to work fine.

Then I ran:

dpkg --configure -D 777 megacmd

to get the following output:

D000001: ensure_diversions: new, (re)loading
D000001: process queue pkg megacmd:amd64 queue.len 0 progress 1, try 1
D000040: checking dependencies of megacmd:amd64 (- <none>)
D000400:   checking group ...
D000400:     checking possibility  -> libc-ares2
D000400:       checking non-provided pkg libc-ares2:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libc6
D000400:       checking non-provided pkg libc6:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libcrypto++6
D000400:       checking non-provided pkg libcrypto++6:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libgcc1
D000400:       checking non-provided pkg libgcc1:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libpcre3
D000400:       checking non-provided pkg libpcre3:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libpcrecpp0v5
D000400:       checking non-provided pkg libpcrecpp0v5:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libssl1.1
D000400:       checking non-provided pkg libssl1.1:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> libstdc++6
D000400:       checking non-provided pkg libstdc++6:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> zlib1g
D000400:       checking non-provided pkg zlib1g:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000400:   checking group ...
D000400:     checking possibility  -> apt-transport-https
D000400:       checking non-provided pkg apt-transport-https:amd64
D000400:       is installed, ok and found
D000400:     found 3
D000400:   found 3 matched 0 possfixbytrig -
D000040: ok 2 msgs >><<
D000040:     checking Breaks
Setting up megacmd (0.9.4-3.1) ...
D000002: fork/exec /var/lib/dpkg/info/megacmd.postinst ( configure  )
cat: /usr/share/doc/megacmd/distro: No such file or directory
cat: /usr/share/doc/megacmd/version: No such file or directory
dpkg: error processing package megacmd (--configure):
 subprocess installed post-installation script returned error exit status 255
D000001: ensure_diversions: same, skipping
Errors were encountered while processing:
 megacmd

It seems that the following files aren't created:

/usr/share/doc/megacmd/distro
/usr/share/doc/megacmd/version

Which the postinstall script is trying to read.

Am I doing something wrong?

Thanks for any help.

@polmr

This comment has been minimized.

Copy link
Collaborator

commented Oct 18, 2017

That's confusing ... both files

/usr/share/doc/megacmd/distro
/usr/share/doc/megacmd/version

are included in megacmd.deb. (See dpkg -c ./megacmd.deb). They should be installed with apt prior to the postinstall script is executed.
Although it shouldn't happen (I've just tested), you can always trick it creating those files prior to execution:

echo "Debian GNU/Linux 9.1 (stretch)" >  /usr/share/doc/megacmd/distro
echo "9.1" > /usr/share/doc/megacmd/version

Or since, in the end it seems to be installed, you can have a non-failing script with:

apt install ./megacmd.deb -y || :

Although I wouldn't encourage that

@amper5and

This comment has been minimized.

Copy link
Author

commented Oct 18, 2017

Thanks for your reply. I did the echo's that you suggested before running apt install. Now I don't get the No such file or directory error, but I still get an error:

...
dpkg: error processing package megacmd (--configure):################################################################################################################################............]
 subprocess installed post-installation script returned error exit status 255
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Errors were encountered while processing:
 megacmd
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried to manually run the post-install script:

./var/lib/dpkg/info/megacmd.postinst

and that runs without error. I tried your recommendation apt install ./megacmd.deb -y || : , and that ends in the exact same error as above.

For reference, I am trying all of this on a clean Docker image debian:stretch-slim from the official repository (https://hub.docker.com/_/debian/) after I install curl.

@polmr

This comment has been minimized.

Copy link
Collaborator

commented Oct 18, 2017

I got it. it's docker excluding files from installing (more exactly it's the dpkg configuration on that particular container: debian:strecth-slim). You can surpass this doing:

echo path-include /usr/share/doc/megacmd/* > /etc/dpkg/dpkg.cfg.d/docker

I've also encountered another problem with postinstall script afterwards. apt cannot add a key. You need to install gnupg2 before installing megacmd.
After that you should be able to install it.

@amper5and

This comment has been minimized.

Copy link
Author

commented Oct 18, 2017

Beautifully diagnosed, thank you! I can confirm that this installation sequence works without any errors (I'll leave here for future reference):

apt-get update && apt-get install curl gnupg2 -y
curl https://mega.nz/linux/MEGAsync/Debian_9.0/amd64/megacmd_0.9.4-3.1_amd64.deb --output megacmd.deb
echo path-include /usr/share/doc/megacmd/* > /etc/dpkg/dpkg.cfg.d/docker
apt install ./megacmd.deb -y

Thanks so much!

@amper5and amper5and closed this Oct 18, 2017

@steve4444

This comment has been minimized.

Copy link

commented Dec 1, 2018

There is the same problem with the docker image mcr.microsoft.com/powershell, based on Ubuntu 18.04.1 LTS.

In this case

echo path-include=/usr/share/doc/megacmd/* > /etc/dpkg/dpkg.cfg.d/docker

does not help. I had to comment:

path-exclude=/usr/share/doc/*

in /etc/dpkg/dpkg.cfg.d/excludes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.