序言
下面可能会工作,也可能不会,这都是按原样给出的,你,只有你是负责任的人,以防一些损坏,数据丢失等。但我希望一切顺利!
要撤消make install,我将这样做(我确实这样做了):
想法:检查任何脚本安装和撤销这与简单的bash脚本。
Reconfigure your build dir to install to some custom dir. I usually do this: --prefix=$PWD/install. For CMake, you can go to your build dir, open CMakeCache.txt, and fix CMAKE_INSTALL_PREFIX value.
Install project to custom directory (just run make install again).
Now we push from assumption, that make install script installs into custom dir just same contents you want to remove from somewhere else (usually /usr/local). So, we need a script.
3.1. Script should compare custom dir, with dir you want clean. I use this:
anti-install.sh
RM_DIR=$1
PRESENT_DIR=$2
echo "Remove files from $RM_DIR, which are present in $PRESENT_DIR"
pushd $RM_DIR
for fn in `find . -iname '*'`; do
# echo "Checking $PRESENT_DIR/$fn..."
if test -f "$PRESENT_DIR/$fn"; then
# First try this, and check whether things go plain
echo "rm $RM_DIR/$fn"
# Then uncomment this, (but, check twice it works good to you).
# rm $RM_DIR/$fn
fi
done
popd
3.2. 现在只需运行这个脚本(它将进行试运行)
bash anti-install.sh <dir you want to clean> <custom installation dir>
例如,你不想清理/usr/local,而你的自定义安装目录是/user/me/llvm。构建/安装,然后就是
bash anti-install.sh /usr/local /user/me/llvm.build/install
3.3. 仔细检查日志,如果命令对你来说是好的,取消注释rm $RM_DIR/$fn并重新运行它。但是停止!你真的仔细检查过吗?可以再检查一下吗?
指令来源:
https://dyatkovskiy.com/2019/11/26/anti-make-install/
好运!