TranslateProject/sources/tech/20221017.1 ⭐️ How to Update or Upgrade Ubuntu Offline without Internet.md

5.0 KiB
Raw Blame History

How to Update or Upgrade Ubuntu Offline without Internet

This guide explains the steps to update Ubuntu offline without an active internet connection.

There are many situations where you may need to update your Ubuntu installation without an internet connection. You may be staying remotely or have a set of network Ubuntu systems that are not connected to the internet. In any case, keeping your system updated with the latest packages is always required.

Of course, updating any system while connected to the internet is always recommended.

But sometimes, it is not possible for security reasons also. Connecting to the internet may bring additional hardening steps for your systems to protect them from hackers and malware.

The following method using apt-offline helps to fix those use cases and outlines the steps to update your Ubuntu offline without the internet.

Pre-requisite

  • You need to have access to a Ubuntu system that has an internet connection (e.g. your friends, cafe, or lab system)
  • A USB pen drive to hold the packages
  • Install the apt-offline package in both the systems a) the offline system and b) the system with an internet connection.

Install apt-offline

both systems

You can install the apt-offline using the following command. Remember, you have to get it installed in .

sudo apt install apt-offline

In case you need the apt-offline to be installed in the target system, you can download the deb package from the below link and copy it to the target system via a USB stick. Then run the below command to install.

The download link for Ubuntu 22.04 LTS and other versions is present below. You can choose a mirror and download the deb file.

download .deb files apt-offline

sudo dpkg -i name_of_package.deb

Update Ubuntu offline: Steps

Open a terminal in the offline Ubuntu system and create a signature file using the following command in your home directory.

sudo apt-offline set ~/offline-data.sig

Create the sig file

This creates a file containing the required package paths and details for download.

sig file contents

Copy this .sig file to a USB and take it to a Ubuntu system with internet access.

Create a directory (see example below) to hold the downloaded packages in the Ubuntu system with an internet connection.

Open a terminal and run the following command to download the required packages. Remember to change the download directory and .sig file path as per your system.

apt-offline get -d ~/offline-data-dir offline-data.sig

Download the packages to install offline

offline Ubuntu system

You should see the files are downloaded properly. Now copy the entire downloaded directory to the USB drive and plug it into the .

Then run the following command to install the downloaded packages to the offline system. Change the directory path as per your system.

sudo apt-offline install offline-data-dir/

Installing packages - offline update ubuntu

The update should run smoothly if all goes well, and you should have an updated Ubuntu system.

You must repeat the steps above to keep your Ubuntu system up-to-date offline whenever you need to update.

I hope this guide helps you to update your Ubuntu system in an offline mode. If you face any trouble, let me know in the comment box below.


via: https://www.debugpoint.com/how-to-update-or-upgrade-ubuntu-offline-without-internet/

作者:Arindam 选题:lkxed 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出