How to Disable Your Webcam in Ubuntu?

If you have a web camera on your Laptop that you don’t use at all, then you can disable its driver from loading in Ubuntu as it has two main advantages. Firstly, you might be able to save some power, and secondly, it should save you a few Megabytes from your RAM, which might help speed up the booting times as well.

Now, even after disabling it, I did not see any noticeable reduction in power. That is because, most webcams that come with laptops these days are actually connected through a USB port (not visible to the outside), including mine, and Ubuntu puts these non-active USB devices into ‘sleep states’ in order to save power.

So even before I disabled it, it was put into a sleep state thus, I could not see any change in power consumption at all, after disabling it. However, its Kernel module (driver) was about 8.8MB in size, and it is automatically loaded into the RAM, so I decided to disable it to save those Megabytes :).

If you too want to disable it, then please follow the below procedure.

I’m using Ubuntu 12.04 LTS, but the below method should work in other recent Ubuntu versions including Ubuntu 20.04 or 19/18. What we are doing is simple. We are going to ‘blacklist’ the webcam driver, so the Kernel would ignore loading it while booting.

__________

Optional: If you wanted to know how much Megabytes your webcam driver consumes, then put the below command in your Terminal window.

lsmod | grep uvcvideo

Locating-webcam-driver-details-using-lsmod

Then, as shown above, note the numbers next to the ‘uvcvideo’ text line and divide it by 4. Now you should have its size in Megabytes.

__________

Step 1:

Open your Terminal window and enter the below command.

gksudo gedit /etc/modprobe.d/blacklist.conf

Step 2:

This will open up a configuration file. Now go to the end of this file, and simply copy and paste the following code in a new text line. This method will disable the webcam in Ubuntu.

#Disabling the webcam device.
blacklist uvcvideo

blacklisting-the-webcam-device-in-Ubuntu-12.04

The ‘#Disabling the …’ code is actually optional, but I put it there so you can identify the code afterwards.

Once done, save your changes, close the configuration file and reboot your PC to apply the setting. That’s it!.

How to re-enable it later?

Enabling permanently …

Quite simple actually. Open the configuration file again, and remove the added code from it. Save your changes and reboot the computer. That’s it.

Enabling temporarily …

Or, if you only wanted to enable it temporarily, then enter the below command in your Terminal window.

sudo modprobe uvcvideo

And open the program that is trying to access your webcam and now it should be working. But please remember that the next time you reboot your computer, Ubuntu will automatically disable it.

An RHCE, 'Linux' user with 14+ years of experience. Extreme lover of Linux and FOSS. He is passionate to test every Linux distribution & compare with the previous release to write in-depth articles to help the FOSS community.

2 thoughts on “How to Disable Your Webcam in Ubuntu?”

  1. This method of blacklisting a module is probably the most flexible way to prevent the module from loading whenever the system is started, while it can still be loaded through a simple ‘modprobe’ command should the need ever arise. I actually use this very same method to ensure that bluetooth will not be automatically loaded.

    If, however, you want to prevent the module from loading, ever, even with a ‘modprobe’, you may want to ‘fake-install’ it. To do so, replace the ‘blacklist’ line with something like the following:

    ————
    install uvcvideo /bin/true
    ————

    This will cause ‘modprobe’ to run the ‘/bin/true’ program whenever it is instructed to load the module, i.e., do nothing but return a successful result. Just be forewarned, though, that you will now no longer be able to load the module unless you modify the blacklist configuration file again.

    Reply
  2. I’ve already disabled my cams on all my laptops (running Ubuntu, Mint, Manjaro, and a few other distros) but I’ve also added a webcam cover on all of them. You can never be too safe 😀

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.