卸载
make uninstall
首先需要检查卸载是否存在,使用make help
..[$] <( (git)-[release-0.6.3]-)> make help
The following are some of the valid targets for this Makefile:
... all (the default if no target is provided)
... clean
... depend
... install/strip
... install/local
... install
... list_install_components
... rebuild_cache
... edit_cache
... osqp_demo
... osqp
... osqpstatic
... linsys_pardiso
... linsys_qdldl
... uninstall
... qdldl_example
... qdldlstatic
... qdldl
... qdldlobject
可以看到uninstall 存在,那么直接运行 make uninstall
即可,注意是在build文件夹下
根据installl_manifest.txt卸载
查看该文件是否存在,可以对照文件所列出的目录直接删除;也可以直接利用xargs删除
cat install_manifest.txt | sudo xargs rm
也可以使用下面的脚本进行删除
MANIFEST="install_manifest.txt"
if [ ! -f "$MANIFEST" ]; then
echo "install_manifest.txt not found!"
exit 1
fi
#IFS= 将内部字段分隔符设置为空值
#每一行读入变量 file
while IFS= read -r file; do
if [ -f "$file" ]; then
echo "Removing $file"
sudo rm "$file"
elif [ -d "$file" ]; then
echo "Removing directory $file"
sudo rmdir "$file"
else
echo "File $file does not exist, skipping"
fi
done < "$MANIFEST" # 指定循环的输入是 MANIFEST 文件。
chmod +x uninstall.sh
./uninstall.sh