How can I install `flashplugin-installer` and `ttf-mscorefonts-installer` without an Internet connection?

Solution 1:

You'll need a computer of the same architecture as the offline computer. This computer needs to be the same computer architecture as the offline computer (i.e: i386 32-bit or i686 64-bit). It needs to be running the same release of Ubuntu as the offline computer.

On the online computer:


Download the needed packages:

  1. Create a directory in your home folder named files-downloaded.

  2. On the online computer, launch Synaptic. Under Ubuntu 11.04, this easily done by pressing the windows button, and then typing synaptic package manager.

  3. Find the package named flashplugin-installer, right-click on it and mark it for installation. If it is already installed, mark it for re-installation. Marking flashplugin-installer for installation

  4. If a dialog window asks you to install libnspr4-0d, click Mark. If this dialog doesn't appear, you will need to find libnspr4-0d yourself and mark it for re-installation.

  5. Find the package named ttf-mscorefonts-installer, right-click on it and mark it for installation. If it is already installed, mark it for re-installation.

  6. If a dialog window asks you to install cabextract, click Mark. If this dialog doesn't appear, you will need to find cabextract yourself and mark it for re-installation.

  7. Find the package named debconf-utils and mark it for installation or re-installation as necessary. This package is required later on to set the offline location of the additional files we are going to download.

  8. Click File->Generate package download script, and save the script under the files-download directory with the name download-packages. Generating package download script

  9. Open a terminal by pressing the windows key and typing terminal.

  10. Type the following. This will download all the required .deb files to the files-downloaded folder.

    cd ~/files-downloaded
    sudo chown username:username download-packages
    chmod +x download-packages
    ./download-packages
    

Download the fonts:

  1. Save the following code as files-downloaded/download-fonts:

    #!/bin/bash
    
    set -e
    
    FONTS='andale32.exe arial32.exe arialb32.exe comic32.exe courie32.exe 
    georgi32.exe impact32.exe times32.exe trebuc32.exe verdan32.exe webdin32.exe'
    
    URLROOTS="http://downloads.sourceforge.net/corefonts/
        http://switch.dl.sourceforge.net/sourceforge/corefonts/
        http://mesh.dl.sourceforge.net/sourceforge/corefonts/
        http://dfn.dl.sourceforge.net/sourceforge/corefonts/
        http://heanet.dl.sourceforge.net/sourceforge/corefonts/
        http://jaist.dl.sourceforge.net/sourceforge/corefonts/
        http://nchc.dl.sourceforge.net/sourceforge/corefonts/
        http://ufpr.dl.sourceforge.net/sourceforge/corefonts/
        http://internode.dl.sourceforge.net/sourceforge/corefonts/
        http://voxel.dl.sourceforge.net/sourceforge/corefonts/
        http://kent.dl.sourceforge.net/sourceforge/corefonts/
        http://internap.dl.sourceforge.net/sourceforge/corefonts/"
    
    for font in $FONTS
    do
        for website in $URLROOTS
        do
            if ! wget -c ${website}${font} ; then
                continue 1;
            fi
            break
        done
    done
    
    echo Done
    
  2. Open a terminal and type the following:

    cd ~/files-downloaded
    chmod +x download-fonts
    ./download-fonts
    

Download the Flash plugin tarball:

  1. Save the following code as files-downloaded/download-flash:

    #!/bin/bash
    
    set -e
    
    # Ensure that the flash plugin is installed and the latest version:
    sudo apt-get install -y flashplugin-installer
    
    FLASH_VERSION_LINE=$(grep -m 1 ^FLASH_VERSION= /var/lib/dpkg/info/flashplugin-installer.postinst)
    
    eval $FLASH_VERSION_LINE
    
    echo Flash version: "$FLASH_VERSION"
    
    FILENAME=adobe-flashplugin_${FLASH_VERSION}.orig.tar.gz
    PARTNER_URL=http://archive.canonical.com/pool/partner/a/adobe-flashplugin/$FILENAME
    
    
    wget -c "$PARTNER_URL"
    
    echo Done
    
  2. Open a terminal and type the following:

    cd ~/files-downloaded
    chmod +x download-flash
    ./download-flash
    

Transfer:

Now copy the folder named files-downloaded to a USB stick or use your favourite file synchronising service. This folder should have 11 .exe files, one .tar.gz file, five .deb files and three scripts.

On the offline computer:


  1. Copy the folder named files-downloaded to your home directory.

  2. Run the following in a terminal:

    cd ~/files-downloaded
    sudo dpkg -i debconf-utils_*.deb cabextract_*.deb libnspr4-0d_*.deb
    
    echo flashplugin-installer flashplugin-installer/local string ~/files-downloaded/ | sudo debconf-set-selections
    echo ttf-mscorefonts-installer msttcorefonts/dldir string ~/files-downloaded/ | sudo debconf-set-selections
    
    sudo dpkg -i flashplugin-installer_*.deb
    sudo dpkg -i ttf-mscorefonts-installer_*.deb
    
    echo flashplugin-installer flashplugin-installer/local string | sudo debconf-set-selections
    echo ttf-mscorefonts-installer msttcorefonts/dldir string | sudo debconf-set-selections
    
  3. You're done! That was a lot more complicated than it should have been, but sadly both Adobe and Microsoft restrict the distribution of Flash and their fonts respectively. This is the only legal way to get round their strict licensing.


Just add if you are bugged with install of flashplugin-installer failing due to dependency update-notifier-common you can use the below steps to reinstall update-notifier-common:

Delete the files under /usr/share/package-data-downloads:

sudo rm -f /usr/share/package-data-downloads/*

Install update-notifier-common again:

sudo apt-get install update-notifier-common

This should now complete without attempting to download flash or fonts Rerun the script in the last part it should just work