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

Can't install packages via conf.py #6919

Closed
Daltz333 opened this issue Apr 17, 2020 · 6 comments
Closed

Can't install packages via conf.py #6919

Daltz333 opened this issue Apr 17, 2020 · 6 comments
Labels
Support Support question

Comments

@Daltz333
Copy link

E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

Sudo also seems to not exist.

Using the following script

if os.environ.get("READTHEDOCS"):
    # Tries to grab draw.io deb
    drawio_download = \
        subprocess.run(["wget", "-O", "drawio.deb",
                        "https://github.com/jgraph/drawio-desktop/releases/download/v12.6.5/draw.io-amd64-12.6.5.deb"])

    if drawio_download.returncode == 0:
        # If we got the draw.io deb, install it, and xvfb to run headless
        drawio_install = subprocess.run(["apt-get", "install", "-qy", "--force-yes", "libasound2",
                                         "./drawio.deb", "xvfb"])
        print("Dependencies Installed" if drawio_install.returncode == 0 else "Error Installing Dependencies")
    else:
        print("Error Downloading Dependencies")
@Daltz333
Copy link
Author

We have some special dependencies

inkscape
drawio

that aren't included in RTD

@humitos humitos added the Support Support question label Apr 17, 2020
@Daltz333
Copy link
Author

Daltz333 commented Apr 20, 2020

It looks like this may be because the docker packages are not ran with the root user. Is there any alternative at all?

@Daltz333
Copy link
Author

Conda is an option, but the packages I want to use aren't on there. (drawio and inkscape)

@humitos
Copy link
Member

humitos commented Apr 21, 2020

Hi @Daltz333! We don't officially support installing arbitrary packages at build time. There are some people doing similar things in the conf.py but we don't recommend it and we can't guarantee that this will keep working in the future.

I saw that you also created an issue at readthedocs/readthedocs-docker-images#131. That's basically the way we install packages in our Docker images. As these packages affect all the builds we try to analyze if the package is a good candidate or not.

Summarizing, there is no workaround for this at the moment more than continue talking about these packages in the other issue you have created.

@humitos
Copy link
Member

humitos commented May 19, 2020

I'm closing this issue for now since we don't support installing packages using apt-get or other mechanisms. We should concentrate in the issue opened in the other repository, tho. Thanks!

@humitos
Copy link
Member

humitos commented Apr 11, 2022

This is currently possible by using build.apt_packages in the config file. See https://docs.readthedocs.io/en/stable/config-file/v2.html#build-apt-packages

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

No branches or pull requests

2 participants