Come rimuovere le botti obsolete da Homebrew?

9

Sto usando homebrew-cask per mantenere aggiornato il mio ecosistema di applicazioni. È fantastico quando si gestiscono diversi computer a casa, in viaggio o in viaggio.

Tuttavia, quando alcuni pacchetti vengono aggiornati (come Google Chrome), finisco per avere diverse versioni simultanee installate (e che sono viste dal sistema operativo):

$ ls /opt/homebrew-cask/Caskroom/google-chrome/ latest stable-channel

Questo succede quando si aggiorna una botte:

$ ls -l /opt/homebrew-cask/Caskroom/tunnelblick
total 0
drwxr-xr-x 5 foo staff 238 Mar 11 07:42 3.3.0
drwxr-xr-x 5 foo staff 238 May 13 13:53 3.3.2
[13:00:40] foo at bar in ~
$ brew cask install --force tunnelblick
==> Caveats
For security reasons, Tunnelblick must be installed to /Applications and will request to be moved at launch.

==> Downloading https://downloads.sourceforge.net/project/tunnelblick/All%20files/Tunnelblick_3.3.4.dmg
######################################################################## 100.0%
==> It seems there is already an App at '/Applications/Tunnelblick.app'; not linking.
                    
posta meduz 21.06.2014 - 13:25
fonte

1 risposta

1

In Terminale, digita:

for app in $(brew cask list); do cver="$(brew cask info "${app}" | head -n 1 | cut -d " " -f 2)"; ivers=$(ls -1 "/opt/homebrew-cask/Caskroom/${app}/.metadata/" | tr '\n' ' ' | sed -e 's/ $//'); aivers=(${ivers}); nvers=$(echo ${#aivers[@]}); echo "[*] Found ${app} in cask list. Latest available version is ${cver}. You have installed version(s): ${overs}"; if [[ ${nvers} -eq 1 ]]; then echo "${ivers}" | grep -q "^${cver}$" && { echo "[*] Latest version already installed :) Skipping changes ..."; continue; }; fi; echo "[+] Fixing from ${ivers} to ${cver} ..."; brew cask uninstall "${app}" --force; brew cask install "${app}"; done

Suggerimento: copia e incolla la riga di comando sopra nel Terminale.

    
risposta data 28.04.2016 - 10:46
fonte

Leggi altre domande sui tag