移除指定版次的php

由於以前安裝了很多版次的php,在更新時總會更新一堆內容,可以用這個方式來移除
dpkg -l | grep '^ii' | grep -E 'php[0-9]+\.[0-9]+' | awk '{print $2}' | grep php7.0 | tr '\n' ' '

列出的內容
php7.0-apcu php7.0-cli php7.0-common php7.0-curl php7.0-fpm php7.0-gd php7.0-igbinary php7.0-imagick php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-phpdbg php7.0-readline php7.0-soap php7.0-xml php7.0-zip

如果你發現沒有影響到其他程式的依賴性,就可以直接移除囉~
apt remove --purge [列出的內容]

留言

熱門文章