|
| 1 | +# ODBC Drivers in Microsoft's Ubuntu 22.04 Repository |
| 2 | + |
| 3 | +## Repository Information |
| 4 | + |
| 5 | +**Repository URL:** `deb [arch=amd64,arm64,armhf] |
| 6 | + https://packages.microsoft.com/ubuntu/22.04/prod jammy main` |
| 7 | + |
| 8 | +This repository contains various Microsoft packages for Ubuntu 22.04 |
| 9 | + (Jammy Jellyfish), supporting multiple architectures: amd64 (x86_64), |
| 10 | + arm64 (ARM 64-bit), and armhf (ARM 32-bit hard float). |
| 11 | + |
| 12 | +## ODBC Drivers |
| 13 | + |
| 14 | +The repository contains two main ODBC driver packages for SQL Server: |
| 15 | + |
| 16 | +### 1. Microsoft ODBC Driver 17 for SQL Server (`msodbcsql17`) |
| 17 | + |
| 18 | +**Package Name:** `msodbcsql17` |
| 19 | +**Architecture Support:** amd64 only |
| 20 | +**Latest Version:** 17.10.6.1-1 (as of April 2024) |
| 21 | + |
| 22 | +**Available Versions:** |
| 23 | +- `msodbcsql17_17.10.1.1-1_amd64.deb` (743.4 KB) |
| 24 | +- `msodbcsql17_17.10.2.1-1_amd64.deb` (744.5 KB) |
| 25 | +- `msodbcsql17_17.10.4.1-1_amd64.deb` (744.6 KB) |
| 26 | +- `msodbcsql17_17.10.5.1-1_amd64.deb` (749.1 KB) |
| 27 | +- `msodbcsql17_17.10.6.1-1_amd64.deb` (746.3 KB) - Latest |
| 28 | + |
| 29 | +**Key Features:** |
| 30 | +- Supports SQL Server 2008 and later |
| 31 | +- Production-ready driver |
| 32 | +- Widely used in enterprise environments |
| 33 | +- Limited to x86_64 architecture |
| 34 | + |
| 35 | +**Installation:** |
| 36 | +```bash |
| 37 | +sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 |
| 38 | +``` |
| 39 | + |
| 40 | +### 2. Microsoft ODBC Driver 18 for SQL Server (`msodbcsql18`) |
| 41 | + |
| 42 | +**Package Name:** `msodbcsql18` |
| 43 | +**Architecture Support:** amd64, arm64 |
| 44 | +**Latest Version:** 18.5.1.1-1 (as of 2024) |
| 45 | + |
| 46 | +**Available Versions (Sample):** |
| 47 | +- `msodbcsql18_18.1.1.1-1_amd64.deb` (751.6 KB) / `_arm64.deb` (685.7 KB) |
| 48 | +- `msodbcsql18_18.1.2.1-1_amd64.deb` (752.0 KB) / `_arm64.deb` (686.5 KB) |
| 49 | +- `msodbcsql18_18.2.1.1-1_amd64.deb` (752.8 KB) / `_arm64.deb` (687.3 KB) |
| 50 | +- `msodbcsql18_18.2.2.1-1_amd64.deb` (752.6 KB) / `_arm64.deb` (687.4 KB) |
| 51 | +- `msodbcsql18_18.3.1.1-1_amd64.deb` (756.5 KB) / `_arm64.deb` (689.8 KB) |
| 52 | +- `msodbcsql18_18.3.2.1-1_amd64.deb` (755.9 KB) / `_arm64.deb` (690.5 KB) |
| 53 | +- `msodbcsql18_18.3.3.1-1_amd64.deb` (755.1 KB) / `_arm64.deb` (689.3 KB) |
| 54 | +- `msodbcsql18_18.4.1.1-1_amd64.deb` (755.2 KB) / `_arm64.deb` (689.5 KB) |
| 55 | +- `msodbcsql18_18.5.1.1-1_amd64.deb` / `_arm64.deb` - Latest |
| 56 | + |
| 57 | +**Key Features:** |
| 58 | +- Latest driver with modern security features |
| 59 | +- TLS 1.2 and TLS 1.3 support |
| 60 | +- Azure Active Directory authentication support |
| 61 | +- Always Encrypted with secure enclaves support |
| 62 | +- ARM64 support (great for Apple Silicon, Raspberry Pi, AWS Graviton) |
| 63 | +- Supports SQL Server 2012 and later |
| 64 | + |
| 65 | +**Installation:** |
| 66 | +```bash |
| 67 | +sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 |
| 68 | +``` |
| 69 | + |
| 70 | +## SQL Server Command-Line Tools |
| 71 | + |
| 72 | +### mssql-tools (Legacy) |
| 73 | + |
| 74 | +**Package Name:** `mssql-tools` |
| 75 | +**Size:** 210.7 KB |
| 76 | +**Tools Included:** `sqlcmd`, `bcp` |
| 77 | + |
| 78 | +**Installation:** |
| 79 | +```bash |
| 80 | +sudo ACCEPT_EULA=Y apt-get install -y mssql-tools |
| 81 | +echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc |
| 82 | +source ~/.bashrc |
| 83 | +``` |
| 84 | + |
| 85 | +### mssql-tools18 (Current) |
| 86 | + |
| 87 | +**Package Name:** `mssql-tools18` |
| 88 | +**Latest Version:** 18.x |
| 89 | +**Tools Included:** `sqlcmd`, `bcp` (version 18) |
| 90 | + |
| 91 | +**Installation:** |
| 92 | +```bash |
| 93 | +sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18 |
| 94 | +echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc |
| 95 | +source ~/.bashrc |
| 96 | +``` |
| 97 | + |
| 98 | +**Key Features:** |
| 99 | +- Compatible with ODBC Driver 18 |
| 100 | +- Modern encryption support |
| 101 | +- Updated utilities for SQL Server management |
| 102 | + |
| 103 | +## Architecture Comparison |
| 104 | + |
| 105 | +| Package | amd64 | arm64 | armhf | |
| 106 | +|---------|-------|-------|-------| |
| 107 | +| msodbcsql17 | ✅ | ❌ | ❌ | |
| 108 | +| msodbcsql18 | ✅ | ✅ | ❌ | |
| 109 | +| mssql-tools | ✅ | ✅ | ✅ | |
| 110 | +| mssql-tools18 | ✅ | ✅ | ✅ | |
| 111 | + |
| 112 | +## Other Notable Packages in the Repository |
| 113 | + |
| 114 | +The Microsoft Ubuntu 22.04 repository contains many other packages beyond ODBC drivers: |
| 115 | + |
| 116 | +### Container/Docker Tools |
| 117 | +- **moby-engine** - Docker engine (22.1 MB) |
| 118 | +- **moby-cli** - Docker CLI (12.5 MB) |
| 119 | +- **moby-containerd** - Container runtime (25.4 MB, supports amd64, arm64, armhf) |
| 120 | +- **moby-runc** - Container runtime (5.1 MB) |
| 121 | +- **moby-compose** - Docker Compose (9.5 MB) |
| 122 | +- **moby-buildx** - Docker build extensions (25.0 MB) |
| 123 | + |
| 124 | +### Security & Identity |
| 125 | +- **microsoft-identity-broker** - Identity broker (79.8 MB) |
| 126 | +- **microsoft-identity-diagnostics** - Identity diagnostics (3.7 MB) |
| 127 | +- **mdatp** - Microsoft Defender for Endpoint (120.3 MB) |
| 128 | +- **mde-netfilter** - Network filtering (25.5 kB) |
| 129 | + |
| 130 | +### Development Tools |
| 131 | +- **msft-golang** - Microsoft's Go distribution (48.5 MB) |
| 132 | +- **msopenjdk-11** - OpenJDK 11 (194.0 MB) |
| 133 | +- **msopenjdk-17** - OpenJDK 17 (182.4 MB) |
| 134 | +- **msopenjdk-21** - OpenJDK 21 (176.4 MB) |
| 135 | +- **msopenjdk-25** - OpenJDK 25 (190.1 MB) |
| 136 | + |
| 137 | +### .NET Tools |
| 138 | +- **netstandard-targeting-pack-2.1** - .NET Standard targeting pack (1.5 MB) |
| 139 | +- **aspnetcore-runtime** - ASP.NET Core runtime |
| 140 | +- **dotnet-sdk** - .NET SDK |
| 141 | + |
| 142 | +### Other Tools |
| 143 | +- **microsoft-azurevpnclient** - Azure VPN client (12.6 MB) |
| 144 | +- **msalsdk-dbusclient** - MSAL DBus client (9.3 kB) |
| 145 | + |
| 146 | +## Complete Installation Guide |
| 147 | + |
| 148 | +### Step 1: Add Microsoft Repository |
| 149 | + |
| 150 | +```bash |
| 151 | +# Download and install the Microsoft repository GPG key |
| 152 | +curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc |
| 153 | + |
| 154 | +# Add the Microsoft repository |
| 155 | +curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list |
| 156 | + |
| 157 | +# Update package lists |
| 158 | +sudo apt-get update |
| 159 | +``` |
| 160 | + |
| 161 | +### Step 2: Install ODBC Driver 18 (Recommended) |
| 162 | + |
| 163 | +```bash |
| 164 | +# Install ODBC Driver 18 |
| 165 | +sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 |
| 166 | + |
| 167 | +# Optional: Install command-line tools |
| 168 | +sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18 |
| 169 | + |
| 170 | +# Optional: Install development headers |
| 171 | +sudo apt-get install -y unixodbc-dev |
| 172 | + |
| 173 | +# Add tools to PATH |
| 174 | +echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc |
| 175 | +source ~/.bashrc |
| 176 | +``` |
| 177 | + |
| 178 | +### Step 3: Verify Installation |
| 179 | + |
| 180 | +```bash |
| 181 | +# Check ODBC driver installation |
| 182 | +odbcinst -q -d -n "ODBC Driver 18 for SQL Server" |
| 183 | + |
| 184 | +# Test sqlcmd (if installed) |
| 185 | +sqlcmd -? |
| 186 | +``` |
| 187 | + |
| 188 | +## Version Selection Guide |
| 189 | + |
| 190 | +### When to use ODBC Driver 17: |
| 191 | +- Legacy applications requiring Driver 17 |
| 192 | +- Compatibility with older SQL Server versions |
| 193 | +- Only need x86_64 support |
| 194 | +- Existing deployments using Driver 17 |
| 195 | + |
| 196 | +### When to use ODBC Driver 18: |
| 197 | +- New deployments (recommended) |
| 198 | +- Need ARM64 support (Apple Silicon, AWS Graviton, etc.) |
| 199 | +- Require latest security features (TLS 1.3) |
| 200 | +- Azure Active Directory authentication |
| 201 | +- Always Encrypted with secure enclaves |
| 202 | +- Better performance and modern standards |
| 203 | + |
| 204 | +## Connection String Examples |
| 205 | + |
| 206 | +### Using ODBC Driver 17 |
| 207 | +``` |
| 208 | +Driver={ODBC Driver 17 for SQL Server};Server=myserver.database.windows.net; |
| 209 | +Database=mydb;Uid=myuser;Pwd=mypassword; |
| 210 | +``` |
| 211 | + |
| 212 | +### Using ODBC Driver 18 |
| 213 | +``` |
| 214 | +Driver={ODBC Driver 18 for SQL Server};Server=myserver.database.windows.net; |
| 215 | +Database=mydb;Uid=myuser;Pwd=mypassword;Encrypt=yes;TrustServerCertificate=no; |
| 216 | +``` |
| 217 | + |
| 218 | +**Important Note:** Driver 18 requires explicit encryption settings. |
| 219 | + Always include `Encrypt=yes` for secure connections. |
| 220 | + |
| 221 | +## Dependencies |
| 222 | + |
| 223 | +Both ODBC drivers require: |
| 224 | +- **unixODBC** (>= 2.3.1) - ODBC Driver Manager |
| 225 | +- **libc6** (>= 2.21) |
| 226 | +- **libstdc++6** (>= 4.9) |
| 227 | +- **libkrb5-3** - Kerberos authentication |
| 228 | +- **openssl** - SSL/TLS support |
| 229 | + |
| 230 | +These dependencies are usually automatically installed by `apt`. |
| 231 | + |
| 232 | +## EULA Acceptance |
| 233 | + |
| 234 | +All Microsoft ODBC packages require EULA acceptance. You can: |
| 235 | + |
| 236 | +**Option 1:** Accept during installation |
| 237 | +```bash |
| 238 | +sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 |
| 239 | +``` |
| 240 | + |
| 241 | +**Option 2:** Pre-accept for automated deployments (Driver 18.4+) |
| 242 | +```bash |
| 243 | +sudo mkdir -p /opt/microsoft/msodbcsql18 |
| 244 | +sudo touch /opt/microsoft/msodbcsql18/ACCEPT_EULA |
| 245 | +``` |
| 246 | + |
| 247 | +## Troubleshooting |
| 248 | + |
| 249 | +### Common Issues |
| 250 | + |
| 251 | +**Issue 1: Repository Not Found** |
| 252 | +```bash |
| 253 | +# Ensure the repository is properly added |
| 254 | +cat /etc/apt/sources.list.d/mssql-release.list |
| 255 | + |
| 256 | +# Should contain: |
| 257 | +# deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/microsoft.asc] |
| 258 | + https://packages.microsoft.com/ubuntu/22.04/prod jammy main |
| 259 | +``` |
| 260 | + |
| 261 | +**Issue 2: EULA Not Accepted** |
| 262 | +```bash |
| 263 | +# Error: "Package msodbcsql18 has no installation candidate" |
| 264 | +# Solution: Set ACCEPT_EULA=Y environment variable |
| 265 | +sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 |
| 266 | +``` |
| 267 | + |
| 268 | +**Issue 3: Missing Dependencies** |
| 269 | +```bash |
| 270 | +# Install unixODBC if missing |
| 271 | +sudo apt-get install -y unixodbc unixodbc-dev |
| 272 | +``` |
| 273 | + |
| 274 | +**Issue 4: Driver Not Found by Application** |
| 275 | +```bash |
| 276 | +# List installed drivers |
| 277 | +odbcinst -q -d |
| 278 | + |
| 279 | +# If driver not listed, check installation |
| 280 | +dpkg -l | grep msodbcsql |
| 281 | +``` |
| 282 | + |
| 283 | +## ARM64 Support |
| 284 | + |
| 285 | +ODBC Driver 18 provides ARM64 support, making it suitable for: |
| 286 | +- **Apple Silicon Macs** (M1, M2, M3, M4) |
| 287 | +- **AWS Graviton** instances |
| 288 | +- **Azure ARM-based VMs** |
| 289 | +- **Raspberry Pi 4/5** (64-bit OS) |
| 290 | +- **Oracle Cloud ARM instances** |
| 291 | + |
| 292 | +Example ARM64 installation: |
| 293 | +```bash |
| 294 | +# On ARM64 Ubuntu 22.04 |
| 295 | +sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18:arm64 |
| 296 | +``` |
| 297 | + |
| 298 | +## Security Considerations |
| 299 | + |
| 300 | +1. **Always use encrypted connections** - Set `Encrypt=yes` in connection strings |
| 301 | +2. **Validate certificates** - Use `TrustServerCertificate=no` in production |
| 302 | +3. **Keep drivers updated** - Regularly update to latest versions for security patches |
| 303 | +4. **Use strong authentication** - Implement Azure AD or certificate-based auth where possible |
| 304 | +5. **Restrict network access** - Use firewalls and VPNs for database connections |
| 305 | + |
| 306 | +## References |
| 307 | + |
| 308 | +- [Microsoft ODBC Driver Documentation](https://learn.microsoft.com/en-us/sql/connect/odbc/) |
| 309 | +- [Download ODBC Driver for SQL Server](https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server) |
| 310 | +- [Installing the Linux Driver](https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server) |
| 311 | +- [Release Notes](https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/release-notes-odbc-sql-server-linux-mac) |
| 312 | + |
| 313 | +## Summary |
| 314 | + |
| 315 | +The Microsoft Ubuntu 22.04 repository (`packages.microsoft.com/ubuntu/22.04/prod`) contains: |
| 316 | + |
| 317 | +**Primary ODBC Drivers:** |
| 318 | +- **msodbcsql17** - Version 17.x (amd64 only) |
| 319 | +- **msodbcsql18** - Version 18.x (amd64, arm64) - **Recommended** |
| 320 | + |
| 321 | +**Command-Line Tools:** |
| 322 | +- **mssql-tools** - Legacy tools |
| 323 | +- **mssql-tools18** - Current tools (recommended) |
| 324 | + |
| 325 | +**Additional Packages:** |
| 326 | +- Container tools (Docker/Moby) |
| 327 | +- Security tools (Defender, Identity) |
| 328 | +- Development tools (Go, OpenJDK, .NET) |
| 329 | +- Azure tools (VPN client) |
| 330 | + |
| 331 | +For most use cases, **ODBC Driver 18 (`msodbcsql18`)** is the recommended choice |
| 332 | + due to its modern features, ARM64 support, and enhanced security capabilities. |
0 commit comments