Pkg uninstall mac os

UninstallPKG 1.1.9

remove unwanted packages from your Mac

UninstallPKG is an application that allows you to completely remove so called «packages» (file-extension .pkg) and all their installed contents from your Mac. UninstallPKG can be used to reclaim precious disk-space by removing unwanted functionality like unused printer drivers or completely remove applications you no longer use. UninstallPKG can also keep your Mac clean by removing left-over files from applications that you have already partially removed manually. UninstallPKG can remove all 37290 files of Office 2016 at once or completely remove things like Java or the Flash plugin. UninstallPKG is also able to clean-up after uninstalling an application by removing it from the Dock and LoginItems and erasing the files it has generated (preferences etc).

SAFETY WARNING:

Usage is completely at your own risk. Make sure you remove only packages corresponding to applications or functionality you DO NOT WANT TO USE ANYMORE. Never uninstall packages where you do not know for sure what they are doing or providing. UninstallPKG is safer than other un-installers because it never removes files that are used by other packages, but uninstalling packages is still an inherently unsafe operation because packages may be depended on by other non-packaged software you are still using.

User Reviews:

System Requirements:

• macOS 10.14 ‘Mojave’ or later
• Localisations: 🇺🇸 English 🇨🇳 Simplified Chinese 🇩🇪 German (Partial Localisation)

License & Cost:

UninstallPKG is licensed under a proprietary license and costs 9.99$/€.
You can perform 5 un-installations for free before you need to buy the app.

Источник

Удаление программ в Mac OS установленных из пакетов .pkg

Мак ОС и установщики

Каждый, кто пересаживался на Mac OS был приятно удивлён, что во многих случаях установка программ на этой операционке сводится к простому «Перетащить программу в папку “Программы“» и всё. Дальше просто кликаешь по ней и она запускается. Я получал массу удовольствия от такого простого, дружелюбного и понятного подхода. Я чётко понимал: где я положил программу, там я её удалю и она попросту исчезнет. Лепота, да и только. Наверно многие были наслышаны о таком славном подходе в макоси. Но увы (или к счастью) нет ничего идеального и программы бывает нужно устанавливать и на маке, в полном смысле этого слова.

Меня это немного разочаровало в своё время, но до недавних пор это как-то не вызывало особых проблем, т.к. я пользовался нормальным софтом, который обычно поставлял с собой скрипты-деинсталляторы для .pkg пакетов. Но вот я решил установить программу FontForge для редактирования шрифтов, которая изначально разрабатывалась под идеологию linux и это моментально принесло с собой неразберху — FontForge.pkg начал методично размазывать себя по всевозможным папкам вместо того, чтобы попросту расположиться в «/Applications/FontForge.app». Что ещё более усложнило ситуацию — у FontForge отсутствовал какой-либо деинсталлятор. Когда пришло время удалить FontForge я задался вполне резонным вопросом: как же всё же по-человечески удалить программу установленную из .pkg, которая не предлагает полноценного деинсталлятора? Я бы и руками был согласен всё почистить, но я попросту не знал куда pkg раскидал файлы по диску.

Теория

Поискав по мануалам я нашёл более-менее порядочный способ. Для этого приходится перейти на уровень консоли чтобы выполнить удаление этой и подобно установленных программ. Делется это при помощи консольной утилиты lsbom.

Так повелось, что основная часть данных об уже установленных пакетах, начиная с Mac OS 10.6, лежат в папке «/var/db/receipts/» в виде .bom (bill of materials) файлов. Часть же пакетов (с bom файлами внутри) лежат в старом месте «/Library/Receipts/» — это основное место для предыдущих версий mac os. Поскольку в версиях mac os до 10.6 файлы bom могли лежать в пакетах, то выглядело (и выглядит) это примерно так:

Читайте также:  Как изменить порядок загрузки операционных систем linux windows

Начиная с 10.6, bom фалы в основном можно найти так:

Как уже наверно можно было догадаться, bom файл содержит данные о том, что было записано в файловую систему при инсталляции определённого пакета.

Практика

Наконец сами команды удаления установленного пакета с комментариями:
# Удаляем все файлы пакета:
# lsbom -fls выводит список файлов и символических ссылок созданных пакетом
# cd / — переходит в корень, т.к. все файлы в списке начинаются с «.»
# затем список файлов через xargs передаётся в rm, который запускается от имени root
lsbom -fls /var/db/receipts/AppName.bom | (cd /; sudo xargs rm)

