{"id":1494,"date":"2018-03-11T00:31:54","date_gmt":"2018-03-11T00:31:54","guid":{"rendered":"http:\/\/www.theSQLReport.com\/?p=1494"},"modified":"2018-03-11T00:31:54","modified_gmt":"2018-03-11T00:31:54","slug":"e-unable-to-locate-package-mssql-tools-error-install-the-command-line-tools-for-sql-server-on-ubuntu","status":"publish","type":"post","link":"http:\/\/www.theSQLReport.com\/?p=1494","title":{"rendered":"E: Unable to locate package mssql-tools &#8211; error install the command line tools for SQL Server on Ubuntu"},"content":{"rendered":"<p><strong>Problem:<\/strong><br \/>\nWhen attempting to install the command line tools for SQL Server on Ubuntu 16.04.3, I would get the error: &#8220;E: Unable to locate package mssql-tools&#8221;<\/p>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Install_Tools_Error-1.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1500 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Install_Tools_Error-1.jpg\" alt=\"Linux SQL Install Tools Error\" width=\"655\" height=\"167\" \/><\/a><\/p>\n<p><strong>Resolution:<\/strong><\/p>\n<p>Note: SQL Server has already been installed on this server.\u00a0 The resolution will include the commands as if SQL Server was not installed, and for example if this package was going to be installed on something like an ETL server.<\/p>\n<p>On a new installation of the Ubuntu 16.04 operating system, I had to run the following four step in order to ensure that the SQL Server Tools would install.<\/p>\n<ul>\n<li>Installation of cURL\n<ul>\n<li>cURL is the command line tool and library that is used for transferring data with URL syntax<\/li>\n<li>will be prompted for the Linux user account password due to the \u201csudo\u201d command being run<\/li>\n<li>will be asked to respond yes to the 323 KB of space need to install the package<\/li>\n<li>there is no harm if the command is rerun, but not needed if SQL Server is already installed<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>sudo apt install curl<\/pre>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_LINUX_install_curl.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1478 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_LINUX_install_curl.jpg\" alt=\"SQL_LINUX_install_curl\" width=\"874\" height=\"622\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_LINUX_install_curl.jpg 874w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_LINUX_install_curl-300x214.jpg 300w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_LINUX_install_curl-768x547.jpg 768w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_LINUX_install_curl-210x149.jpg 210w\" sizes=\"(max-width: 874px) 100vw, 874px\" \/><\/a><\/p>\n<ul>\n<li>Import the public repository GPG keys used by apt to authenticate packages from Microsoft.\n<ul>\n<li>If SQL Server is already installed, then this command does not need to be run.\u00a0 There is no harm if it is run again.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>curl https:\/\/packages.microsoft.com\/keys\/microsoft.asc | sudo apt-key add -<\/pre>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_Key_Add.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1477 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_Key_Add.jpg\" alt=\"SQL Linux Apt-KeyAdd\" width=\"966\" height=\"190\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_Key_Add.jpg 966w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_Key_Add-300x59.jpg 300w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_Key_Add-768x151.jpg 768w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_Key_Add-210x41.jpg 210w\" sizes=\"(max-width: 966px) 100vw, 966px\" \/><\/a><\/p>\n<ul>\n<li>Add Microsoft to the apt repository\n<ul>\n<li>May be prompted for the Linux user account password due to the \u201csudo\u201d command being run<\/li>\n<li>This command is different then the one used for the installation of SQL Server<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>curl https:\/\/packages.microsoft.com\/config\/ubuntu\/16.04\/prod.list | sudo tee \/etc\/apt\/sources.list.d\/msprod.list<\/pre>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_msprod_list-1.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1499 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_msprod_list-1.jpg\" alt=\"SQL Linux msprod.list\" width=\"854\" height=\"190\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_msprod_list-1.jpg 854w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_msprod_list-1-300x67.jpg 300w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_msprod_list-1-768x171.jpg 768w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_msprod_list-1-210x47.jpg 210w\" sizes=\"(max-width: 854px) 100vw, 854px\" \/><\/a><\/p>\n<ul>\n<li>Most important \u2013 this command downloads the package lists from the repositories and \u201cupdates\u201d them to get information on the newest versions of packages and their dependencies.\n<ul>\n<li><strong>The update command needs to be run after the two cURL commands, otherwise the SQL Server Tools installation will end with an error.<\/strong><\/li>\n<li>This is where I had trouble, because I thought I had run this command a number of times already, and did not need to run again.\u00a0 However it is critical this command runs after the two cURL commands.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>sudo apt-get update<\/pre>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_get_update_for_tools-1.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1502 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_get_update_for_tools-1.jpg\" alt=\"Linux Apt get update for SQL Tools\" width=\"854\" height=\"478\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_get_update_for_tools-1.jpg 854w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_get_update_for_tools-1-300x168.jpg 300w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_get_update_for_tools-1-768x430.jpg 768w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Apt_get_update_for_tools-1-210x118.jpg 210w\" sizes=\"(max-width: 854px) 100vw, 854px\" \/><\/a><\/p>\n<ul>\n<li>After these four steps have been completed, the command line tools for SQL Server on Linux should install.<\/li>\n<\/ul>\n<pre>sudo apt-get install mssql-tools unixodbc-dev<\/pre>\n<div id=\"attachment_1504\" style=\"width: 866px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Tools_Install_1.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1504\" class=\"wp-image-1504 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Tools_Install_1.jpg\" alt=\"Linux SQL Tools Installation\" width=\"856\" height=\"276\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Tools_Install_1.jpg 856w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Tools_Install_1-300x97.jpg 300w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Tools_Install_1-768x248.jpg 768w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/11\/SQL_Linux_Tools_Install_1-210x68.jpg 210w\" sizes=\"(max-width: 856px) 100vw, 856px\" \/><\/a><p id=\"caption-attachment-1504\" class=\"wp-caption-text\">Only the top couple of lines for the SQL Server Tool for Linux are shown. There are a couple of pages of text with the actual installation.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Problem: When attempting to install the command line tools for SQL Server on Ubuntu 16.04.3, I would get the error: &#8220;E: Unable to locate package mssql-tools&#8221; Resolution: Note: SQL Server &hellip; <a class=\"readmore\" href=\"http:\/\/www.theSQLReport.com\/?p=1494\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1500,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4],"tags":[113,114,109,115],"class_list":["post-1494","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-sql-server","tag-command-line-tools","tag-mssql-tools","tag-ubuntu","tag-unixodbc-dev"],"_links":{"self":[{"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1494"}],"collection":[{"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1494"}],"version-history":[{"count":8,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1494\/revisions"}],"predecessor-version":[{"id":1838,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1494\/revisions\/1838"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/media\/1500"}],"wp:attachment":[{"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1494"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}