How to Update the Drivers in Ubuntu

Image Credit: Caiaimage/Agnieszka Olek/Caiaimage/GettyImages

There was a time when configuring Linux to run on your computer meant hours of maddening trial and error, but those days are largely gone. For most users, on most hardware, Ubuntu and other modern versions of Linux will automatically recognize what's inside your computer and install the right drivers. It'll even update the drivers for you automatically, though there are times you might want to update, downgrade or install alternative drivers on your own. That's a lot easier than it used to be, too.

Open Source vs. Proprietary

Ubuntu draws its drivers and other updated software from central sources called "repositories," which are kind of like an app store but without the buying part. They're secure locations where you can download software that's been vetted by Canonical, Ubuntu's parent company. Some of those repositories hold only free and open-source code, while others include software that has proprietary components or licenses. A vocal segment of the Linux community has strong opinions about using only open-source software, so the repositories that are available by default usually leave out the proprietary code. Very often those pieces of proprietary software are the updated drivers you're looking for, so you'll want to manually select them before you do anything else.

Select Your Sources

To change the locations where Ubuntu will look for drivers, click the "Show Applications" icon at the bottom of your dock and type "Software & Updates" into the search field. Click the icon, and a dialog box will open. Under the Ubuntu Software tab, make sure the "Proprietary drivers" and "Software restricted by copyright or legal issues" boxes are selected. Under the Other Software tab, tick the box for "Canonical Partners." Close the dialog box, go back to Show Applications, and search for Software Updater. Click the icon and it will gather updates for all available software, which now includes the repositories containing your new drivers. Ubuntu will update the drivers available to your system.

Choosing Your Driver

Now go back to Software & Updates and click the "Additional Drivers" tab. Ubuntu will display a "checking for drivers" message as it scans the hardware in your system and matches it to the wider selection of drivers available from the new repositories. When it's done, you'll see a list of hardware with available proprietary drivers. Usually, it'll be video drivers. Ubuntu video drivers work pretty well by default – Ubuntu's Intel graphics driver was built with considerable input from Intel, for example – but if you have an Nvidia or AMD graphics card, you'll get better performance from that company's own drivers. If one of the available drivers is marked as "recommended," that's the one to try first. Otherwise, you'll have to search for the best option. The dialog box tells you what video card you have, so just type "best Linux driver for [the model of video card]" into your favorite search engine. Go back to the dialog box and click the button for the driver you've settled on, and then "Apply Changes." Restart your computer to use the new driver.

Adding a Different Source

Sometimes you may want a driver from a source that isn't available from the standard handful of repositories. In that case you can add that source manually. They're called Personal Package Archives, or PPAs, and you'll need to know the name of the PPA first. Look it up in your favorite search engine or Ubuntu-related community, then open Software & Updates, and click the "Other Software" tab. Now click "Add" and paste in the appropriate PPA. For example, if you want to add Ubuntu's Nvidia PPA, you'd add:

ppa:graphics-drivers/ppa

After you run Software Updater again, those drivers will be available for use. It's important to know that, while major companies are responsible for most PPAs, anybody can create one – that's why they're "personal" – so you should only add a PPA if you trust its creator.

Using the Command Line

You can also do all of this from the command line. It's kind of old-school, and you'll know you've acclimated to Linux when you get comfortable with it, but there's a very practical reason for knowing how: If you install the wrong driver, it won't load your graphical interface and you'll need to use the command line to fix it.

First, add in the new sources by typing or copying and pasting:

sudo apt-add-repository multiverse

sudo apt-add-repository universe

sudo apt-get update

You'll be prompted for your password after each command. These three commands will add your extra repositories and then update your available software. Next, enter the command to see the available drivers. For example, if your search indicated you need the Nvidia 390 driver, you'd type:

sudo apt install nvidia-driver-390

Restart your computer, and you'll be using the new driver.

When Things Go Wrong

If you update your driver and find your desktop not loading, you can use the command line to revert to the default drivers and start again. It's a very good idea to have the commands printed off or saved on your phone before you start, just in case you need them. First, uninstall the driver you've just installed. In this case, it would be:

sudo apt purge nvidia-390

If you've used a different driver, you'd replace the "nvidia-390" part with the name of the actual driver you've used. When you reboot, Ubuntu will revert to its default driver.

references