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

Linux: tools.system.package_manager:mode install doesn't work #183

Open
etodanik opened this issue Feb 22, 2024 · 3 comments
Open

Linux: tools.system.package_manager:mode install doesn't work #183

etodanik opened this issue Feb 22, 2024 · 3 comments
Assignees

Comments

@etodanik
Copy link

etodanik commented Feb 22, 2024

Conan complains a lot about not being able to install system packages on linux and asks to set tools.system.package_manager:mode from 'check' to 'install', however when that is done it fails to install anything because on Ubuntu apt install requires root (sudo).

@etodanik etodanik changed the title tools.system.package_manager:mode install doesn't work Linux: tools.system.package_manager:mode install doesn't work Feb 22, 2024
@memsharded memsharded self-assigned this Feb 22, 2024
@memsharded
Copy link
Member

Hi @etodanik

Thanks for your report.
This doesn't look like a bug. Conan will not inject sudo automatically to anything, unless the user explicitly says so.
There are configurations to manage that too:

$ conan config list | grep package_manager
tools.system.package_manager:mode: Mode for package_manager tools: 'check', 'report', 'report-installed' or 'install'
tools.system.package_manager:sudo: Use 'sudo' when invoking the package manager tools in Linux (False by default)
tools.system.package_manager:sudo_askpass: Use the '-A' argument if using sudo in Linux to invoke the system package manager (False by default)
tools.system.package_manager:tool: Default package manager tool: 'apk', 'apt-get', 'yum', 'dnf', 'brew', 'pacman', 'choco', 'zypper', 'pkg' or 'pkgutil'

Seems like you want to activate tools.system.package_manager:sudo=True too

@etodanik
Copy link
Author

If I do sudo = True it complains that there is no terminal. I do think it's a 'bug' insomuch that something like this should be anticipated (whole Linux userbase would suffer) and provided as a more coherent instruction / error.

Right now it looks like this plugin won't be able to install any packages because it doesn't run in an interactive terminal.

@memsharded
Copy link
Member

If I do sudo = True it complains that there is no terminal.

Ok, that would be something I was not aware and need to be investigated.
Pinging @czoido and @RubenRBS for feedback about this.

@czoido czoido self-assigned this Feb 22, 2024
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

No branches or pull requests

3 participants