As discussed applying SQL Server Cumulative Updates on Linux works differently to Windows. On Windows you generally either get CUs by manually downloading the update via Microsoft’s KB on that particular update or accidentally let one install via Windows update if there’s a security fix. On Linux you generally get updates via the repositories you have configured for your server.
Applying Cumulative Updates for SQL Server (of any supported version) ensures that you have the latest fixes for the SQL Server platform. Each update is certified to the same degree as a service pack used to be and Microsoft generally recommends you keep up to date with their installation. That being said you still should test carefully in UAT before applying to a live system.
The first thing you need to do of course is backup your SQL Server. Something could go wrong so you must make sure you have a rollback plan in case that does happen. This could be: taking a snapshot of the server’s VM in your hypervisor, performing a full backup of all the system and user databases, initiating a full server backup using your favourite backup agent or something completely different.
Once you have a test plan in place which has been approved plus your backups you are now ready to install the latest Cumulative Update.
Step 1: Check to see if you’ve got the correct apt source in your repos:
sudo apt edit-sources
You will then get a 1-4 choice for which editor you want to use. I chose nano which is option #1. At which point you’ll see nano appear. Scroll right down and find your sources.
Once you are done reviewing the sources list press CTRL + X to close nano.
Step 2: Run apt update to fetch the current package list from the repositories:
sudo apt-get update
This takes a few minutes and for my server resulted in a 14 MB download. This command is vital to ensure that the next command runs properly otherwise you’ll be using an outdated package list.
Step 3: Perform an upgrade of msssql-server using apt:
--To update everything on the system at once
sudo apt-get upgrade
--To do MS SQL Server only
sudo apt-get upgrade mssql-server
This will then list out all the packages that need upgrading based on what’s installed to your Server vs what’s available in the repository. If you decided to upgrade everything one of those packages should be…yes you guessed it…mssql-server. Cumulative Update 8 is approximately 268 MB to download:
You are of course going to answer ‘Y’ to this question. Or press enter (note that the “Y” is capitalised. This means that it’s the default answer if you smack return).
This will then run through all the updates to go through. Highlighted here is apt setting up the mssql-server package version 16.0.4075.1-1 which is indeed Cumulative Update 8.
Step 4: Verify the mssql-server service is alive:
systemctl status mssql-server --no-pager
As you can see we’re onto a winner:
At this point it’s also probably a good idea to open SQL Server Management Studio or Azure Data Studio to check you have a working connection. To double check you have Cumulative Update 8 you could also execute the following command in whatever SQL query tool you are using:
SELECT @@VERSION AS VersionString
Microsoft SQL Server 2022 (RTM-CU8) (KB5029666) - 16.0.4075.1 (X64) Aug 23 2023 14:04:50 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 20.04.6 LTS) <X64>
At this point you should start performing your acceptance tests on your databases and applications. Aim to verify that the usual business and system processes are working before declaring a success!
But What If I Wanted A Specific Version of SQL Server?
Whilst it’s usually recommended that a new SQL Server instance should go through a UAT phase with whatever application(s) will be running against it using the latest CU available at the time. However there could be situations where a specific version of SQL Server is required. Whatever that reason in order to do this run the following commands:
There’s something I’ll have to admit to: I don’t (didn’t) have an SQL Server test instance to play with. Gasp! I broke apart my Windows desktop earlier this year, sold all the parts and then remembered how am I supposed to play with SQL Server without it? Well it did save some desk space…
This weekend it came to the top of my task list to build another so for this brief tutorial I’m going to show you how to install SQL Server 2022 onto an Ubuntu Server. Yes that’s right; no Windows involved.
SQL Server 2022 requires a minimum of 2 GB of system memory so spec/configure as appropriate.
Once you have your shiny new Ubuntu Server you should then use SSH to connect into the environment and let the fun begin.
Step 1: Import the GPG keys for the Microsoft repository. This means that you can trust the repo that you’ll download SQL Server 2022 from:
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
Step 2: Register the Microsoft repository with apt. This means that you add the address of the Microsoft repository into apt’s list it uses to check for and download software & updates. This is where you’ll actually download SQL Server 2022 from:
Step 3: Update apt’s list of available updates then instruct apt to install SQL Server 2022. Note the -y switch after the install argument means that you are telling apt to do all this automatically i.e.: yes to all prompts. This will trigger a download around 1.3 GB in total so warm up that internet connection:
Step 4: Run mssql-conf setup to configure your newly installed SQL Server 2022 instance:
sudo /opt/mssql/bin/mssql-conf setup
You’ll first get asked for the edition. I chose number 2 for Developer as I want to use this build as a test/training server. Whatever edition you choose do make sure you are using an edition you are appropriately licenced for. You’ve been warned.
Following choosing an edition you’ll get asked to accept the licence terms. I know you’ll read them fully and very carefully but make sure you type “Yes” to accept.
Next will be the language. I chose 1 for English but as you require for this.
After that you’ll get prompted to specify an sa password. Make sure you choose something secure and record it securely especially if this is production.
Step 5: Confirm that the service is running. It would be most definitely disappointing if it weren’t:
systemctl status mssql-server --no-pager
You’ll get something resembling this which confirms that SQL Server 2022 is running:
If you’re new to SQL Server on Linux then something you need to be aware of is that you can’t run SQL Server Management Studio (SSMS) on Linux. As an alternative you can go try Azure Data Studio which has the Admin Pack for SQL Server extension pack available that includes tools for Profiler, SQL Server Agent, Import and for working with .dacpac files.
Once you are connected to the SQL Server instance then one thing to note if you run the T-SQL command @@VERSION you’ll get something like this:
Microsoft SQL Server 2022 (RTM-CU7) (KB5028743) - 16.0.4065.3 (X64) Jul 25 2023 18:03:43 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Linux (Ubuntu 20.04.6 LTS) <X64>
Specifically the point here is that Cumulative Updates (CUs) in SQL Server on Linux are handled differently than Windows. On Ubuntu Linux to take an example CUs are delivered using apt. This is unlike Windows where you have to download and install the cumulative update that you want or accidentally let Windows Update install one if there’s a security fix that needs applying. This means that the release you get by default from the repository is the latest one.
So, congratulations. You’ve made it this far. If you don’t like reading this blog (why?) then you can always follow Microsoft’s direct instructions on the setup above but then you’ll have to admit I made you scroll all the way down here to find this link.
Bonus Round! Restoring AdventureWorks Sample Data
Now you have your newly installed Ubuntu Server with an SQL Server 2022 instance you’re going to need some test data in there (unless you’re straight into production in which case bon voyage!).
To do this you can use wget to bring in the SQL Server 2022 edition of the venerable AdventureWorks databases.
This should download the databases into your Home directory if you haven’t done a cd out of there.
You can then use Azure Data Studio to restore the databases if you have preview features turned on. If you don’t then you can restore using the following T-SQL:
RESTORE DATABASE [AdventureWorks2022] FROM DISK = N'/home/<user>/AdventureWorks2022.bak' WITH FILE = 1, MOVE N'AdventureWorks2022' TO N'/var/opt/mssql/data/AdventureWorks2022.mdf', MOVE N'AdventureWorks2022_log' TO N'/var/opt/mssql/data/AdventureWorks2022_log.ldf', NOUNLOAD, STATS = 10
RESTORE DATABASE [AdventureWorksDW2022] FROM DISK = N'/home/<user>/AdventureWorksDW2022.bak' WITH FILE = 1, MOVE N'AdventureWorksDW2022' TO N'/var/opt/mssql/data/AdventureWorksDW2022.mdf', MOVE N'AdventureWorksDW2022_log' TO N'/var/opt/mssql/data/AdventureWorksDW2022_log.ldf', NOUNLOAD, STATS = 10
RESTORE DATABASE [AdventureWorksLT2022] FROM DISK = N'/home/<user>/AdventureWorksLT2022.bak' WITH FILE = 1, MOVE N'AdventureWorksLT2022_Data' TO N'/var/opt/mssql/data/AdventureWorksLT2022.mdf', MOVE N'AdventureWorksLT2022_Log' TO N'/var/opt/mssql/data/AdventureWorksLT2022_log.ldf', NOUNLOAD, STATS = 10
Canonical have today released Ubuntu 22.04.1 and by extension opened direct upgrades for installs running 20.04.
I was very excited to upgrade today with my StarBook Mk V but I came across an issue that’s plagued me for some time not just with distribution upgrades but occasionally with routine updates.
Situation: when you run updates/upgrades you get something along the lines of this:
The upgrade needs a total of X M free space on disk '/boot'. Please free at least an additional Y M of disk space on '/boot'. You can remove old kernels using 'sudo apt autoremove', and you could also set COMPRESS=xz in /etc/initramfs-tools/initramfs.conf to reduce the size of your initramfs.
Running sudo apt autoremove doesn’t resolve the problem and as a Linux novice I cannot speak about compressing initramfs & the implications there.
Apparently this is caused by a load of kernels the system “hangs onto” following an upgrade filling up the /boot partition. I *think* this is fixed /better handled in versions after 20.04 but I’m not so sure. Indeed it’s a very bizzare problem because surely Ubuntu ought to handle this itself right?
Today I found out how to deal with it and I decided to share it with the internet. Disclaimer: I’m currently learning Linux and Ubuntu. This may kill your system. If it does I apologise but only slightly.
First thing’s first: list the current kernel that’s currently in use. We’re going to try really hard not to delete it.
Once you’ve made a note of that then list out the kernels that have been installed:
dpkg -l | grep linux-image
In my case there were about 7-8 listed (!!!) in addition to the currently running kernel. What we need to do is trim this list down so that we’ve got some space in the /boot partition.
At this point you should’ve got a backup and possibly consulted someone who’s a Linux expert as opposed to a Microsoft one.
Remove excess kernels by running the following command depending on what you find (replacing the version numbers of course):
You should probably keep the immediate past version to the one identified with uname -r.
This should free up enough disk space in /boot so that you can upgrade your OS however you may run into the problem I had and this is the one that’s bugged me for ages: if you remove the signed image for whatever reason apt installs the corresponding unsigned image. Not knocking a free offer but I’m not sure why that is. So anyway the trick is to purge both signed and unsigned at the same time like so:
It’s finally here! I’ve long run a combination of a custom built ATX gaming PC and also a Dell XPS 9360 laptop. Both have served me well but both are overdue a replacement after a long lockdown. I had previously seen Star Labs’ StarBook MkV mentioned on OMG! Ubuntu! and I was very keen to give it a try.
I placed an order for the StarBook Mk V back in August 2021 and after a patient wait it was finally delivered early December. I’ve now had an opportunity to use the laptop for a decent amount of time so here’s the review!
Battery: 65Whr (quoted at up to 11 hours battery life)
Warranty: 1 year limited
For the full details check out the Star Book specification page.
I also added in a StartPort adapter (£69) and USB Recovery Drive (£9) to bring the total cost including an early order discount to £1,511. Given Star Labs are a smaller scale manufacturer than the likes of Dell the price versus specification didn’t seem too bad to me. I considered another Dell XPS 13 on the shortlist and didn’t feel that the StarBook Mk V was poor value by any stretch.
There are quite the many choices of Linux distributions available. For selected distributions Star Labs will also contribute some of the sale price to the maintainers. If you really want it for some reason you can also have Windows but that would arguably break the spirit of the product. For my laptop I chose Ubuntu 20.04 LTS combined with coreboot firmware.
Packaging & First Looks
The StarBook Mk V arrives in some seriously sublime packaging that’s been custom designed for the job. The outer carton is even branded Star Labs. Inside the box I found the laptop securely packaged with foam bumpers with the accessories packaged in two separate boxes. Unfortunately I did not have a Cat available to thoroughly test the packaging but I am sure they’d be impressed too.
The actual box for the laptop features schematics of the device at each respective elevation. It’s another great finish to the product and oozes that due care and attention to detail I’m craving.
Plastics report: I hate unboxing but here it’s worth mentioning that the laptop comes in a blue Star Labs sleeve and a screen protector cloth in place of any plastic on the trackpad or screen. Whilst the sleeve isn’t suitable as a day-to-day carry case it is very useful to have. I keep the sleeve on the laptop then put it into a carry case to protect from scratches from other accessories.
There were plastic bags for the shipping document, USB recovery drive, charger, charging cable and the UK plug adapter. These along with the foam bumpers are the only plastic you’ll receive in the box. Considerably better than quite the many PCs I have unboxed.
Around The Chassis: Screen, Webcam, Keyboard & Trackpad
The Star Book Mk V features a matte black anodised aluminium chassis housing a 14″ IPS screen and your choice of keyboard (UK, US, German, Spanish, French and Nordic are available). The lid has the Star Labs logo embossed on there and it looks seriously classy. It’s a very fine looking laptop with a premium feel to it.
Connectivity wise you’ll find the following ports on the StarBook Mk V (from nearest to furthest from you):
2 x status LEDs
Thunderbolt 4 / USB 3.0 – Type C with Power Delivery
USB 3.0 – Type A
DC Charging Jack
Micro SD Memory Card Reader
USB 2.0 – Type A
USB 3.0 – Type A
3.5mm Combination Jack
Should I have been let loose designing this laptop I would have definitely sacrificed a USB Type-A port or perhaps even the charging port for a Type-C port so I can keep a Yubikey connected with the docking station at the same time but each to their own on that regard.
One of the things I had a hard time deciding upon was the screen versus the Dell XPS 9360. Dell packed out the 2016 XPS 13 with a very good QHD+ IPS screen and that was something difficult to let go of. The Star Book Mk V screen next to the XPS 13 is not quite as impressive 1080p IPS screen but still it’s very good. It’s actually surprisingly bright and colours don’t seem washed out at all. Supposedly this screen works out at 400nits average brightness according to Star Labs. I have to acknowledge here that if you are looking at other laptops at a similar price point you’ll probably more screen choices such as higher resolutions, different ratios but unless you need a screen for high end graphic design the Star Book Mk V should surely fit your requirements. One thing I do not miss from the XPS 13 is a touchscreen; that’s got no place on a laptop as far as I’m concerned.
A non-descript 720p webcam is included. The positive change from the XPS 13 is the position! On the XPS 13 Dell placed the camera bottom left of the screen. People would often comment about the weird angle and being able to see my fingers as I typed on video calls. Returning to a top and centre webcam is definitely a welcome change although it’s not a very wide angle lens and doesn’t have a privacy shield if that’s your thing (you can disable it in coreboot configurator but more on that later). Like most laptop webcams it’s good-not-great but will more than suffice for day to day video calls.
Next to the keyboard on both the left and right flanks you’ll find 4 x 4 Ohm speakers which are more than adequate as far as laptop speakers go. Certainly not studio quality but for any serious listening or gaming you’ll definitely want headphones. I found them very much acceptable for watching some tutorial videos and I’m sure they’ll be fine for TV and Films on the go as well.
Keyboard wise this laptop also delivers. The backlit keys are generously large, well spaced out and smoothly finished to the touch. Typing on the keyboard you’ll find firm but forgiving resistance. There is slight flex in some places on the chassis but you’ll have to look closely for it so nothing to worry about. Star Labs have added an Fn key with the usual stable of F key controls as well. One mild bit of entertainment for me is that there is no Windows key! On this keyboard it’s the “super” key and that’s not something I’ve ever seen before except with Macs.
At the bottom of the chassis the StarBook Mk V features a smooth glass trackpad with separate left and right clicks. There is a bit of a gap between left and right which does take a little bit of getting used to. Again I found the trackpad very responsive and easy to use. It also supports mouse gestures such as double finger scrolling which is a welcome feature. The glass does tend to pick up some oil as you use it so I’ll probably refrain from scoffing snacks whilst working with this laptop.
Performance, Battery Life & Storage
Inside the Star Book Mk V you’ll find an 11th generation Core i3-1110G4 dual-core with UHD graphics or i7-1165G7 quad-core processor with Xe graphics. The Core i3 variant wasn’t available at the time of ordering but that’s OK because I wanted speed not steadiness. With the configurable TDP (Thermal Design Power) profile set to Performance (28W) I returned the following Geekbench 5 result which compared quite well to other results I found such as the Microsoft Surface Pro 8:
One interesting thing about this laptop is that you may opt for a standard American Megatrends firmware or use coreboot instead. Initially I thought coreboot was perhaps not the right choice for me but eventually decided to give it a go. Opt for coreboot and you can use the nifty coreboot configurator app from the StarLabs PPA to tweak the laptop. Everything can be tweaked here from disabling devices, configuring the processor TDP and adjusting the keyboard backlight timeout:
Thanks to the supply crisis we find ourselves in a fortunate situation regarding the battery. The specification was upgraded for free to a 65WHr battery. That did incur a few weeks delay for certification but generously received non the less. Under Ubuntu 20.04 with the balanced power profile set in coreboot I have found battery life at 50% display brightness doing a variety of tasks I’m getting probably around 6-8 hours out of the laptop without TLP or Powertop in use. That’s a bit short on the up to 11 hours claim (who’s isn’t) but it’s comfortable figure for day to day work.
For whatever reason at the time I decided to opt for 64GB of DDR4 memory despite having no real use case for it. Configurations ranging from 8GB all the way up to 64GB are available and – unusually for many notebooks these days – you can replace the memory if you need an upgrade.
A small note on the memory configuration. A manufacturer using this and similar CPUs can configure it with DDR4 SO-DIMMS like the StarBook which maxes out at 3200Mhz or it can be configured with LPXDDR4 at 4277Mhz. Whilst the advantage of using SO-DIMMS is that they are replaceable it should be noted that the LPXDDR4 brings overall higher memory bandwidth. If you are buying a laptop with Intel Iris Xe then you should know that memory bandwidth is everything and that SO-DIMMS work out slower so watch out for that in any benchmarks you see out there.
The laptop comes with an Intel AX201 WiFi & Bluetooth module. Connected to my AVM FRITZ!Box 7530 (WiFi 5) I have found it to maintain a solid signal with no drop-outs. Sadly with a 26 Mb/s internet connection I will be unable to fully stretch it however for any HD streaming from your NAS this will do the job. I have had some concerns raised to me privately about WiFi. I contacted the team at Star Labs who suggested some tests and we were unable to find any fault.
The Star Drive SSD is worth a mention independently. I did some digging on the specifications page and found that the SSD uses a Phison PS5018 controller with 96 layer Micron B27B memory. KDiskMark returned the following results with the default 5 passes of a 1GiB file:
It’s taken a while to get this notebook but it’s definitely been worth the wait. It’s been a very pleasurable experience using the StarBook Mk V with very little to disagree about. Overall the Star Labs StarBook Mk V is a solid contender for your shortlist and I’d recommend it for Linux users.
This week’s big release has been Ubuntu 21.10 codenamed Impish Indri. This is an interim release with 9 months of support from Canonical.
There are lots of changes to talk about here. This release brings Linux Kernel 5.13, Firefox as a snap by default, GNOME 40 with horizontal workspaces as well as tweaks to the UI, touchpad gestures and zip password support in Nautilus as a few examples.
I’ve installed this to my Dell XPS 9360 this week. So far I’m really liking the horizontal workspace change. It’s admittedly a feature I’ve never got used to working with for Ubuntu and Windows alike but I’ve decided to give it another go.
The change to Firefox as a Snap app is a controversial choice given the reception of snaps. Personally I’m not noticing much of a difference and so long as security updates come in on time I don’t think I’ll be too bothered about it.
You can upgrade your existing Ubuntu distribution to 21.10 now but if you haven’t tried Ubuntu now’s a really good time to Download Ubuntu 21.10 and see it for yourself. As before if you get the torrents I’ll be pleased to serve you the bits.
Canonical have today released Ubuntu 21.04 dubbed Hirsute Hippo (apparently that means “hairy”). This is a short-term support release with 9 months of updates to be had.
There are a number of changes including support for joining Microsoft Active Directory, support for the Wayland server by default and a visual refresh among other things. Of course you’ll also be getting a more recent version of the Linux Kernel specifically number 5.11.
I have yet to get my trusty XPS 13 out to commence an update but if you get the torrents you’ll be served by yours truly from my NAS whilst I go visit the pub for the first time in about 5 months.