Home >Backend Development >Python Tutorial >A python script to uninstall pkg on MacOS

A python script to uninstall pkg on MacOS

Patricia Arquette
Patricia ArquetteOriginal
2024-11-08 09:56:021102browse

A python script to uninstall pkg on MacOS

Script is here https://github.com/dilawar/Scripts/blob/master/pkg_uninstall.py

Usage

A sample run is shown below. Pass the pkg name as first argument to this script. The script will print the names of installed packages that matches the query. You select the pkg that you want to remove.

dilawar@halwa ~/Scripts (master)> sudo python3 pkg_uninstall.py clamav
0: com.cisco.ClamAV.programs
1: com.cisco.ClamAV.libraries
2: com.cisco.ClamAV.documentation
Select a package to uninstall 0            
Uninstalling com.cisco.ClamAV.programs
Forgot package 'com.cisco.ClamAV.programs' on '/'.
dilawar@halwa ~/Scripts (master)> sudo python3 pkg_uninstall.py clamav
0: com.cisco.ClamAV.libraries
1: com.cisco.ClamAV.documentation
Select a package to uninstall 0
Uninstalling com.cisco.ClamAV.libraries
Forgot package 'com.cisco.ClamAV.libraries' on '/'.

And that’s it.

The above is the detailed content of A python script to uninstall pkg on MacOS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn