NET Core cli提供了卸载脚本

https://github.com/dotnet/cli/tree/master/scripts/obtain/uninstall

dotnet-uninstall-pkgs.sh

#!/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

最新文章

  1. python 学习笔记6(函数)
  2. codevs3143 二叉树的序遍历
  3. 2016年11月19日 星期六 --出埃及记 Exodus 20:10
  4. 使用VisualSVN Server搭建SVN服务器(转载)
  5. Cookie的读写
  6. Struts2与jQuery.ajax()的结合
  7. mysql 从data文件恢复数据库
  8. MyEclipse 在loading workbench 启动卡死
  9. C#中一些默认的预定义属性
  10. NemaStudio船舶模拟软件下载及破解
  11. (最详细)小米Note 3的Usb调试模式在哪里打开的流程
  12. 【C编程基础】C编译链接命令gccc
  13. GNU Screen Usage
  14. Modbus库开发笔记:Modbus ASCII Slave开发
  15. java学习笔记18(基本类型包装类,system类)
  16. mysql 设置外键 四大属性 CASCADE SET NULL NO ACTION RESTRICT 理解
  17. Java中的String问题
  18. 【spring学习笔记二】Bean
  19. GitLab-CI与GitLab-Runner
  20. Closest Number in Sorted Array

热门文章

  1. python 机器学习(一)机器学习概述与特征工程
  2. centOS 开启服务器后无法访问(大坑啊)
  3. 一文搞懂volatile的可见性原理
  4. python操作rabbitmq,实现生产消费者模型
  5. ubuntu下安装perl GD模块
  6. Spring Beans 自动装配 简介
  7. spring——bean自动装配
  8. Docker 入门:Dockerfile
  9. [Unity2d系列教程] 005.Unity如何使用外部触控插件FingerGuesture
  10. Django ListView DetailView等基于类的视图如何添加装饰器?