Install SQL Server command- line tools on Linux. THIS TOPIC APPLIES TO: SQL Server on Windows. SQL Server on Linux. Azure SQL Database. Azure SQL Data Warehouse. Parallel Data Warehouse The following steps install the command- line tools, Microsoft ODBC drivers, and their dependencies. The mssql- tools package contains: sqlcmd: Command- line query utility. ![]() Bulk import- export utility. Install the tools for your platform: This topic describes how to install the command- line tools. If you are looking for examples of how to use sqlcmd or bcp, see the links at the end of this topic. Use the following steps to install the mssql- tools on Red Hat Enterprise Linux. Enter superuser mode. Download the Microsoft Red Hat repository configuration file. Exit superuser mode. If you had a previous version of mssql- tools installed, remove any older unix. ODBC packages. sudo yum update. ODBC- utf. 16 unix. ODBC- utf. 16- devel. Run the following commands to install mssql- tools with the unix. ODBC developer package. ODBC- devel. Note. To update to the latest version of mssql- tools run the following commands: sudo yum check- update. Optional: Add /opt/mssql- tools/bin/ to your PATH environment variable in a bash shell. To make sqlcmd/bcp accessible from the bash shell for login sessions, modify your PATH in the ~/. PATH="$PATH: /opt/mssql- tools/bin"' > > ~/. To make sqlcmd/bcp accessible from the bash shell for interactive/non- login sessions, modify the PATH in the ~/. PATH="$PATH: /opt/mssql- tools/bin"' > > ~/. Install tools on Ubuntu 1. Use the following steps to install the mssql- tools on Ubuntu. Import the public repository GPG keys. Register the Microsoft Ubuntu repository. Update the sources list and run the installation command with the unix. ODBC developer package. Note. To update to the latest version of mssql- tools run the following commands: sudo apt- get update. Optional: Add /opt/mssql- tools/bin/ to your PATH environment variable in a bash shell. To make sqlcmd/bcp accessible from the bash shell for login sessions, modify your PATH in the ~/. PATH="$PATH: /opt/mssql- tools/bin"' > > ~/. To make sqlcmd/bcp accessible from the bash shell for interactive/non- login sessions, modify the PATH in the ~/. PATH="$PATH: /opt/mssql- tools/bin"' > > ~/. Install tools on SLES 1. Use the following steps to install the mssql- tools on SUSE Linux Enterprise Server. Add the Microsoft SQL Server repository to Zypper. Install mssql- tools with the unix. ODBC developer package. ODBC- devel. Note. To update to the latest version of mssql- tools run the following commands: sudo zypper refresh. Optional: Add /opt/mssql- tools/bin/ to your PATH environment variable in a bash shell. To make sqlcmd/bcp accessible from the bash shell for login sessions, modify your PATH in the ~/. PATH="$PATH: /opt/mssql- tools/bin"' > > ~/. To make sqlcmd/bcp accessible from the bash shell for interactive/non- login sessions, modify the PATH in the ~/. PATH="$PATH: /opt/mssql- tools/bin"' > > ~/. Install tools on mac. OSA preview of sqlcmd and bcp is now available on mac. OS. For more information, see the announcement. To install the tools for Mac El Capitan and Sierra, use the following commands: /usr/bin/ruby - e "$(curl - fs. SL https: //raw. githubusercontent. Homebrew/install/master/install)". Microsoft/homebrew- mssql- release. ACCEPT_EULA=y brew install - -no- sandbox mssql- tools. Docker. Starting with SQL Server 2. CTP 2. 0, the SQL Server command- line tools are included in the Docker image. If you attach to the image with an interactive command- prompt, you can run the tools locally. Offline installation. If your Linux machine does not have access to the online repositories used in the previous sections, you can download the package files directly. These packages are located in the Microsoft repository, https: //packages. Tip. If you successfully installed with the steps in the previous sections, you do not need to download or manually install the package(s) below. This is only for the offline scenario. Introduction. In R, the fundamental unit of shareable code is the package. A package bundles together code, data, documentation, and tests, and is easy to share with.![]() The following table provides the location for the latest tools packages: These packages depend on msodbcsql, which must be installed first. The msodbcsql pacakage also has a dependency on either unix. ODBC- devel (RPM) or unixodbc- dev (Debian). The location of the msodbcsql packages are listed in the following table: To manually install these packages, use the following steps: Move the downloaded packages to your Linux machine. I am trying to install the Java Development Kit (JDK) on Ubuntu Linux distro, but I am unable to install it. What are the steps to install it on Ubuntu? Get started with R igraph. Install and start using the igraph R package. Choose Your Version of RStudio. RStudio is a set of integrated tools designed to help you be more productive with R. It includes a console, syntax-highlighting editor. ![]() If you used a different machine to download the packages, one way to move the packages to your Linux machine is with the scp commmand. Install the and packages: Install the mssql- tools and msodbc packages. If you get any dependency errors, ignore them until the next step. Platform. Package install commands. Red Hatsudo yum localinstall msodbcsql- 1. SLESsudo zypper install msodbcsql- 1. Ubuntusudo dpkg - i msodbcsql_1. Resolve missing dependencies: You might have missing dependencies at this point. If not, you can skip this step. In some cases, you must manually locate and install these dependencies. For RPM packages, you can inspect the required dependencies with the following commands: rpm - qp. R msodbcsql- 1. 3. R mssql- tools- 1. For Debian packages, if you have access to approved repositories containing those dependencies, the easiest solution is to use the apt- get command: sudo apt- get - f install. Note. This command completes the installation of the SQL Server packages as well. If this does not work for your Debian package, you can inspect the required dependencies with the following commands: dpkg - I msodbcsql_1. Depends: ". dpkg - I mssql- tools_1. Depends: ". Next steps. For an example of how to use sqlcmd to connect to SQL Server and create a database, see one of the following quick start tutorials: For an example of how to use bcp to bulk import and export data, see Bulk copy data to SQL Server on Linux. Using R — Installing Packages. One of the reasons to use R for analysis and visualization is the rich ecosystem of ‘packages’ contributed by others. In most cases, just as with smartphones, “There’s a package for that.” If you want to be efficient you need to embrace other people’s work and in the case of R that means installing packages. This post walks you through the basics of package installation and use and gives some tips on workarounds when a package won’t install. Simple example. For the impatient lets start off with a simple example. In this example (on Ubuntu Linux) we’ll run R as the superuser so that packages will be installed in the default location. We will install the “geonames” package and then show off the new functionality we just added. R - -vanilla. > install. Warning in install. R/site- library'. Please select a CRAN mirror for use in this session - -- . Loading Tcl/Tk interface .. DONE (geonames). The downloaded packages are in. Rtmp. 3Fzi. H3/downloaded_packages$ sudo R - -vanilla..> install. Warning in install. R/site- library'- -- Please select a CRAN mirror for use in this session - -- Loading Tcl/Tk interface ...* DONE (geonames)The downloaded packages are in /tmp/Rtmp. Fzi. H3/downloaded_packages. If you don’t run R as superuser you won’t have permission to write packages into the site- library and you will be prompted to create a personal library. You can specify the library, repository and a few other options by passing parameters to the install. Use ? install. packages to learn more. So what extra functionality does this new “geonames” package bring? You’ll have to do a little reading to figure out the details but for now just paste these lines into your R session. Ignore warnings about 'incomplete final line'. GNfind. Nearby. Postal. Codes(postalcode=postalcode,country='US'. GNfind. Near. By. Weather(zip$lat,zip$lng). F = as. numeric(weather$temperature) * 9/5 + 3. GMT',sep=''). line. Weather for ',weather$station. Name,sep=''). line. F,' deg. F with ',weather$clouds. Speed,' knots',sep=''). Restore default warnings. Ignore warnings about 'incomplete final line'. GNfind. Nearby. Postal. Codes(postalcode=postalcode,country='US',max. Rows=1)weather=GNfind. Near. By. Weather(zip$lat,zip$lng)temp. F=as. numeric(weather$temperature)*9/5+3. GMT',sep='')line. Weather for ',weather$station. Name,sep='')line. F,' deg. F with ',weather$clouds,', wind at ',weather$wind. Speed,' knots',sep='')print(line. Restore default warnings.}Here is the result. GMT". [1] "Weather for Washington DC, Reagan National Airport". F with few clouds, wind at 1. GMT". [1] "Weather for St. Louis, Lambert- St. Louis International Airport". F with few clouds, wind at 1. GMT". [1] "Weather for Seattle, Seattle Boeing Field". F with few clouds, wind at 0. GMT"[1]"Weather for Washington DC, Reagan National Airport"[1]"temp = 7. F with few clouds, wind at 1. GMT"[1]"Weather for St. Louis, Lambert- St. Louis International Airport"[1]"temp = 8. F with few clouds, wind at 1. GMT"[1]"Weather for Seattle, Seattle Boeing Field"[1]"temp = 5. F with few clouds, wind at 0. Who’d- a- thunk that R could so easily be turned into a real time weather system? CRANIn order to install and make use of packages you first have to find them. Luckily, most (but not all) R packages are organized and available from CRAN — the Comprehensive R Archive Network. Just click on the Packages link to see the full list of contributed packages. Packages are listed alphabetically with a short description. Unfortunately, there is no rating system but you can get a quick sense of quality by clicking on a package link and looking at the “Published” date and especially any “Reverse dependencies” listed at the the bottom of a package. Reading the documentation and looking at the number of releases in the “Old sources” is also very helpful. CRAN also maintains a set of Task Views that identify all the packages associated with a particular task. The maintainers of these views do a generally excellent job of staying on top of their area of interest and giving a detailed summary of which packages do what. If one of the task views is a perfect match you can have R install every package from that view using the “ctv” package. Yes, “ctv” is a package to automate package installation. See the section below on “Installing older versions” if you have trouble installing “ctv”. Installing packages. The basics of package installation are given in chapter 6 of R Installation and Administration. There are two ways to do a command line installation of packages: from the R command line and from the shell command line. R prompt. 1> install. R prompt. Within R you can use install. This will always attempt to install the latest version of packages it knows about. R CMD INSTALL # at the shell prompt. RCMD INSTALL# at the shell prompt. You can also invoke R from the command line. This is useful for some packages when install. CRAN. More information is available with R CMD INSTALL - -help. To install packages this way you must first download the package source to your local machine. Here is a quick demonstration. R CMD INSTALL fortunes_1. DONE (fortunes). $$ # download the "fortunes" package using 'wget'$ wget http: //cran. R CMD INSTALL fortunes_1. DONE (fortunes)$Installing older versions. If you have total control over your system and always keep it at the bleeding edge then you will have no problem installing the latest and greatest versions of R packages. However, if your version of R is older (Perhaps you are running R on a webserver with Cent. OS?) then some of the more recent releases of packages will not work and install. Warning message. In install. Warning message: In install. This is when you have to poke around in the “Old sources” link on the CRAN page for that package and use trial- and- error to find an older version of the package that will work with your version of R. You should start by determining what version of R you have. R version 2. 8. 1 (2. R - -version. R version 2. Given that our version of R was released at the end of 2. At least some of the 2. Perusing the sp archive, we might try installing version 0. May of 2. 00. 9. $ wget http: //cran. Archive/sp/sp_0. 9- 3. CMD INSTALL sp_0. Success!$ wget http: //cran. Archive/sp/sp_0. 9- 3. CMD INSTALL sp_0. Success! Using packages. To use a package you start up R and load packages one at a time with the library() command. Packages in library '/usr/local/lib/R/site- library'. Packages inlibrary'/usr/local/lib/R/site- library'.. Over time, your package library will contain more and more packages. Or perhaps system administrators or other users have also installed packages. It’s good to know what’s installed and at what version. This is where the location of the package library comes in handy. If you poke around you will find out that most packages come with a DESCRIPTION file that contains that information. To see all the package versions on our Ubuntu system we could just type. R/site- library/*/DESCRIPTION. R/site- library/abind/DESCRIPTION < ==. Date: 2. 00. 4- 0. Title: Combine multi- dimensional arrays. R/site- library/*/DESCRIPTION==> /usr/local/lib/R/site- library/abind/DESCRIPTION < ==Package: abind. Version: 1. 1- 0. Date: 2. 00. 4- 0. Title: Combine multi- dimensional arrays.. Of course there is also an ‘R’ way of getting this information. All of the fields in DESCRIPTION files are accessible through the installed. The following example shows how to access this information programmatically from within R. Package" "Lib. Path" "Version" "Priority" "Depends" "Imports". Linking. To" "Suggests" "Enhances" "OS_type" "License" "Archs". Built". > packages["sp",c("Package","Version","License")]. Package Version License. GPL (> = 2)"> packages=installed. Package" "Lib. Path" "Version" "Priority" "Depends" "Imports" [7]"Linking. To""Suggests" "Enhances" "OS_type" "License" "Archs" [1. Built" > packages["sp",c("Package","Version","License")] Package Version License "sp" "0. GPL (> = 2)"Special Casesncdf. The ncdf package requires that Net. CDF — including the development libraries — first be installed on your system. Unfortunately, the Net. CDF libraries and include files are not installed in a uniform location across Unix systems. This is a case where we need to pass configuration arguments to R CMD INSTALL. Here is what ended up working on Ubuntu 1. LTS. sudo R CMD INSTALL - -configure- args="- -with- netcdf- include=/usr/include - -with- netcdf- lib=/usr/lib" ncdf_1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |