Completely Removing a Package (MacTex)


(Githubnewbie1962) #1

Hi,
First post - thank you for letting me join the group.

I installed MacTex on a 10.13.16 Mac via the web, but something went wrong with the installation, so I removed the tex directory in /Applications and also removed /Library/TeX. Then I run…

brew cask install mactex
^C==> Satisfying dependencies
==> Installing Formula dependencies: ghostscript
==> Installing dependencies for ghostscript: jpeg, libtiff, little-cms2
Error: Cannot link jpeg
Another version is already linked: /usr/local/Cellar/jpeg/9b

Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Homebrew/Library/Homebrew/keg.rb:422:in `link'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:577:in `block in install_dependency'
/usr/local/Homebrew/Library/Homebrew/utils.rb:399:in `ignore_interrupts'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:575:in `rescue in install_dependency'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:540:in `install_dependency'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:534:in `block in install_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:534:in `each'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:534:in `install_dependencies'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:251:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:300:in `block (2 levels) in formula_dependencies'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:294:in `tap'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:294:in `block in formula_dependencies'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:293:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:293:in `formula_dependencies'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:233:in `satisfy_dependencies'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:59:in `fetch'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:90:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:21:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:14:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:14:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/abstract_command.rb:34:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:89:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:155:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:120:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:7:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'

So I try to unlink jpeg…

brew unlink /usr/local/bin/cjpeg
Error: cjpeg: /usr/local/Cellar/jpeg/9b/bin/cjpeg:1: invalid multibyte char (UTF-8)

And…

brew unlink cjpeg
Error: No such keg: /usr/local/Cellar/cjpeg

So at this point, I’m stumped. Oh, I I also tried brew cleanup.

All advice on how to install a fresh, clean version of MacTex, gratefully received.


(Githubnewbie1962) #2

I think I fixed it.

sudo chown -R $(whoami) /usr/local/bin /usr/local/sbin

And then

brew reinstall jpeg

And then I tried again to install mactex, and it looks to be working.


(Sean Molenaar) #3

Good to hear it’s fixed