Remove all packages from a pear channel
Dezember 20th, 2012
The PEAR installer has no option to remove all packages from a channel at once. So I’ve crafted a small shell script for that task:
#!/bin/bash
CHANNEL_NAME="THE NAME"
for pkg in $(pear list -c "$CHANNEL_NAME" \
| awk '{if ( $2 ~ /([0-9]+)\.([0-9]+)\.([0-9]+)/ ) print $1}') ; do
pear uninstall "$CHANNEL_NAME/$pkg"
done
September 20th, 2014 at 12:06
should be:
pear uninstall ${CHANNEL_NAME}/“$pkg“
September 20th, 2014 at 13:40
Sure, you are right! thanks!