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

Add sudo support for apt package installation in Terminal #1445

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lolsZz
Copy link

@lolsZz lolsZz commented Sep 6, 2024

Describe the changes you have made:

  1. A new sudo_install method in the Terminal class that:
    • First attempts to install a package without sudo
    • If that fails, it prompts the user for their sudo password
    • Then attempts to install the package using sudo with the provided password
  2. Modification of the run method to intercept apt install commands and use the
    new sudo_install method

These changes address the issue where Open Interpreter would crash when trying
to install packages that require sudo privileges. Now, it will handle such
installations more gracefully, improving the user experience and expanding the
capabilities of the interpreter.

Key benefits:

• Allows for seamless installation of packages requiring sudo privileges
• Improves security by using a more secure method of passing the sudo password
• Provides user feedback on the installation process
• Maintains the ability to install packages without sudo when possible

Note:
This implementation assumes the system is using apt as the package
manager. Further modifications may be needed to support other package managers
in the future.

Reference any relevant issues (e.g. "Fixes #000"):

Pre-Submission Checklist (optional but appreciated):

  • [ * ] I have included relevant documentation updates (stored in /docs)
  • [ * ] I have read docs/CONTRIBUTING.md
  • [ * ] I have read docs/ROADMAP.md

OS Tests (optional but appreciated):

  • Tested on Windows
  • Tested on MacOS
  • [ * ] Tested on Linux

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 this pull request may close these issues.

1 participant