Closed metayan closed 4 months ago
Step-by-step reproduction instructions (by running
brew
commands)
@metayan If you follow these instructions yourself: does it both install all these formulae and remove them? If you install them manually: are they removed every time?
Installed darktable 4.6.1 again, by tweaking the formula.
Then removed darktable.
This time the removal also tried to autoremove
other things:
brew install --cask darktable
==> Downloading https://github.com/darktable-org/darktable/releases/download/release-4.6.1/darktable-4.6.1-x86_64.dmg
==> Installing Cask darktable
==> Moving App 'darktable.app' to '/Applications/darktable.app'
🍺 darktable was successfully installed!
brew remove darktable
==> Uninstalling Cask darktable
==> Backing App 'darktable.app' up to '/usr/local/Caskroom/darktable/4.6.1/darktable.app'
==> Removing App '/Applications/darktable.app'
==> Purging files for version 4.6.1 of Cask darktable
==> Autoremoving 1 unneeded formula:
ntfs-3g
Error: ntfs-3g is pinned. You must unpin it to uninstall.
brew info ntfs-3g
==> ntfs-3g: stable 2022.10.3, HEAD [pinned at 2017.3.23_3]
Read-write NTFS driver for FUSE
https://www.tuxera.com/community/open-source-ntfs-3g/
Installed
/usr/local/Cellar/ntfs-3g/2017.3.23_3 (89 files, 1.7MB) *
Poured from bottle on 2020-06-20 at 01:53:27
Feel free to ask for more info if needed.
I just feel that removing a cask – that has no Homebrew dependencies – shouldn't remove any installed apps that have nothing to do with the cask in question.
What does brew autoremove --dry-run
output?
brew autoremove --dry-run
==> Would autoremove 1 unneeded formula:
ntfs-3g
But it already removed all the autoremovable formulas before, when doing
brew remove darktable
as I reported above.
And ntfs-3g
is pinned.
@metayan Can you paste the output of cat $(brew --prefix ntfs-3g)/INSTALL_RECEIPT.json
? Thanks.
cat $(brew --prefix ntfs-3g)/INSTALL_RECEIPT.json |jq '.'
{
"homebrew_version": "2.4.0-53-g748af98",
"used_options": [],
"unused_options": [],
"built_as_bottle": true,
"poured_from_bottle": true,
"installed_as_dependency": null,
"installed_on_request": null,
"changed_files": [
"sbin/mount_ntfs",
"INSTALL_RECEIPT.json",
"lib/pkgconfig/libntfs-3g.pc"
],
"time": 1592610807,
"source_modified_time": 1490262180,
"HEAD": null,
"stdlib": null,
"compiler": "clang",
"aliases": [],
"runtime_dependencies": [
{
"full_name": "gettext",
"version": "0.20.2"
}
],
"source": {
"path": "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ntfs-3g.rb",
"tap": "homebrew/core",
"spec": "stable",
"versions": {
"stable": "2017.3.23",
"devel": "",
"head": "HEAD",
"version_scheme": 0
}
}
}
"installed_as_dependency": null, "installed_on_request": null,
These lines are causing autoremove
to try and remove the formula. You can stop this from happening by running:
brew tab --installed-on-request ntfs-3g
I'm not totally sure why the values where written as null
, but perhaps it has something to do with brew pin
handling? Either way, we should handle this case by erring on the side of caution and not removing the formula. I've opened a PR to implement this.
The pinned formula was not removed, so no worries about that.
The issue is that 89 formulas were autoremoved when a cask was removed. Formulas that had nothing to do with the cask. As can be seen above after
==> Autoremoving 89 unneeded formulae:
At least a request for confirmation that 89 formulas will be removed would be appropriate.
The PR merged should indeed fix this problem.
In this case, the problem seems to be that somehow the install metadata on your system was messed up, and did not properly mark that those formulae were installed at your request (as opposed to as a dependency for something else). I'm not sure at the moment why that happened, but the PR I merged strengthens the check so that Homebrew treats messed up metadata as "not sure, but let's assume they are installed on request and keep them around just in case." In the future, autoremove will only remove formulae that have "installed_on_request": false
(as opposed to null
) to avoid this from happening again.
Great. Thanks for the explanation. And the fix.
brew doctor
outputVerification
brew doctor
output" above saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
twice and am still able to reproduce my issue.brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.brew config
outputWhat were you trying to do (and why)?
brew remove darktable
because I first did
brew upgrade --cask darktable
but it seemed to get upgraded to a version that needs Ventura: Error: darktable: This software does not run on macOS versions older than Ventura.What happened (include all command output)?
==> Uninstalling Cask darktable ==> Backing App 'darktable.app' up to '/usr/local/Caskroom/darktable/4.6.1/darktable.app' ==> Removing App '/Applications/darktable.app' ==> Purging files for version 4.6.1 of Cask darktable ==> Autoremoving 89 unneeded formulae: antiword arpack atkmm autoconf-archive binaryen boost-python cd-discid check clutter clutter-gtk cmuclmtk cogl cppunit dep dnstracer doctest elinks epsilon exempi ext2fuse fluid-synth fortune freexl ftgl geoip gifsicle glpk gnome-doc-utils graphene gstreamer httpd id3lib id3v2 libbs2b libccd libcroco libcue libdap libdvdcss libdvdnav libdvdread libebml libgeotiff libmatroska libmetalink libquvi librttopo libsmi libspatialite libstfl libvo-aacenc lua@5.1 luajit-openresty lynx mcrypt mhash miniupnpc minizip mplayershell newlisp ngrep nlopt ntfs-3g numpy@1.16 ode openexr@2 openjdk@11 pangomm po4a podofo proctools proj qrencode quvi ruby@3.0 sane-backends scapy schroedinger smpeg2 sqlcipher stk szip tbb@2020 texi2html uchardet unrar wiiuse wv xerces-c Uninstalling /usr/local/Cellar/ext2fuse/0.8.1_2... (8 files, 102.8KB) Uninstalling /usr/local/Cellar/ngrep/1.47... (7 files, 91.5KB) Uninstalling /usr/local/Cellar/exempi/2.6.2... (18 files, 4.5MB) Uninstalling /usr/local/Cellar/binaryen/111... (1,633 files, 46.7MB) Uninstalling /usr/local/Cellar/lynx/2.8.9rel.1_1... (11 files, 2.2MB) Uninstalling /usr/local/Cellar/sane-backends/1.1.1_1... (464 files, 19MB) Uninstalling /usr/local/Cellar/arpack/3.8.0_2... (40 files, 1.1MB) Uninstalling /usr/local/Cellar/miniupnpc/2.2.4... (22 files, 272KB) Uninstalling /usr/local/Cellar/quvi/0.4.2... (8 files, 95.5KB) Uninstalling /usr/local/Cellar/libgeotiff/1.7.1_2... (39 files, 719.6KB) Uninstalling /usr/local/Cellar/mplayershell/0.9.3... (5 files, 131.3KB) Uninstalling /usr/local/Cellar/ftgl/2.1.3-rc5... (35 files, 734.6KB) Uninstalling /usr/local/Cellar/gnome-doc-utils/0.20.10_1... (262 files, 3.4MB) Uninstalling /usr/local/Cellar/nlopt/2.7.1... (24 files, 588KB) Uninstalling /usr/local/Cellar/texi2html/5.0... (278 files, 6.2MB) Uninstalling /usr/local/Cellar/libvo-aacenc/0.1.3... (16 files, 300.3KB) Uninstalling /usr/local/Cellar/autoconf-archive/2022.09.03... (599 files, 3.6MB) Uninstalling /usr/local/Cellar/openjdk@11/11.0.16.1_1... (678 files, 299.8MB) Uninstalling /usr/local/Cellar/po4a/0.68_1... (677 files, 5.6MB) Uninstalling /usr/local/Cellar/id3v2/0.1.12... (6 files, 92KB) Uninstalling /usr/local/Cellar/dnstracer/1.9... (6 files, 42KB) Uninstalling /usr/local/Cellar/doctest/2.4.9... (11 files, 413.7KB) Uninstalling /usr/local/Cellar/epsilon/0.9.2... (17 files, 305.8KB) Uninstalling /usr/local/Cellar/proctools/0.4pre1... (9 files, 113.1KB) Uninstalling /usr/local/Cellar/scapy/2.3.3... (150 files, 2.4MB) Uninstalling /usr/local/Cellar/fluid-synth/2.3.0... (42 files, 2.3MB) Uninstalling /usr/local/Cellar/wv/1.2.9_1... (488 files, 1.2MB) Uninstalling /usr/local/Cellar/geoip/1.6.12... (18 files, 548.6KB)
Warning: The following may be geoip configuration files and have not been removed! If desired, remove them manually with
rm -rf
: /usr/local/etc/GeoIP.conf /usr/local/etc/GeoIP.conf.default Uninstalling /usr/local/Cellar/libspatialite/5.0.1_2... (40 files, 24.5MB) Uninstalling /usr/local/Cellar/cppunit/1.15.1... (90 files, 1.3MB) Uninstalling /usr/local/Cellar/openexr@2/2.5.8... (152 files, 6.9MB) Uninstalling /usr/local/Cellar/libdvdnav/6.1.1... (20 files, 320.8KB) Uninstalling /usr/local/Cellar/xerces-c/3.2.4... (1,686 files, 38.3MB) Uninstalling /usr/local/Cellar/libsmi/0.5.0... (476 files, 20.1MB) Uninstalling /usr/local/Cellar/stk/4.6.2... (1,184 files, 18.6MB) Uninstalling /usr/local/Cellar/wiiuse/0.15.5... (10 files, 210.8KB) Uninstalling /usr/local/Cellar/libcue/2.2.1... (20 files, 119.7KB) Uninstalling /usr/local/Cellar/libstfl/0.24_13... (19 files, 619.2KB) Uninstalling /usr/local/Cellar/pangomm/2.50.1... (70 files, 693KB) Uninstalling /usr/local/Cellar/libdap/3.20.11... (163 files, 6.8MB) Uninstalling /usr/local/Cellar/clutter-gtk/1.8.4_4... (45 files, 304.6KB) Uninstalling /usr/local/Cellar/boost-python/1.74.0... (460 files, 5.5MB) Error: ntfs-3g is pinned. You must unpin it to uninstall. Uninstalling /usr/local/Cellar/glpk/5.0... (179 files, 3.4MB) Uninstalling /usr/local/Cellar/libmatroska/1.7.1... (43 files, 775.8KB) Uninstalling /usr/local/Cellar/atkmm/2.36.2... (57 files, 692.1KB) Uninstalling /usr/local/Cellar/libcroco/0.6.13_1... (80 files, 1.7MB) Uninstalling /usr/local/Cellar/ode/0.16.2... (38 files, 1.5MB) Uninstalling /usr/local/Cellar/schroedinger/1.0.11... (83 files, 2.2MB) Uninstalling /usr/local/Cellar/httpd/2.4.54_1... (1,662 files, 31.8MB)Warning: The following httpd configuration files have not been removed! If desired, remove them manually with
rm -rf
: /usr/local/etc/httpd /usr/local/etc/httpd/extra /usr/local/etc/httpd/extra/httpd-autoindex.conf /usr/local/etc/httpd/extra/httpd-dav.conf /usr/local/etc/httpd/extra/httpd-default.conf /usr/local/etc/httpd/extra/httpd-info.conf /usr/local/etc/httpd/extra/httpd-languages.conf /usr/local/etc/httpd/extra/httpd-manual.conf /usr/local/etc/httpd/extra/httpd-manual.conf.default /usr/local/etc/httpd/extra/httpd-mpm.conf /usr/local/etc/httpd/extra/httpd-multilang-errordoc.conf /usr/local/etc/httpd/extra/httpd-ssl.conf /usr/local/etc/httpd/extra/httpd-userdir.conf /usr/local/etc/httpd/extra/httpd-vhosts.conf /usr/local/etc/httpd/extra/proxy-html.conf /usr/local/etc/httpd/httpd.conf /usr/local/etc/httpd/httpd.conf.default /usr/local/etc/httpd/magic /usr/local/etc/httpd/magic.default /usr/local/etc/httpd/mime.types /usr/local/etc/httpd/original /usr/local/etc/httpd/original/extra /usr/local/etc/httpd/original/extra/httpd-autoindex.conf /usr/local/etc/httpd/original/extra/httpd-dav.conf /usr/local/etc/httpd/original/extra/httpd-default.conf /usr/local/etc/httpd/original/extra/httpd-info.conf /usr/local/etc/httpd/original/extra/httpd-languages.conf /usr/local/etc/httpd/original/extra/httpd-manual.conf /usr/local/etc/httpd/original/extra/httpd-manual.conf.default /usr/local/etc/httpd/original/extra/httpd-mpm.conf /usr/local/etc/httpd/original/extra/httpd-multilang-errordoc.conf /usr/local/etc/httpd/original/extra/httpd-ssl.conf /usr/local/etc/httpd/original/extra/httpd-userdir.conf /usr/local/etc/httpd/original/extra/httpd-vhosts.conf /usr/local/etc/httpd/original/extra/proxy-html.conf /usr/local/etc/httpd/original/httpd.conf /usr/local/etc/httpd/original/httpd.conf.defaultWarning: The following may be httpd configuration files and have not been removed! If desired, remove them manually with
rm -rf
: /usr/local/etc/lighttpd Uninstalling /usr/local/Cellar/sqlcipher/4.5.2... (13 files, 4.3MB) Uninstalling /usr/local/Cellar/gifsicle/1.93... (9 files, 382.4KB) Uninstalling /usr/local/Cellar/graphene/1.10.8... (36 files, 1MB) Uninstalling /usr/local/Cellar/luajit-openresty/2.1-20220915... (38 files, 1.8MB) Uninstalling /usr/local/Cellar/dep/0.5.4... (7 files, 11.6MB) Uninstalling /usr/local/Cellar/unrar/6.0.1... (6 files, 524.9KB) Uninstalling /usr/local/Cellar/mcrypt/2.6.8... (18 files, 396.4KB) Uninstalling /usr/local/Cellar/cmuclmtk/0.7... (44 files, 564.7KB) Uninstalling /usr/local/Cellar/qrencode/4.1.1... (13 files, 207.6KB) Uninstalling /usr/local/Cellar/gstreamer/1.20.4... (220 files, 15.2MB) gstreamer 1.20.3 is still installed. To remove all versions, run: brew uninstall --force gstreamer Uninstalling /usr/local/Cellar/antiword/0.37... (39 files, 553.9KB) Uninstalling /usr/local/Cellar/cd-discid/1.4_2... (6 files, 37.3KB) Uninstalling /usr/local/Cellar/newlisp/10.7.5... (37 files, 1.7MB) Uninstalling /usr/local/Cellar/libbs2b/3.1.0... (15 files, 75.6KB) Uninstalling /usr/local/Cellar/libmetalink/0.1.3... (31 files, 178.8KB) Uninstalling /usr/local/Cellar/uchardet/0.0.7... (13 files, 543.3KB) Uninstalling /usr/local/Cellar/check/0.15.2... (42 files, 533.0KB) Uninstalling /usr/local/Cellar/szip/2.1.1_1... (11 files, 108.6KB) Uninstalling /usr/local/Cellar/smpeg2/2.0.0... (23 files, 618.4KB) Uninstalling /usr/local/Cellar/ruby@3.0/3.0.4_1... (16,329 files, 39.2MB) Uninstalling /usr/local/Cellar/tbb@2020/2020_U3... (144 files, 3MB) Uninstalling /usr/local/Cellar/podofo/0.9.8_1... (154 files, 5MB) Uninstalling /usr/local/Cellar/fortune/9708... (117 files, 3.4MB) Uninstalling /usr/local/Cellar/numpy@1.16/1.16.6_1... (503 files, 10.7MB) Uninstalling /usr/local/Cellar/elinks/0.11.7_3... (43 files, 2.5MB) Uninstalling /usr/local/Cellar/proj/9.1.0... (438 files, 596.2MB) Uninstalling /usr/local/Cellar/libebml/1.4.4... (42 files, 316.4KB) Uninstalling /usr/local/Cellar/libccd/2.1_1... (18 files, 108.7KB) Uninstalling /usr/local/Cellar/mhash/0.9.9.9... (19 files, 453.0KB) Uninstalling /usr/local/Cellar/libdvdread/6.1.3... (28 files, 588.1KB) Uninstalling /usr/local/Cellar/minizip/1.2.13... (14 files, 394.7KB) Uninstalling /usr/local/Cellar/librttopo/1.1.0... (12 files, 1MB) Uninstalling /usr/local/Cellar/id3lib/3.8.3_1... (29 files, 1.2MB) Uninstalling /usr/local/Cellar/freexl/1.0.6... (115 files, 899.2KB) Uninstalling /usr/local/Cellar/libquvi/0.4.1_2... (85 files, 356.6KB) Uninstalling /usr/local/Cellar/clutter/1.26.4... (390 files, 16.8MB) Uninstalling /usr/local/Cellar/lua@5.1/5.1.5_8... (22 files, 245.5KB)Warning: The following may be lua@5.1 configuration files and have not been removed! If desired, remove them manually with
rm -rf
: /usr/local/etc/luarocks51 /usr/local/etc/luarocks52 /usr/local/etc/luarocks53 Uninstalling /usr/local/Cellar/cogl/1.22.8... (179 files, 4.2MB) Uninstalling /usr/local/Cellar/libdvdcss/1.4.3... (18 files, 398.5KB)What did you expect to happen?
Expected only
darktable
to be removed, not a whole lot of unrelated formulas to be removed.Running on Catalina, so installing applications is already non-trivial, and having them uninstalled without asking for it is not nice, to put it mildly.
I'm aware of the fact that Catalina is unsupported, but this issue is most likely not related to only Catalina, but revealing a flaw in the general Homebrew removal logic, which is why I'm "sneaking" it through the reporting process.
Step-by-step reproduction instructions (by running
brew
commands)