Offline Installation of NI Drivers on Ubuntu

Updated May 13, 2026

Environment

Operating System

  • Linux

NI provides python script to clone or create custom repositories for use on offline systems. The script targets Debian-based Linux distributions supported by NI. This article explains how to use the script to create an offline repository for installing software from the NI Linux Device Drivers repository on ni.com onto an offline Ubuntu system.

 

To create offline installation media, you will need a separate system that:

  • Runs the same Linux distribution as the target offline system
  • Has internet access to retrieve packages from NI repositories

Additionally, root privileges are required, and certain prerequisite software must be installed to ensure the scripts run correctly.

 

The Python scripts mentioned in the instructions are available for download at the bottom of this article.

  1. Configure the Host system to prepare for running the script
    1. This system should be running the same distribution as the target system and have an internet connection.  In addition, the host system should be up-to-date and the same patch version as the target system.
    2. Install the prerequisite software by running the following commands for the chosen distribution:
      Ubuntu 24.04 / Ubuntu 22.04
      sudo apt-get install python apt-mirror dpkg-dev
    3. Register NI’s source repository with the system. Follow the steps to download and install the repository definition file for your system from NI Linux Device Drivers Download Page.  It is recommended to use the "static" repo type rather than the "stream" repo type for this process.
    4. Download the required Python script from this page that matches the Linux distribution of your host and target system.
      1. Change the permissions of the Python script so that it is executable:
        chmod +x offline_deb_repo.py or chmod +x offline_rpm_repo.py
  2. Use the script to clone the entire NI Linux Device Driver repository
    1. Using the attached Python script, you can clone the entire NI repository.  The following sections outline the commands necessary for each script to specify which repos to clone.
      1. Determine the name of the repo to clone:
        ls /etc/apt/sources.list.d
        • Check the files in this directory for a file that matches the source repo to clone.  In this example, there should be a file named ni-software-2025-noble.list.  The filename without the extension is the name the script expects.  In this case, "noble" is the codename for Ubuntu 24.04.  For Ubuntu 22.04, the codename is "jammy", so the filename would be ni-software-2025-jammy.list in that case.
      2. Run the following command from the directory where the script is located to clone the repository:
        ./offline_deb_repo.py -vvv repo --collapse ni-software-2025-noble
        • By default, the repo will be cloned to a subdirectory called "offline_repo" in the directory where the Python script is located.  If you'd like to change this, use the --output flag with a directory as the argument.
        • The -vvv flag increases the verbosity of the script and allows you to see the status of the download.
    2. When the download completes, you may notice an error reported by the script that a file named post-mirror.sh is missing from the /tmp directory.  This error is not fatal -- the download still completed successfully even if it is shown.
  3. NI products depend on some additional packages from the system repositories that are not installed by default.  If the target system is going to be truly offline, it will be necessary to download these package dependencies on the host system for installation on the target.
    1. With the most recent version of the offline_deb_repo.py script, there is now a built-in way to achieve this.  Use the --download-additional flag when running the initial repo download: 
      ./offline_deb_repo.py -vvv repo --download-additional --collapse ni-software-2025-noble
      Copy the additional_packages directory to the target PC in step 4 to the /srv directory
    2. Enter the following commands:
      mkdir ~/offline-packages
      sudo apt install --download-only --reinstall dkms expat libopenal1 build-essential
      cp /var/cache/apt/archives/*.deb ~/offline-packages
  4. Configure the target offline system
    1. Choose where the repository should be located on the target system.  Select a location where system users will not be able to accidentally delete the repository or modify its contents.  In this example, /srv/offline_repo will be used.
      1. Copy the offline_repo directory from the host machine to /srv using any standard file transfer method such as USB or a network share
      2. Copy ~/offline-packages from the host system to ~/offline-packages on the target system using any standard file transfer method such as USB or a network share
    2. Determine the name that you'll use for the repository.  This example uses ni-offline-software-2025.
      1. As root, create the repo file:
        sudo touch /etc/apt/sources.list.d/ni-offline-software-2025.list
      2. As root, edit the file:
        sudo nano /etc/apt/sources.list.d/ni-offline-software-2025.list
        and include the following text:
        deb [trusted=yes] file:///srv/offline_repo noble ni
        Press <CTRL-O>, followed by the Enter key to save the file, then <CTRL-X> to exit the editor.
  5. Install the dependency packages from offline-packages:
    1. If you used the --download-additional flag, you should have copied the additional_packages directory to /srv in step 4.  You can use the following command to add the directory as a local repo and install the dependent packages:
      echo "deb [trusted=yes] file:///srv/additional_packages stable main" | sudo tee /etc/apt/sources.list.d/additional-packages.list
      sudo apt update
      sudo apt install dkms expat libopenal1
  6. If the target system will be used fully offline, the default repositories will need to be disabled. The reason for this is that an apt update command will continue to try to update the metadata for the online repositories which will time out and generate errors.  In some cases this will prevent package installation even when packages from the online repo are not required to complete the transaction.  
    • On Ubuntu 22.04, you can edit /etc/apt/sources.list and use the # character to comment out all of the lines in this file
    • On Ubuntu 24.04, the format is different.  
      • You could edit /etc/apt/sources.list.d/ubuntu.sources and add the line Enabled: no to each source's stanza
      • Alternatively, you could default repo files on disk, the repos are disabled in a non-destructive manner, which the package manager will ignore the repos:
        sudo mv /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak
  7. Install from the new repository
    1. At this point, the target system is ready to be used to install the offline software.  NI packages can be installed as if the system were connected to the internet.  For example:
      sudo apt install ni-daqmx

 

Additional Information:

Script Help
The attached Python scripts are versatile and contain additional options to customize repository creation.  Pass the --help flag to the scripts to obtain a detailed list of the various options and capabilities the scripts provide.