Mac卸载.net core sdk
2024-08-22 22:16:11
NET Core cli提供了卸载脚本
https://github.com/dotnet/cli/tree/master/scripts/obtain/uninstall
#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
# DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" current_userid=$(id -u)
if [ $current_userid -ne ]; then
echo "$(basename "$") uninstallation script requires superuser privileges to run" >&
exit
fi # this is the common suffix for all the dotnet pkgs
dotnet_pkg_name_suffix="com.microsoft.dotnet"
dotnet_install_root="/usr/local/share/dotnet"
dotnet_path_file="/etc/paths.d/dotnet"
dotnet_tool_path_file="/etc/paths.d/dotnet-cli-tools" remove_dotnet_pkgs(){
installed_pkgs=($(pkgutil --pkgs | grep $dotnet_pkg_name_suffix)) for i in "${installed_pkgs[@]}"
do
echo "Removing dotnet component - \"$i\"" >&
pkgutil --force --forget "$i"
done
} remove_dotnet_pkgs
[ "$?" -ne ] && echo "Failed to remove dotnet packages." >& && exit echo "Deleting install root - $dotnet_install_root" >&
rm -rf "$dotnet_install_root"
rm -f "$dotnet_path_file"
rm -f "$dotnet_tool_path_file" echo "dotnet packages removal succeeded." >&
exit
打开终端:
执行.sh文件
遇到问题:
1.Permission denied。就是没有权限。
解决方法:修改该文件dotnet-uninstall-pkgs.sh的权限 :使用命令: chmod 777 dotnet-unistall-pkgs.sh
2.dotnet-uninstall-pkgs.sh uninstallation script requires superuser privileges to run
解决方法,使用sudo命令用root权限执行,如下 sudo -u root bash dotnet-uninstall-pkgs.sh
最新文章
- python 学习笔记6(函数)
- codevs3143 二叉树的序遍历
- 2016年11月19日 星期六 --出埃及记 Exodus 20:10
- 使用VisualSVN Server搭建SVN服务器(转载)
- Cookie的读写
- Struts2与jQuery.ajax()的结合
- mysql 从data文件恢复数据库
- MyEclipse 在loading workbench 启动卡死
- C#中一些默认的预定义属性
- NemaStudio船舶模拟软件下载及破解
- (最详细)小米Note 3的Usb调试模式在哪里打开的流程
- 【C编程基础】C编译链接命令gccc
- GNU Screen Usage
- Modbus库开发笔记:Modbus ASCII Slave开发
- java学习笔记18(基本类型包装类,system类)
- mysql 设置外键 四大属性 CASCADE SET NULL NO ACTION RESTRICT 理解
- Java中的String问题
- 【spring学习笔记二】Bean
- GitLab-CI与GitLab-Runner
- Closest Number in Sorted Array