Installation

Polymorphing for Linux Overview

This section details how to install Polyverse’s polymorphic packages from an internet-connected machine. Polymorphing for Linux becomes the primary repository on the targeted system. This allows all supported packages to be retrieved from the Polyverse scrambled binary repository, and any custom, private, or unsupported packages to be retrievable from their original repositories. Every package downloaded is unique to the specific customer, and each used package is replaced every twenty-four hours.

Make sure your operating system is up-to-date

apt update -y && apt upgrade -y

Install Polymorphing for Linux

Note: Replace the demo auth key with your own, user-specific auth key.

curl -s https://repo.polyverse.io/cli | sh -s install <Your auth key here>

Reinstall all packages

curl https://repo.polyverse.io/cli | bash -s replace-installed-elf

Please reboot after re-installation, unless you're running in a container.

The configuration and installation is complete at this point.

Back to top

Local Repository Mirror

Overview

This section provides a simple approach to downloading Polymorphing for Linux packages from an internet-connected host, and then installing those packages on a non-internet-connected host.

At a high-level, the steps are:

  • On an internet-connected host, install Polymorphing for Linux, download the .deb packages to a folder, and create an index file.
  • Copy the index and packages to a folder accessible by the non-internet-connected host.
  • Install packages directly from the folder.

All the tools and techniques to provide this offline installation capability are standard approaches to how this can be done for any other DEB-based Linux repo. They can be adjusted for use in Docker containers, VMs, or bare metal.

Install Polymorphing for Linux and Download Packages on Internet Connected Host

Note: Replace the demo auth key with your own, user-specific auth key.

apt update -y && apt upgrade -y
apt install -y apt-mirror
curl -s https://repo.polyverse.io/cli | sh -s install <Your auth key here>
curl https://repo.polyverse.io/cli | bash -s replace-installed-elf
# Optional if you’ve already created this directory, or if you plan to use
# a different directory for the repo files.
mkdir /opt/pv
cd /opt/pv

Mirror the Polyverse repositories

Now, we need to mirror the Polyverse repository's files using apt-mirror.

First, go to /etc/apt/, and open sources.list.

cd /etc/apt/
vi sources.list

You should see that Polyverse's repositories are the first three active repositories. Their entries should look like this:

Note: the authentication keys in red will be different than what you see, and will be specific to your account.

## Polyverse Polymorphing for Linux [xenial - main]
deb https://ubuntu:<Base64 encoded blob>@repo.polyverse.io/deb/ubuntu/xenial/binary_amd64 main/

## Polyverse Polymorphing for Linux [xenial - updates - main]
deb https://ubuntu:<Base64 encoded blob>@repo.polyverse.io/deb/ubuntu/xenial-updates/binary_amd64 main/

## Polyverse Polymorphing for Linux [xenial - security - main]
deb https://ubuntu:<Base64 encoded blob>@repo.polyverse.io/deb/ubuntu/xenial-security/binary_amd64 main/

You'll want to copy these into /etc/apt/mirror.list, so that apt-mirror will know what repositories to pull from. Your mirrors.list file should look like this:
Note: again, the authentication keys in red will be specific to your account.

############# config ##################
# This is set to the directory we created earlier. Change this if you're
# installing to a different directory, or removable media.
set base_path    /opt/pv
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

## Polyverse Polymorphing for Linux [xenial - main]
deb https://ubuntu:<Base64 encoded blob>@repo.polyverse.io/deb/ubuntu/xenial/binary_amd64 main/

## Polyverse Polymorphing for Linux [xenial-updates - main]
deb https://ubuntu:<Base64 encoded blob>@repo.polyverse.io/deb/ubuntu/xenial-updates/binary_amd64 main/

## Polyverse Polymorphing for Linux [xenial-security - main]
deb https://ubuntu:<Base64 encoded blob>@repo.polyverse.io/deb/ubuntu/xenial-security/binary_amd64 main/

clean https://ubuntu:<Base64 encoded blob>@repo.polyverse.io/deb/ubuntu

Next, just run apt-mirror.

apt-mirror

Copy the files

The contents of the current folder can be copied to a location that the non-internet-connected host can access, for instance a USB drive, or directly to a NAS/SAN, etc.

Install Polymorphing for Linux Packages on Non-Internet Connected Host

On the non-internet connected host, edit /etc/apt/sources.list with your favorite text editor.

cd /etc/apt/
vi sources.list

Then add the directories that you've mirrored the repositories into to sources.list. It should look something like this:
Note: the URL in red will be changed to the directory you've put the mirrored repositories into, and the specific path may change, depending on the version and architecture.

