I need install a packege how to curl in linux,

I need to install a package such as Curl on Linux, but the problem is that when it comes to installing it, I don’t know how to enter the superuser password when prompted.
Here is the function I’m using.

use std::process::Command; pub fn install_curl(package_manager: &str, args: &[&str]) -> bool { Command::new(package_manager) .args(args) .output() .map(|value| value.status.success()) .unwrap_or(false) } 

Example of command with Arch:

sudo pacman -S curl 

1 post - 1 participant

Read full topic