Offline Synaptic Installation/Repository Updates
Goal: To allow users with fresh installations of Ubuntu that don’t have internet access with that machine to install software from the Ubuntu repositories. I’ve never seen a tutorial or tip like this, so I hope it will meet some hitherto unmet needs.
Skill level: Basic. I’ve tried to make this pretty simple. I recommend you copy/paste all code given in this tutorial rather than type it out, to make sure no typos occur.
If you have any questions at all leave a comment at the bottom of the page. I’ll try and keep this updated and provide support.
About: This tutorial is especially aimed at users with a fresh installation of Ubuntu 11.10 on their computer but with no internet connection available to that computer. If you can get your computer online, by all means skip this tutorial and install your software the easy way.
Many people still don’t have internet access at home, and many of those people own desktop computers, which aren’t very portable to local wifi hotspots or internet cafés. That’s where these instructions will be handy.
This tutorial assumes you have access to a second computer running Ubuntu with an internet connection. We’ll refer to this as your “online” PC, and your first machine as the “offline” one.
Since the easiest and most common tool for offline software installation, Synaptic Package Manager, doesn’t come bundled with Ubuntu any more (as of 11.10) this tutorial will guide you through installing Synaptic first.
IMPORTANT: Before you do anything else, you first need to know whether your offline Ubuntu installation uses 32 or 64 bit architecture. To find this out, open a terminal by typing
When the terminal is open, copy/paste the following code at the prompt:
This will give an output of either x86_64 (64 bit) or i686 – i386 (32 bit). The packages are different for 64 and 32 bit, but the whole basic procedure will remain the same. Just remember throughout this tutorial which your system uses.
Now to install Synaptic!
1. On the online computer: Make a new folder in your home folder called “synaptic” (no quotes, obviously).
2.If your offline system is 32 bit, open a text editor and paste the code below into it-
Code:
#!/bin/sh
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.6/libstdc++6_4.6.1-9ubuntu3_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.6/libgcc1_4.6.1-9ubuntu3_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/glib2.0/libglib2.0-0_2.30.0-0ubuntu4_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/libx/libx11/libx11-6_1.4.4-2ubuntu1_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/gdk-pixbuf/libgdk-pixbuf2.0-0_2.24.0-1ubuntu1_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/gtk+2.0/libgtk2.0-0_2.24.6-0ubuntu5_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpango1.0-0_1.29.3+git20110916-0ubuntu1_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg4.11_0.8.16~exp5ubuntu13_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/e/eglibc/libc6_2.13-20ubuntu5_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-inst1.3_0.8.16~exp5ubuntu13_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/h/hicolor-icon-theme/hicolor-icon-theme_0.12-1ubuntu1_all.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/libe/libept/libept1_1.0.5build1_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/l/launchpad-integration/liblaunchpad-integration1_0.1.54_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/v/vte/libvte9_0.28.2-0ubuntu2_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/x/xapian-core/libxapian22_1.2.5-1ubuntu1_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/universe/s/synaptic/synaptic_0.75.2ubuntu8_i386.deb
If your offline system is 64 bit, paste this code instead:
Code:
#!/bin/sh
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.6/libstdc++6_4.6.1-9ubuntu3_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/gcc-4.6/libgcc1_4.6.1-9ubuntu3_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/glib2.0/libglib2.0-0_2.30.0-0ubuntu4_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/libx/libx11/libx11-6_1.4.4-2ubuntu1_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/gdk-pixbuf/libgdk-pixbuf2.0-0_2.24.0-1ubuntu1_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/g/gtk+2.0/libgtk2.0-0_2.24.6-0ubuntu5_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/p/pango1.0/libpango1.0-0_1.29.3+git20110916-0ubuntu1_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg4.11_0.8.16~exp5ubuntu13_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/e/eglibc/libc6_2.13-20ubuntu5_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-inst1.3_0.8.16~exp5ubuntu13_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/h/hicolor-icon-theme/hicolor-icon-theme_0.12-1ubuntu1_all.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/libe/libept/libept1_1.0.5build1_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/l/launchpad-integration/liblaunchpad-integration1_0.1.54_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/v/vte/libvte9_0.28.2-0ubuntu2_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/x/xapian-core/libxapian22_1.2.5-1ubuntu1_amd64.deb
wget –c http://us.archive.ubuntu.com/ubuntu/pool/universe/s/synaptic/synaptic_0.75.2ubuntu8_amd64.deb
This is a complete download script for Synaptic, with all dependencies. Save this file as synapt.sh in the folder “synaptic” that you just created.
3. Open a terminal (Control+Alt+t again) and copy/paste the following code at the prompt.
Code:
chmod +x synaptic/synapt.sh
Then run
All the required packages for Synaptic will be downloaded into the “synaptic” folder. They’ll all have a .deb file extension.
4. Use a flash drive to copy the folder to the offline computer’s home. Open a terminal and type
Code:
sudo dpkg –iR synaptic
Enter your password at the prompt. This will install Synaptic on your offline computer. The first step is done!
STEP 2: Update Repositories
Almost all the software available for Ubuntu is stored on Canonical servers. These software groups are called repositories. In the software installation process Synaptic simply sends a message to these servers telling them which packages to download, and then installs it for you. You did the process manually yourself when you installed Synaptic in the previous step.
Before downloading anything from a repository, Synaptic needs to know exactly what is in the repository in the first place. Each repository contains a compressed text file with a long list of all software packages available in that repository. Synaptic looks at that info and relays that to you in the program. Since our offline Synaptic can’t query a server, we need to download those lists of packages, copy them onto the offline computer, and tell Synaptic to look on the computer itself for the info. Follow this part very closely.
NOTE: This step is for users of Ubuntu 11.10 Oneiric Ocelot. I’ll try and keep this page updated for later versions. The same procedures will still apply no matter what version of Ubuntu you have; the only difference will be the name of the version.
1.On your online computer: Direct your web browser to
http://ubuntu.secs.oakland.edu/dists/
This is where the repositories for all Ubuntu versions from Hardy Heron to Oneiric Ocelot are kept. If you’re running Oneiric (as this tutorial assumes you are) select “oneiric”.
This will take you to another page, where you’ll select “main/”.
On the next page, select “binary-i386/” if your computer is 32 bit, or “binary-amd64/”.
On the next page, select “Packages.gz”.
This will download a compressed text file with the list of all available software in the Main Ubuntu repository. Save the compressed file (don’t uncompress it!) to its own folder on your flash drive. Since you’ll be downloading 4 of these compressed files (all having the same name) saving them in individual folders will help keep them sorted out.
Go back to
http://ubuntu.secs.oakland.edu/dists/oneiric/
and follow the above procedure with “multiverse/”, “restricted/” and “universe/”.
When it’s all said and done you should have 4 Packages.gz files on your flash drive.
2. Take your flash drive to the offline computer and open a terminal. Copy/paste the following command-
For a 32 bit system:
Code:
mkdir –p ~/dists/oneiric/main/binary-i386 ~/dists/oneiric/multiverse/binary-i386 ~/dists/oneiric/restricted/binary-i386 ~/dists/oneiric/universe/binary-i386
For a 64 bit system:
Code:
mkdir –p ~/dists/oneiric/main/binary-amd64 ~/dists/oneiric/multiverse/binary-amd64 ~/dists/oneiric/restricted/binary-amd64 ~/dists/oneiric/universe/binary-amd64
This command makes a number of new folders in your home folder. It’s important that you don’t delete or edit these folders in any way in the future.
3. Copy each Packages.gz file to its corresponding folder in home- i.e., the file you got from Main goes in dists/oneiric/main/binary-i386, the file from Multiverse goes in dists/oneiric/multiverse/binary-i386, etc. Again, don’t uncompress any of these files!
4. Once these are all copied over, open a terminal and type
To open Synaptic Package Manager. In Synaptic, click Settings>Repositories.
This will bring up the repository dialog box. Select the “Other Software” tab.
Select “Add…”.
What you’ll be doing is telling Synaptic where it can look to find software information other than the online repositories.
In the Add Repository dialog, type the following
Code:
deb file:/home/your_user_name oneiric main
Obviously, change your_user_name to your user name. Note that after your user name there’s a space, the name of the Ubuntu version (oneiric), space, and then the repository name (main, multiverse, universe, restricted).
Click Add Source and you’re done. Repeat this process, substituting the name of each repository for “main”. When you’re done you’ll have added four new repositories. It should look like this.
Synaptic will automatically add four other “Source Code” repositories. In my experience with offline package managing these don’t serve any purpose and generate confusing error messages, so go ahead and remove each one that has “Source Code” appended to the end of the name.
When you’re done with that, close out of the Repositories dialog and click the large “Reload” button in the upper left.
The reloading process WILL give you an error message, simply because it wasn’t able to contact the Ubuntu servers. Scroll down to the bottom of the error log. If you don’t see any errors about your recently added repositories, the update was successful!
You’re all set to install software now! For info on how to get started with that, see my other tutorial on how to install software offline using Synaptic.
NOTE: There is one hitch with this type of offline installation and updating. Any download script you produce with this will have instructions to download from your /home/ repository, rather than the real ones. Here's a sample:
Code:
wget -c file:/home/cortman/pool/main/x/xaw3d/xaw3dg_1.5+E-18_i386.deb
wget -c file:/home/cortman/pool/universe/3/3dchess/3dchess_0.8.1-17_i386.deb
To fix it, you need to open the download script in a text editor and change file:/home/your_username to the real URL of the repository. If you're in the US, just change them to this:
Code:
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/x/xaw3d/xaw3dg_1.5+E-18_i386.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/universe/3/3dchess/3dchess_0.8.1-17_i386.deb
If you're not in the US and can figure out your nearest repository, great! Otherwise, the US one will work, albeit more slowly, and if you want me to find your nearest repository, post the request on this thread. Good luck!
Bookmarks