# xenial-main
deb [trusted=yes] file:///opt/pv/mirror/repo.polyverse.io/deb/ubuntu/xenial/binary_amd64 main/
# xenial-updates
deb [trusted=yes] file:///opt/pv/mirror/repo.polyverse.io/deb/ubuntu/xenial-updates/binary_amd64 main/
# xenial-security
deb [trusted=yes] file:///opt/pv/mirror/repo.polyverse.io/deb/ubuntu/xenial-security/binary_amd64 main/

Now you should be ready to update, and replace packages.

curl https://repo.polyverse.io/cli | bash -s replace-installed-elf

Troubleshooting

dpkg-deb: error: '<package name>.deb' is not a debian format archive

In this case, the .deb file was probably corrupted during download. Find out which repository the package came from locating the path of the .deb file, then taking note of everything after the repo.polyverse.io directory. The path will look something like

/opt/pv/mirror/repo.polyverse.io/deb/ubuntu/xenial/binary_amd64/main/packages/<package name>.deb

You can re-download just this package over https by copying this URL, and replacing the path in red with the path you took note of above, then using wget or a browser to re-download the package. Then, just replace the package with the newly downloaded version.

https://repo.polyverse.io//deb/ubuntu/xenial/binary_amd64/main/packages/<package name>.deb
Back to top

Web/LAN Repository Mirror

Overview

This section details the steps for configuring and installing a local mirror of Polymorphing for Linux for Ubuntu. This is meant to synchronize packages for a given processor architecture. Setting up a variety of repositories for various Ubuntu versions and processor architectures isn't covered in this document.

Technical Overview

This is similar to setting up a local mirror, with the exception that you'll be serving it over a web server instead of using physical media to transfer files. You can follow the steps from the previous section from the beginning to the Mirror the Polyverse repositories section. In that section, in the /etc/apt/mirrors.list file, you'll change the /opt/pv/ path to /var/www/html/, resulting in a config section that looks like this:

############# config ##################
set base_path    /var/www/html/
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

Install Apache

If you don't already have Apache, or another web server installed, you'll need to install it:

apt install -y apache2

The repositories will be mirrored to /var/www/html/, Apache's default web root, so at this point, you just need to run

apt-mirror

in order to synchronize the files.

Configuring Clients

This step is essentially the same as the Install Polymorphing for Linux Packages on a Non-Internet Connected Host step from the previous section, except that you'll be pointing the clients to the server you just set up, instead of a local directory.

First, edit /etc/apt/sources.list with your favorite text editor.

cd /etc/apt/
vi sources.list

Then add the directories that you've mirrored the repositories into to sources.list. It should look something like this:
Note: the URL in red will be changed to the directory you've put the mirrored repositories into, and the specific path may change, depending on the version and architecture.

# xenial-main
deb [trusted=yes] http://<IP address of repository server>/mirror/repo.polyverse.io/deb/ubuntu/xenial/binary_amd64 main/
# xenial-updates
deb [trusted=yes] http://<IP address of repository server>/mirror/repo.polyverse.io/deb/ubuntu/xenial-updates/binary_amd64 main/
# xenial-security
deb [trusted=yes] http://<IP address of repository server>/mirror/repo.polyverse.io/deb/ubuntu/xenial-security/binary_amd64 main/

Now you should be ready to update, and replace packages.

curl https://repo.polyverse.io/cli | bash -s replace-installed-elf
Back to top

Uninstalling Polymorphing for Linux

Uninstalling Polyverse is a quick task. The high-level steps are as follows:

  1. Remove any references to the Polyverse scrambled binary repository from the system repository configuration files or folders
  2. Reinstall all packages so that they are downloaded from the remaining referenced repositories (which will not include Polyverse)

Remove the Polyverse Repository References

There is a script provided to automatically perform the removal of the Polyverse repository references. It can be executed using the following command:

curl -s https://repo.polyverse.io/cli | sh -s install --uninstall

Reinstall all packages

curl https://repo.polyverse.io/cli | bash -s replace-installed-elf

The configuration and uninstallation is complete at this point.

Back to top

Troubleshooting

Missing Packages

The package may not actually be available. Use this command to determine if the package is available for download from the repository.

apt search <package_name>

gconf2 depends on dbus-x11; however: Package dbus-x11 is not configured yet.

dpkg --configure -a
apt-get install -f

After running these commands, try running the re-installation command again.

curl https://repo.polyverse.io/cli | bash -s replace-installed-elf
Back to top

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.