Sql-Server

如何在 Ubuntu 上完全刪除 SQL Server 2017?

  • December 22, 2017

文件有關於如何刪除 SQL Server的說明。但是,這會留下某些軟體包。如何刪除所有跟踪並解除安裝 SQL Server 2017?

這些實際上是關於如何刪除 Microsoft SQL Server 的非常糟糕的說明。

SQL Server 安裝這些關聯的包。

mssql-server
mssql-server-fts
mssql-tools
msodbcsql
unixodbc-dev

假設您希望完全刪除 SQL Server,您應該

# Stop the service
systemctl stop mssql-server.service

sudo add-apt-repository --remove "$(curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list)"

# Remove those packages from the system.
sudo apt-get --purge remove mssql-server mssql-server-fts mssql-tools msodbcsql unixodbc-dev

# Delete the SQL Server repositories
sudo rm /etc/apt/sources.list.d/mssql-* /etc/apt/sources.list.d/msprod*

# Remove the Microsoft keys.
apt-key del "BC52 8686 B50D 79E3 39D3  721C EB3E 94AD BE12 29CF"

# Delete the Microsoft created directories
sudo rm -rf /var/opt/mssql/ /opt/{microsoft,mssql-tools,mssql}/ /usr/share/doc/{msodbcsql,mssql-server,mssql-tools}

引用自:https://dba.stackexchange.com/questions/174175