You successfully installed the “Adobe Flash Player Plugin” software package (i.e., “flashplugin-installer”) on one computer that has full internet access, and you are making the package available locally—e.g., through a local software repository.
You are now trying to install the package on another computer, but this time with limited or no internet access, e.g., with the following command:
When the command starts up, it produces the following output:
sudo apt-get install flashplugin-installer
You notice, specifically, the line that reads “Need to get 0B/34.2MB of archives.” From this output line, you draw the conclusion that the software packages will not be downloaded from the internet, but that the files that you want to install, will be taken from your local repository instead.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
ia32-libs lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32stdc++6 lib32v4l-0 lib32z1 libc6-i386 nspluginwrapper
xulrunner-1.9 konqueror-nsplugins ttf-bitstream-vera ttf-dejavu ttf-xfree86-nonfree xfs lib32asound2-plugins
The following NEW packages will be installed
flashplugin-installer ia32-libs lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32stdc++6 lib32v4l-0 lib32z1 libc6-i386 nspluginwrapper
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/34.2MB of archives.
After this operation, 145MB of additional disk space will be used.
Do you want to continue [Y/n]?
However, when you continue the operation, you discover that the installer still attempts to download a “.tar.gz” archive file; this download will, obviously, fail if the computer does not have an active internet connection—e.g.:
In this post, I will explain how you can examine the “flashplugin-installer” package, and find a way to avoid having the package download the archive file during installation.
--2010-04-18 16:22:17-- http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_10.0.45.2.orig.tar.gz
Resolving archive.canonical.com... failed: Name or service not known.
wget: unable to resolve host address `archive.canonical.com'
The Flash plugin is NOT installed.
Step 1: Getting a Copy of the “flashplugin-installer” Package.
As I mentioned in the introduction above, I’m assuming that you have already installed the “flashplugin-installer” package on one computer, and that you are making it available in your local software repository. You can, then, easily copy it from there to, e.g., your home directory, as follows:
A copy of the “flashplugin-installer” package should now be present in your current working directory—as the following command will demonstrate:
cp LocalRepository/flashplugin-installer_*.deb .
The output from this command should look similar to the following:
ls -l flashplugin-installer_*.deb
-rw-r--r-- 1 luvr luvr 19574 2010-05-13 15:40 flashplugin-installer_10.0.45.2ubuntu0.9.10.1_amd64.deb
Step 2: Extracting the Control Information from the Package.
If you did install the “flashplugin-installer”
package, but you do not
maintain a local repository, then you should be able to copy it from the APT package cache—i.e., the “/var/cache/apt/archives”
cp /var/cache/apt/archives/flashplugin-installer_*.deb .
If you want to take a look at what a software package actually does when you install it, you will have to extract its control information—which includes configuration settings and script files to guide the installation process (as well as the uninstallation process).
To extract the control information from a Debian package file, you can use the “dpkg-deb” command, and pass it the “--control” option—the following command, for instance, will extract the control information from your copy of the “flashplugin-installer” package file:
This command will not produce any visible output, but it will create a “DEBIAN” directory, in which it will copy the control information from the package file. You can run the following command to obtain a list of the extracted control files:
dpkg-deb --control flashplugin-installer_10.0.45.2ubuntu0.9.10.1_amd64.deb
The output will look something like this:
Two of these files will be of particular interest to you, if you are trying to figure out what exactly will happen when you attempt to install the package:
-rwxr-xr-x 1 luvr luvr 1548 2010-02-15 14:37 config
-rw-r--r-- 1 luvr luvr 1941 2010-02-15 14:37 control
-rw-r--r-- 1 luvr luvr 334 2010-02-15 14:37 md5sums
-rwxr-xr-x 1 luvr luvr 5126 2010-02-15 14:37 postinst
-rwxr-xr-x 1 luvr luvr 206 2010-02-15 14:37 postrm
-rwxr-xr-x 1 luvr luvr 2505 2010-02-15 14:37 prerm
-rw-r--r-- 1 luvr luvr 5438 2010-02-15 14:37 templates
This is the script that will drive the configuration of the installation process.
In the case of the “flashplugin-installer” package, for example, it will decide if the supporting files will have to be downloaded, or have been made available locally.
This is the script that will take any post-installation steps required to make the installed software fully functional.
These two script files can help you determine which files you will have to pre-download, and where you have to copy them, in order to keep the installer from attempting to download any further files during the installation process.
Step 3: Examining the “config” File.
If you open the “config” file in any text editor, then you will see the following code fragment near the top of the file:
While these lines will likely appear confusing to you (they surely do to me!)—they do reveal a few potentially interesting items:
echo "423ac7830c8a55ac931acb9e07a51f2aa981aedb63b45745460b4556a10e157b $RET/install_flash_player_10_linux.tar.gz" \
| sha256sum -c > /dev/null 2>&1 \
|| db_set flashplugin-installer/local /var/cache/flashplugin-installer
- 423ac7830c8a55ac931acb9e07a51f2aa981aedb63b4574546 0b4556a10e157b
This strangely looking string appears to consist of a sequence of 64 hexadecimal digits.
Since it seems to get passed on to the “sha256sum” command, it must be a SHA-256 checksum value of some file.
This string appears to be the name of a file.
Since it apparently gets passed on to the “sha256sum” command, together with the SHA-256 checksum value, it must be the name of the file to which the checksum applies.
This string certainly looks like some sort of a path name.
Since you have already identified a file name, it doesn’t seem all that far-fetched to assume that this is the name of the directory where the file should be located.
The path name occurs as a parameter to a “db_set”
command (whatever that may mean).
parameter of the command is “flashplugin-installer/local”
; thus, the command appears to “set”
a data item named “flashplugin-installer/local”
equal to the path name.
If you want to obtain a little more information on what the “flashplugin-installer/local”
item is supposed to mean, then you may want to look for its description in the “templates”
file (which is one of the files that make up the control information that got extracted from the package):
Description: Location to the local file:
Have you already downloaded the .tar.gz
package from the Internet? If so, please enter the directory you downloaded
it into. Do not include the filename here. If you
have not already downloaded it, leave this blank and the package will be
This description certainly confirms your suspicions about the meanings of the file and path name strings.
The “config” script looks for a file named “install_flash_player_10_linux.tar.gz” in the “/var/cache/flashplugin-installer” directory, and will calculate the checksum of the file in order to verify its integrity. If it doesn’t find the file, or if the checksum doesn’t match, then the script will force a download from the internet during the installation process.Note:
Step 4: Examining the “postinst” File.
Next, if you open the “postinst” file in any text editor, then you will find the following code near the top of the file:
These statements apparently refer to a file named “adobe-flashplugin_10.0.45.2.orig.tar.gz”; they specify the expected SHA-256 checksum of the file, and the location from which it should be downloaded.
Step 5: Building the “SHA256” File.
It should be clear by now, that you will have to pre-download two files:
Also, the installer will verify their checksums, and it will consider them valid only if the checksums are correct. After you download the files, it may, therefore, be a good idea to manually verify their checksums before actually installing the package—to ensure that the files were downloaded without error.
You may, therefore, want to create a checksum verification file first—i.e., a text file that lists each file that you want to verify, together with its expected checksum value. Each line of the verification file should have the following format:
- The checksum value—which should be a 64-character string of hexadecimal digits;
- A single blank space;
- A single asterisk (i.e., “*”);
- The name of the file.
To determine the actual contents of the checksum verification file, you should refer back to the “config” and “postinst” scripts discussed above. The result should look like this:
Save this text under any appropriate name—e.g., “SHA256.”
Step 6: Downloading the “install_flash_player_10_linux.tar.gz” File.
To download the “install_flash_player_10_linux.tar.gz” file, you will have to use your browser to navigate to the following URL:
For the “version to download,” select “.tar.gz for Linux,” and then click “Agree and install now.” You should save the file to the same directory where you created the “SHA256” file, above.
Step 7: Downloading the “adobe-flashplugin_10.0.45.2.orig.tar.gz” File.
To download the “adobe-flashplugin_10.0.45.2.orig.tar.gz” file, you can use the “wget” utility. The location from which to download the file, is given by the “PARTNER_URL” value in the “postinst” script, as documented above. Run the following command to get the file, and save it into your current working directory:
Step 8: Verifying the Downloaded Files.
You should make sure that your current working directory now contains the following three files:
To verify the integrity of the downloaded files, you can now run the following command:
The output from this command should tell you that the files are OK:
sha256sum -c SHA256
Step 9: Installing the Flash Player Plugin, Using the Downloaded Files.
From now on, whenever you want to install the Flash Player plugin on another computer, you can first copy the two downloaded files into its “/var/cache/flashplugin-installer” directory, as follows:
If you subsequently install the “flashplugin-installer” package on the computer, then the local copies of these files will be used, so the installer won’t have to download them again.
sudo mkdir /var/cache/flashplugin-installer
sudo cp install_flash_player_10_linux.tar.gz /var/cache/flashplugin-installer
sudo cp adobe-flashplugin_10.0.45.2.orig.tar.gz /var/cache/flashplugin-installer
The required versions of the downloaded files depend both on the Ubuntu release, and on the current Flash Player version. You will have to download new versions of the files (as identified in the “config” and “postinst” scripts documented above) when you need to install them under a different Ubuntu release, or when the Flash Player gets updated.