# Удаляем все пустые папки аналогичным подходом.
lsbom -dls /var/db/receipts/AppName.bom | (cd /; sudo xargs rmdir -p)
# Удаляем файлы оставшиеся от установщика
sudo rm AppName.bom AppName.plist

Возможные проблемы

Надо быть очень осторожным с этими командами т.к. они во-первых выполняются от имени root, а во-вторых в корне файловой системы. Перед подобным удалением установленного пакета лучше убедитесь, что lsbom в списке файлов случайно не укажет какой-нибудь путь, который будучи удалённым из корня приведёт к удалению системных файлов. Так же не пробуйте удалять системные пакеты от Apple — у вас начнутся проблемы с обновлением и ещё бог весть с чем.

Я конечно же знаю про стороннюю утилиту PackageAssistant, которая позволяет управлять пакетами в системе, но последнее обновление у неё датируется 2008 годом. Анализ её исходников мною только подтверждает, что она не подходит для Mac OS 10.6, поскольку ею обрабатываются bom файлы только пакетов лежащих в «/Library/Receipts», а это, как я уже говорил, применимо только до 10.6.

P.S.: Вообще всё это вопрос добросовестности программистов на чьей ответственности лежит разработка инсталлятора (особенно учитывая факт, что Apple не предоставляет штатных gui средств для работы с установленными пакетами). Под остальными системами так же хватает безответственных программ, после которых систему можно сутками вычищать от хлама. От этого ни одна система не застрахована.

UPD: Как мне подсказали в каментах, можно так же воспользоваться другой консолной утилитой (она тоже не 100% панацея, но можно оба способа пробовать):

Источник

Pkg uninstall mac os

OS X Package Uninstaller

by Benjamin Gandon © 2015-2018

pkg-uninstall is a command line tool that helps in uninstalling OS X packages.

Several safe-guards are implemented in pkg-uninstall to ensure that the uninstallation process is somehow kept under control. But it will not prevent you from doing silly things like uninstalling core packages that are vital to your OS X system and applications.

This is inherent to OS X Packages. Thus, you are strongly advised to make a backup copy of your system prior to using pkg-uninstall . Go and setup Time Machine for that.

General usage form is:

Where package identifiers are to be found in the list of installed packages, as returned by pkgutil —pkgs .

So you should first make a backup copy of your system. Then, you should dry run pkg-uninstall with standard user privileges and the —dry-run option:

With this, you’ll see what would happen, without actually changing anything to the system.

Once you’re really sure of what you’re doing, you might finally run:

Several options can be specified.

—help : display usage informationdisplay usage information.

—version : display version number.

—dry-run (highly recommended for a first use): Explain what would happen during the uninstallation, without actually modifying the system. When running the tool with this option, you don’t need superuser privileges.

Читайте также:  Параметры uac windows 10

—verbose : be verbose about directories and files that are listed as part of the installed package, but that cannot be actually found in the file system.

—force : force uninstallation, even if some directories or some files are actually missing on the file system. This just bypasses safeguards that have the tool stop early in the process. It does not enforce any operations that are prevented by —dry-run .

—prefix-dir : specify one single installation prefix directory for all packages to uninstall, instead of fetching their individual InstallPrefixPath values that are stored in the receipts database. Package directories and files will have this directory prepended before tring to remove them from the file system. Both —prefix-dir= and —prefix-dir syntaxes are supported.

—infer-prefix-dir : for each package to uninstall, do not use the InstallPrefixPath value, but infer a suitable directory instead. This might take a long time to run. See below for more details.

Check that all specified packages are listed as installed before proceeding. Stop with failure message if one of them is not.

Check that the directories and files (that are listed as part of the packages) are actually present on the file system, taking any installation prefix directory into account. Report any issue about that (with details when —verbose ). Advise the user to —force uninstallation to proceed any further.

pkg-uninstall supports files and directories that include blanks like spaces and tabs. But it does not supports new line (LF) and double quotes («) charaters in filenames. If you run into such situation, then a rewrite in Perl (or any similar language) will be necessary to obtain the required robustness.

What is an OS X Installer Package?

