Offline Installation of NI Linux Device Drivers

Updated Jun 11, 2025

Environment

Driver

  • NI Linux Device Drivers

Operating System

  • Linux

My Linux system is not allowed to connect to the internet due to my company's privacy or security policy. Are there any methods to install Linux device drivers offline on my computer?  

NI provides two scripts to clone or create custom repositories for use on offline systems. These scripts target either the RPM- or Debian-based Linux distributions that NI supports. This article instructs you on how to use the scripts to create offline repositories for installing software from the NI Linux Device Drivers repository on ni.com to an offline machine.

The offline installation media creation procedure requires a system running the same distribution as the target system with an internet connection to be able to access NI’s repositories. You must have root privileges on the system and must install a set of prerequisite software for the script to run properly.

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
    • 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.
    • Install the prerequisite software by running the following commands for the chosen distribution:
      • RHEL 9
        sudo dnf install python39 createrepo
      • RHEL 8
        sudo dnf install python36 createrepo
      • Ubuntu 24.04 / Ubuntu 22.04
        sudo apt-get install python apt-mirror dpkg-dev
    • Register NI’s source repository with the system. Follow the steps to download and install the repository definition file for your system from Installing NI Driver Software on Linux Desktop.  It is recommended to use the "static" repo type rather than the "stream" repo type for this process.
    • Download the required Python script from this page that matches the Linux distribution of your host and target system.
      • 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 
    • 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.
    • RHEL Systems:
      • Determine the name of the repo to clone.  Run the following commands to list all known and enabled repos on a system:
        sudo dnf repolist
      • Run the following command from the directory where the script is located to clone the repository:
        ./offline_rpm_repo.py -vvv repo --norepopath ni-software-2025
      • 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.
    • Ubuntu Systems:
      • 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 will be ni-software-2025-jammy.list.
      • 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.
    • 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.
    • RHEL Systems:
      • Enter the following commands (the 9 in the third command is for systems running RHEL9; change it to an 8 when using RHEL8):
        mkdir ~/offline-packages
        cd offline-packages
        sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
        sudo dnf download --alldeps --resolve dkms expat openal-soft bison flex kernel-debug-devel
    • Ubuntu Systems:
      • 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
    • 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.
      • Copy the offline_repo directory from the host machine to /srv using any standard file transfer method such as USB or a network share
      • 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
    • Determine the name that you'll use for the repository.  This example uses ni-offline-software-2025.
    • RHEL Systems:
      • As root, create the repo file:
        sudo touch /etc/yum.repos.d/ni-offline-software-2025.repo
      • As root, edit the file:
        sudo nano /etc/yum.repos.d/ni-offline-software-2025.repo

        and include the following text:

        [ni-offline-software-2025]
        name=NI Offline Software 2025
        enabled=1
        gpgcheck=0
        baseurl=file:///srv/offline_repo


        Press <CTRL-O>, followed by the Enter key to save the file, then <CTRL-X> to exit the editor.
    • Ubuntu Systems:
      • As root, create the repo file:
        sudo touch /etc/apt/sources.list.d/ni-offline-software-2025.list
      • 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:
    • RHEL Systems:
      • The directory ~/offline-packages should have been copied to the target in step 4
        cd ~/offline-packages
        sudo dnf --disablerepo="*" localinstall *.rpm
    • Ubuntu Systems:
      • The directory ~/offline-packages should have been copied to the target in step 4
        cd ~/offline-packages
        sudo dpkg -i *.deb
  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 or dnf install command will continue to try to update the metadata for the online repositories which will time out and generate errors.  In some cases will prevent package installation even when packages from the online repo are not required to complete the transaction.  By renaming the default repo files on disk, the repos are disabled in a non-destructive manner.
    • RHEL Systems:
      sudo mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo.bak
    • Ubuntu Systems:
      sudo mv /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak
  7. Install from the new repository
    • 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 dnf install ni-daqmx
      sudo apt install ni-daqmx
  • 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.