9

I am on Ubuntu 18.04 LTS. Updated the system to the latest. Recently I noticed something unusual on Ubuntu with my Internet connection. My limited Internet quota was used up quickly by something invisible. As a user came from Windows this was something odd as Ubuntu never did such a thing to me. I installed nethogs and found out that the devil who vanished my data was /usr/lib/snapd/snapd

I found a somewhat similar question, but it does not answer what I am going to ask. Removing snapd from start up did not help either.

  • Why does snapd use this much data?
  • Is there a way to stop those connections without disabling snap apps?

    nethogs interface showing culprit

  • How much is "this much data"? What is "My limited Internet quota"? Why do you assume snapd is "the devil who vanished my data"? What you've posted is a screenshot of a terminal window, that shows snapd downloading something at 1.4MBps at that moment. Does it prove anything? – mikewhatever Apr 6 '19 at 8:49
  • 1
    @mikewhatever I have 500MB of data that is why it is called limited, in several minutes it is over without opening any apps, just booting up the system. It is a screenshot just to show what I found out. If you think this is not the reason, can you help me to figure out why my data quota is over within several minutes with no visible apps opened. – Nuwan Thisara Apr 6 '19 at 9:12
  • Ubuntu updates itself in the background by default same as pretty much any OS. A newly installed system usually have hundreds of MB of updates. There is no apparent reason to believe that snapd is "the devil" or Ubuntu did something to you from what you've posted. 500MB is really limited, especially if the Ubuntu machine is not the only device using it. – mikewhatever Apr 6 '19 at 9:24
  • @mikewhatever BTW this is not a newly installed system. I installed this version soon after it released. – Nuwan Thisara Apr 6 '19 at 9:51
13

By default, snaps are set to refresh themselves 4 times per day. If you are using many snaps, this could be a data intensive process for you.

Perhaps limiting the number of times per day that the snaps refresh would help. You can adjust this on your system with

sudo snap set system refresh.timer=fri,15:00

to set the update of snaps to occur on Friday at 15:00, or tell snapd that you are using a metered connection:

sudo snap set system refresh.metered=hold

I suspect (but cannot prove) that snapd looks at the "Restrict Background Data" flag of the network connection (as shown in the image below), to determine that the connection is metered. If you choose to set your connections to "metered" then to update your snaps, you will need to

sudo snap refresh

on occastion, just as you would occasionally sudo apt update and sudo apt upgrade

=====

For more information on this, please see https://docs.snapcraft.io/system-options/87

enter image description here

| improve this answer | |
  • Thank you very much for your answer. I will try this and tell you if my problem is fixed. – Nuwan Thisara Apr 6 '19 at 15:03
  • @NuwanThisara I hope that it does what you need! You may also want to consider disabling the auto update services for apt. – Charles Green Apr 6 '19 at 15:13
  • I set the refresh time to fri.15:00 but when I tested nethogs just after system boot, snapd was running and downloading something consuming data. I stopped it. What is the problem? – Nuwan Thisara Apr 7 '19 at 1:04
  • 2
    Try sudo snap set system refresh.timer to see if the setting holds over reboot. I would hope so, but I don't use snaps. This is actually part of the reason why. – Charles Green Apr 7 '19 at 1:29
  • 1
    @NuwanThisara Because snapd is a service and needs to be running to load your snaps, it has to start at boot time to manage the applications that you have loaded using it. I do hope that setting the refresh interval to once per week will help with the data consumption, as the only alternative that I know of, is setting the internet connection to a 'metered' connection, which may be good for your situation anyhow. – Charles Green Apr 8 '19 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.