Announcement

Collapse
No announcement yet.

How to download Kubuntu software updates to a USB drive for offline installation later?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Software] How to download Kubuntu software updates to a USB drive for offline installation later?

    Dear All,

    System and software updates are getting larger every day. While I appreciate that these updates bring important bug fixes and improvements, they present a challenge for my workflow.
    I travel frequently and rely on a limited mobile data hotspot while on the road. However, I have access to a fast, unlimited broadband connection at home.

    Currently, the moment I connect to the internet while traveling, the Kubuntu Discover app automatically starts downloading updates. This quickly exhausts my mobile data package.

    I want to find a way to download 100% of my system and software updates while I am at home on my fast internet, save them to a USB flash drive or external hard drive, and then install them later when I am traveling without using any internet data.Is this possible?

    How can I download the complete update files so they do not request an active internet connection during the installation process?
    Please guide me on the best tools or commands to achieve this.
    ​
    ─── ■ 🐧 CORE: LINUX KERNEL // FLAVOR: CHOOSE BOTH ■ ─── ⚡ "Stability means Ubuntu and Power means Kubuntu." ⚡​

    #2
    Google AI question: kubuntu linux how do I download system updates to a USB drive without having them installed?


    To download system updates to a USB drive on Kubuntu Linux without installing them, you can use APT's download-only flags directed to your USB mount point or use dedicated tools like apt-offline. [1, 2]


    Method 1: Using apt with a Custom Cache Directory (Recommended)

    You can instruct APT to fetch all pending upgrades and their dependencies directly into a folder on your USB drive. [1]
    • Plug in your USB drive and note its mount point (for example, /media/user/USB_NAME). Create a temporary cache structure on the drive:

      mkdir -p /media/user/USB_NAME/apt/cache/partial mkdir -p /media/user/USB_NAME/apt/lists/partial

      Use code with caution.
    • Update your package lists: [1] bash

      sudo apt update


      Use code with caution.
    • Download all available upgrades to the USB drive without installing them on your system:

      sudo apt upgrade --download-only \ -o Dir::Cache=/media/user/USB_NAME/apt/cache \ -o Dir::State::Lists=/media/user/USB_NAME/apt/lists

      Use code with caution.
      • All .deb package files will be safely stored inside /media/user/USB_NAME/apt/cache/archives/. [1]



    Method 2: Using the Default Cache Folder

    If you don't mind downloading them to your internal drive first and then copying them over:
    • Download updates to the local cache: bash

      sudo apt upgrade --download-only


      Use code with caution.
    • Copy the archives from /var/cache/apt/archives/ onto your USB drive: [1]

      cp /var/cache/apt/archives/*.deb /media/user/USB_NAME/

      Use code with caution.



    Method 3: Using apt-offline (Best for Completely Offline Target PCs)

    If you are preparing updates on an internet-connected Kubuntu machine to transfer to a totally offline Kubuntu machine, use apt-offline: [1]
    • Install apt-offline on both machines if not already present:

      sudo apt install apt-offline

      Use code with caution.
    • On the offline computer, generate a signature file:

      sudo apt-offline set /media/user/USB_NAME/update.sig --upgrade

      Use code with caution.
    • Move the USB drive to an internet-connected computer and download the data:

      sudo apt-offline get /media/user/USB_NAME/update.sig --destination /media/user/USB_NAME/

      Use code with caution.
    • Move the USB drive back to the offline computer and apply or cache the data: [1, 2, 3, 4]

      sudo apt-offline install /media/user/USB_NAME/

      Use code with caution.




    ​
    Slava Ukraini! 🇺🇦
    Windows no longer obstruct my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes​

    Comment


      #3
      IMO: downloading the updates when at home to take with you is not useful, assuming your travel computer is at home as well, of course, and your home internet is not as restricted as your mobile.
      In this case just update it there, as you would just be making a portable repo that has the same exact updates you have already installed.


      A few things to consider, from being in a similar situations quite often.
      Aside from travel, I was using an often spotty and definitely metered mobile connection as my main home/work internet source until fairly recently. AND I run the semi-rolling KDE neon as my main system, so my updates come often and can be large at times. So reducing my usage as much as possible was a key part of my setup.

      When traveling, never open Discover, so it doesn't even check for apt, snap, flatpak, theme, and firmware updates. While checking does not use much data, it can slow your connection as it checks up to five different sources each time the app is opened.

      Discover itself does not check, download or install updates in the background.
      BUT: your OS (the ubuntu part) will download and install system security updates, depending on your configuration.

      Open your Software Sources, found in Discover's Settings area (wait for it to check for updates for the button to show up )
      Go to the Updates tab and edit the settings.

      Click image for larger version  Name:	Screenshot_20261024_174925.png Views:	0 Size:	66.3 KB ID:	694899​
      At the very least, change the Automatic updates from the default "install security updates" to "only notify"​
      Better yet, turn this off.


      Luckily, in most cases security updates are usually very small in size, even if there are many packages. Except for web browsers, of course.


      Which brings me to the next thing to do.
      If you have not removed Snap, you can also set it to not autorefresh any software (Firefox, Thunderbird for example).

      Code:
      snap refresh --hold​
      This will keep all snaps from updating unless you do so manually or by opening Discover.

      More info and more options on this HERE
      Last edited by claydoh; Today, 01:31 AM.
      Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
      HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
      HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux​

      Comment

      Users Viewing This Topic

      Collapse

      There are 0 users viewing this topic.

      Working...
      X