Mac completely remove and uninstall pkg type software

created at 11-15-2021 views: 18

1 Problem description

The installation software with the .pkg suffix name was manually deleted and the uninstallation was not clean, causing the reinstallation to fail and unsuccessful.

Two solutions

1) Terminal run command line pkgutil --pkgs | grep -i name, name is the search keyword, fuzzy search may not match exactly. After running, it will retrieve a list of PKGID related to the name keyword,
Find out which one we need to uninstall completely;

 pkgutil --pkgs | grep -i xxxx

2) The terminal runs the command line pkgutil --files PKGID, PKGID is the pkg installation package id. After running, it will retrieve a list of file directories related to the PKGID installation package.
Just delete them one by one.

pkgutil --files PKGID

3) Terminal run command line sudo pkgutil --forget PKGID, PKGID is the pkg installation package id,
Delete the current pkg installation package record in mac after running.

created at:11-15-2021
edited at: 11-15-2021: