#manager #package-manager #pkg #linux #pacman #apt

pkg_manager

Wrapper to Linux Package Managers

2 releases

0.1.1 Apr 12, 2022
0.1.0 Apr 12, 2022

#18 in #pkg

MIT license

7KB
158 lines

Pkg Manager

pkg manager is a crate that provides a user friendly wrapper to linux package managers.

Support Package Managers

there are currently 2 supported package managers, apt and pacman

what can i do?

with this crate, you can install and remove packages!

Starting

use pkg_manager::PkgWrapper;
fn main() {
    let pkg = PkgWrapper::new(); //will autodetect your package manager
} 

Installing Packages

use pkg_manager::PkgWrapper;
fn main() {
    let pkg = PkgWrapper::new(true).unwrap(); //will autodetect your package manager, takes a boolean as argument (no_confirm)
    pkg.install_pkg("pkgname").unwrap();
} 

Uninstalling Packages

use pkg_manager::PkgWrapper;
fn main() {
    let pkg = PkgWrapper::new(true).unwrap(); //will autodetect your package manager, takes a boolean as argument (no_confirm)
    pkg.uninstall_pkg("pkgname").unwrap();
} 

Dependencies

~1.5MB
~36K SLoC