An easy way to upgrade or install new software on an offline Linux PC

This is a procedure I sometime use to update several offline desktop computers with Linux Ubuntu (and derivatives).

OVERVIEW:

  1. With the offline PC, you must have the possibility to periodically connect to the internet with a low-speed connection, using for example an EDGE/UMTS cell phone, 56k modem or other. This is needed just to download a small amount of data like the list of packages to update/install.
  2. You must also have the possibility to periodically use an online PC with a high-speed internet connection (DSL, wi-fi or other) to download all packages needed to update the offline PC.
  3. A mobile storage unit like a USB pen drive or a USB hard disk drive, used to move packages between online/offline PCs.
  4. Availability of the Firefox web browser with DownThemAll addon on the online PC. It’s easy to install Firefox from its web page then the addon can be easily installed after launching Firefox and searching for DownThemAll in “Add-ons” menu item.

1-firefox add-on menu2-ricerca downthemall

GUIDE:

  1. Connect offline PC to the internet with the low-speed connection.
  2. Open a shell (bash terminal), go to your home folder and give these two commands to update the system and generate a text file containing the list of packages to update / install:
    sudo apt-get update
    sudo apt-get -qq --print-uris dist-upgrade > uris
  3. Next, give this command to create a list of packages to download (wget-script.txt):
    sudo awk '{print "wget -O " $2 " " $1}' < uris > wget-script.txt
  4. Now, save wget-script.txt on your USB pen drive and let’s go on the online PC where you can download the packages.
  5. On online PC insert your pen drive containing wget-script.txt
  6. Open Firefox and DownThemAll! plugin (dTA! manager), right-click with mouse in dTA! manager window and choose the menu “Advanced”->”Import from file…”. Here select the wget-script.txt previously created.DTA Manager context menu
  7. The download links will be imported in DownThemAll!… Now, filter *.deb files and give a target folder where the packages will be downloaded. Start the download.4-bis_donloading_path_n_filter5-aggiornamento
  8. At the end of download, you can copy this folder of new packages on your USB pen drive and put them on the offline PC.
  9. On offline PC insert the USB pen drive and copy the new packages folder to your home.
  10. Now give the following command to install these updates on your offline PC:
    sudo apt-get -o dir::cache::archives="/home-folder-path/package-folder" dist-upgrade
    

That’s all folks!

Don’t hesitate to send me feedbacks, I can improve the guide with your suggestions.
Thanks a lot. /Saverio

Advertisements

8 thoughts on “An easy way to upgrade or install new software on an offline Linux PC

    • Hi Anton, it’s enough to replace the parameter “dist-upgrade” with “install wine” for example, in all the procedure steps where shell commands with “dist-upgrade” are reported.
      If you need a clearer indication, please tell me.

      • THANKS will try tonight and come back to you, also i named my folder with the downloaded updates “Linux MInt 15 Updates for pc 03-07-2013”. just want to be clear on when after copying the folder to my home folder, what will the last command be exactly to install it on the offline pc. please that would be great help.

      • After that you copied you folder with packages into your home of offline pc, you can give this command to install the application:
        sudo apt-get -o dir::cache::archives="/home-folder-path/package-folder" install wine
        “install wine” is just an example and is the part that must be equal to the one used for the step 2 of the guide.

        In brief, if you gave this at step 2 of the guide:
        sudo apt-get update
        sudo apt-get -qq --print-uris install wine > uris

        You can give this at step 10 of the guide:
        sudo apt-get -o dir::cache::archives="/home-folder-path/package-folder" install wine

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s