These are .pkg files that are meant to be fed into the OS X Installer application. Apple introduced this concept to standardize the installation of system packages and applications. Without really thinking of any uninstallation step, though.

Identifiers of installed packages are listed by:

And the contents of a package can be inspected with:

But keep in mind that these files could be installed anywhere on your system during the installation process.

Moreover, the receipts database, that stores information about installed OS X Installer Packages dosen’t implement anything like dependency management. So, it cannot tell you: “Hey, you can’t uninstall this package because that one depends on it”. As a consequence, uninstalling one of the installed packages could break anything in the system or any application.

Thus, there is no built-in OS X tool to uninstall such packages in an automated manner.

Packages are not well designed to be uninstalled, and doing it is a pain. This tool was written as an attempt to solve this problem. Just like PackageUninstaller, but as a command-line tool.

Curious about the Receipts Database?

To browse the install history, just run:

And if you need to inspect the receipts database further:

Unsure about the right Installation Prefix Directory?

When specifying —infer-prefix-dir (without specifying any —prefix-dir ), pkg-uninstall will infer a suitable installation prefix directory for each specified package. This is an alternative to retrieving the InstallPrefixPath values from the receipts database, where OS X stores information about installed packages.

This alternative might be useful if the package has been moved or installed in a directory that is not the one that has been declared.

The algorithm performs the following steps:

  • List all package directories and locate them in the filesystem. Note that your locate database should be up-to-date for this to work reliably.
  • When all the directories listed in a package can be found in one single prefix directory, use it as installation prefix directory.
  • In case of multiple matches, advise the user to specify a —prefix-dir
  • In case no prefix can help finding all the package files and directories, advise the user to specify a —prefix-dir
Читайте также:  Unigram для windows 10

For this to work as expected, your locate database should be up-to-date. If unsure about whether it actually is, just refresh it prior to running pkg-uninstall —infer-prefix-dir :

You’ll notice this takes some time for all your file system to get indexed.

Similar Commercial Tools

Pull requests are welcome. Few guidelines should be observed, though:

  • New code should not break existing tests. Check this with bats ./test
  • Code should be easy to read.
  • Variable names should describe well the data they hold, in the context of what your code is doing.
  • Function names should properly describe what they do, in the context of your code (so that the name doesn’t get too long).
  • Functions should be short and do one thing.
  • Your code should include automated tests. Here we use the BATS technology.

You’ll also observe different conventions in main code, compared to test code.

    Main code is developped following my own habits of portable shell code. That’s why it looks a bit old fashionned, because bashisms constructs are avoided. Examples:

      Use expr a : b >/dev/null in favor of [[ a =

    b ]]

  • Use back-ticks in favor of $( . ) (even though it disallows nesting, which sometimes complicates things a little)
  • Use expr . in favor of $(( . ))
  • Avoid arrays and hashes (and thus use Perl instead)
  • .
  • Test code is BATS, so all bashisms are allowed there. Because it must be run in Bash anyway.
  • pkg-uninstall is released under the MIT License.

    Источник

    Uninstalling packages (.pkg files) on Mac OS XEdit

    It used to be the case that you could install packages on Mac OS X by using lsbom to inspect the list of installed files recorded in the files under /Library/Receipts .

    In Snow Leopard, that location changed to /private/var/db/receipts .

    At some point — I’m not sure which — Apple added an easier-to-use solution in the form of pkgutil .

    After visually inspecting the list of files you can do something like the following:

    ☠️ Beware! Modifying the filesystem with root privileges can be hazardous.

    To remove directories as well as files, list the directories from the package using:

    The following command could the be used to attempt removal of each directory, although be aware that when System Integrity Protection is active, there are some file paths that not even the root user may modify. Nevertheless — and needless to say — extreme care should always be taken when removing files with root privileges. Particularly, be aware that some packages may update shared system components, so uninstalling them can actually break your system by removing a necessary component. For smaller packages it is probably safer to just manually remove the files after visually inspecting the package file listing.

    ☠️ Beware! Modifying the filesystem with root privileges can be hazardous.

    Apparently, there was once an —unlink option available in pkgutil , but as of Lion it is not mentioned in the man page. Perhaps it was removed because it was deemed too dangerous.

    Once you’ve uninstalled the files, you can remove the receipt with:

    For more details, see the pkgutil man page.

    Источник

    Оцените статью