diff --git a/media/css/download.css b/media/css/download.css
new file mode 100644
index 0000000..5de8c1b
--- /dev/null
+++ b/media/css/download.css
@@ -0,0 +1,13 @@
+/*
+  PostgreSQL.org - Additional styles used on some download pages
+*/
+
+#scriptdiv {
+  position: relative;
+}
+
+#scriptcopy {
+  position: absolute;
+  top: 8px;
+  right: 8px;
+}
\ No newline at end of file
diff --git a/media/js/downloads.js b/media/js/downloads.js
new file mode 100644
index 0000000..5f66ca2
--- /dev/null
+++ b/media/js/downloads.js
@@ -0,0 +1,31 @@
+function copyScript() {
+    var scriptbox = document.getElementById('scriptbox')
+    var scriptcopy = document.getElementById('scriptcopy')
+
+    // for Internet Explorer
+
+    if(document.body.createTextRange) {
+        // IE 11
+        var range = document.body.createTextRange();
+        range.moveToElementText(scriptbox);
+        range.select();
+        document.execCommand("Copy");
+        document.getSelection().removeAllRanges()
+    }
+    else if(window.getSelection) {
+        // Sane browsers
+        var selection = window.getSelection();
+        var range = document.createRange();
+        range.selectNodeContents(scriptbox);
+        selection.removeAllRanges();
+        selection.addRange(range);
+        document.execCommand("Copy");
+        selection.removeAllRanges();
+    }
+
+    scriptcopy.innerHTML = 'Copied!'
+
+    setTimeout(function() {
+        scriptcopy.innerHTML = 'Copy Script'
+    }, 3000);
+}
\ No newline at end of file
diff --git a/templates/downloads/js/yum.js b/templates/downloads/js/yum.js
index 74b5702..b02736f 100644
--- a/templates/downloads/js/yum.js
+++ b/templates/downloads/js/yum.js
@@ -119,13 +119,11 @@ function archChanged() {
    var ver = document.getElementById('version').value;
    var plat = document.getElementById('platform').value;
    var arch = document.getElementById('arch').value;
+   var scriptbox = document.getElementById('scriptbox')
 
    if (!plat || plat == -1) {
-      document.getElementById('reporpm').innerHTML = 'Select version and platform above';
-      document.getElementById('clientpackage').innerHTML = 'Select version and platform above';
-      document.getElementById('serverpackage').innerHTML = 'Select version and platform above';
-      document.getElementById('initdb').innerHTML = 'Select version and platform above';
-      document.getElementById('dnfmodule').style.display = 'none';
+      document.getElementById('scriptcopy').style.display = 'none';
+      scriptbox.innerHTML = 'Select version and platform above';
       return;
    }
 
@@ -135,21 +133,31 @@ function archChanged() {
    var url = 'https://download.postgresql.org/pub/repos/yum/reporpms/' + plat + '-' + arch + '/pgdg-' + get_rpm_prefix(plat) +'-repo-latest.noarch.rpm';
 
    var installer = get_installer(plat);
-   document.getElementById('reporpm').innerHTML = installer + ' install ' + url;
-   document.getElementById('clientpackage').innerHTML = installer + ' install postgresql' + shortver;
-   document.getElementById('serverpackage').innerHTML = installer + ' install postgresql' + shortver + '-server';
+   scriptbox.innerHTML = '# Install the repository RPM:\n';
+   scriptbox.innerHTML += installer + ' install ' + url + '\n\n';
 
-   document.getElementById('dnfmodule').style.display = disable_module_on(plat) ? 'list-item' : 'none';
+   scriptbox.innerHTML += '# Install client tools:\n';
+   scriptbox.innerHTML += installer + ' install postgresql' + shortver + '\n\n';
 
+   scriptbox.innerHTML += '# Optionally install the database server:\n';
+   scriptbox.innerHTML += installer + ' install postgresql' + shortver + '-server\n\n';
+
+   if (disable_module_on(plat)) {
+      scriptbox.innerHTML += '# Disable the built-in PostgreSQL module:\n';
+      scriptbox.innerHTML += 'dnf -qy module disable postgresql\n\n';
+   }
+
+   scriptbox.innerHTML += '# Optionally initialize the database and enable automatic start:\n';
    if (uses_systemd(plat)) {
        var setupcmd = 'postgresql-' + shortver + '-setup';
        if (ver < 10) {
-	   setupcmd = 'postgresql' + shortver + '-setup';
+	       setupcmd = 'postgresql' + shortver + '-setup';
        }
-
-       document.getElementById('initdb').innerHTML = '/usr/pgsql-' + ver + '/bin/' + setupcmd + ' initdb<br/>systemctl enable postgresql-' + ver + '<br/>systemctl start postgresql-' + ver;
+       scriptbox.innerHTML += '/usr/pgsql-' + ver + '/bin/' + setupcmd + ' initdb\nsystemctl enable postgresql-' + ver + '\nsystemctl start postgresql-' + ver;
    }
    else {
-       document.getElementById('initdb').innerHTML = 'service postgresql-' + ver + ' initdb<br/>chkconfig postgresql-' + ver + ' on<br/>service postgresql-' + ver + ' start';
+       scriptbox.innerHTML += 'service postgresql-' + ver + ' initdb\nchkconfig postgresql-' + ver + ' on\nservice postgresql-' + ver + ' start';
    }
+
+   document.getElementById('scriptcopy').style.display = 'block';
 }
diff --git a/templates/pages/download/linux/debian.html b/templates/pages/download/linux/debian.html
index 0944edb..20b38f5 100644
--- a/templates/pages/download/linux/debian.html
+++ b/templates/pages/download/linux/debian.html
@@ -1,5 +1,9 @@
 {%extends "base/page.html"%}
 {%block title%}Linux downloads (Debian){%endblock%}
+{%block extrahead%}
+<link href="/media/css/download.css?{{gitrev}}" rel="stylesheet">
+<script type="text/javascript" src="/media/js/downloads.js?{{gitrev}}"></script>
+{%endblock%}
 {%block contents%}
 
 <h1>Linux downloads (Debian) <img class="logo" src="/media/img/debian.svg" alt="Debian Logo" /></h1>
@@ -41,30 +45,19 @@ versions of Debian:
 <p>
 To use the apt repository, follow these steps:
 </p>
-<ol>
- <li>
-  <select id="debseries" name="field.series" class="custom-select">
-   <option selected="selected" value="YOUR_DEBIAN_VERSION_HERE">Choose your Debian version</option>
-   <option value="buster">Buster (10.x)</option>
-   <option value="stretch">Stretch (9.x)</option>
-   <option value="jessie">Jessie (8.x)</option>
-   <option value="bullseye">Bullseye (11.x, testing)</option>
-   <option value="sid">Sid (unstable)</option>
-  </select>
- </li>
- <li>
-   Create the file <var>/etc/apt/sources.list.d/pgdg.list</var>, and add a line
- for the repository:
-   <pre class="code">
-     deb http://apt.postgresql.org/pub/repos/apt/ <span id="series-deb">YOUR_DEBIAN_VERSION_HERE</span>-pgdg main</pre>
- </li>
- <li>
-   Import the repository signing key, and update the package lists:
-   <pre class="code">
-     wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
-     sudo apt-get update</pre>
- </li>
-</ol>
+
+<div id="scriptdiv">
+    <pre id="scriptbox" class="code"># Create the file repository configuration:
+sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+
+# Import the repository signing key:
+wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
+
+# Update the package lists:
+sudo apt-get update</pre>
+    <button id="scriptcopy" onclick="copyScript()">Copy Script</button>
+</div>
+
 <p>
 For more information about the apt repository, including answers to frequent
 questions, please see the apt page on
diff --git a/templates/pages/download/linux/redhat.html b/templates/pages/download/linux/redhat.html
index bc309d6..1dd2027 100644
--- a/templates/pages/download/linux/redhat.html
+++ b/templates/pages/download/linux/redhat.html
@@ -1,6 +1,8 @@
 {%extends "base/page.html"%}
 {%block title%}Linux downloads (Red Hat family){%endblock%}
 {%block extrahead%}
+<link href="/media/css/download.css?{{gitrev}}" rel="stylesheet">
+<script type="text/javascript" src="/media/js/downloads.js?{{gitrev}}"></script>
 <script type="text/javascript" src="/download/js/yum.js?{{gitrev}}"></script>
 {%endblock%}
 {%block contents%}
@@ -59,20 +61,11 @@ To use the PostgreSQL Yum Repository, follow these steps:
   <li>Select version: <select id="version" class="custom-select" onChange="verChanged()"></select><br/></li>
   <li>Select platform: <select id="platform" class="custom-select" onChange="platChanged()"></select></li>
   <li>Select architecture: <select id="arch" class="custom-select" onChange="archChanged()"></select></li>
-  <li>Install the repository RPM:
-    <pre id="reporpm" class="code"></pre>
-  </li>
-  <li id="dnfmodule">Disable the built-in PostgreSQL module
-    <pre class="code">dnf -qy module disable postgresql</pre>
-  </li>
-  <li>Install the client packages:
-    <pre id="clientpackage" class="code"></pre>
-  </li>
-  <li>Optionally install the server packages:
-    <pre id="serverpackage" class="code"></pre>
-  </li>
-  <li>Optionally initialize the database and enable automatic start:
-      <pre id="initdb" class="code"></pre>
+  <li>Copy, paste and run the relevant parts of the setup script:
+    <div id="scriptdiv">
+        <pre id="scriptbox" class="code"></pre>
+        <button id="scriptcopy" onclick="copyScript()">Copy Script</button>
+    </div>
   </li>
 </ol>
 
diff --git a/templates/pages/download/linux/ubuntu.html b/templates/pages/download/linux/ubuntu.html
index 5675e81..56f4398 100644
--- a/templates/pages/download/linux/ubuntu.html
+++ b/templates/pages/download/linux/ubuntu.html
@@ -1,5 +1,9 @@
 {%extends "base/page.html"%}
 {%block title%}Linux downloads (Ubuntu){%endblock%}
+{%block extrahead%}
+<link href="/media/css/download.css?{{gitrev}}" rel="stylesheet">
+<script type="text/javascript" src="/media/js/downloads.js?{{gitrev}}"></script>
+{%endblock%}
 {%block contents%}
 
 <h1>Linux downloads (Ubuntu) <img class="logo" src="/media/img/ubuntu.svg" alt="Ubuntu Logo" /></h1>
@@ -40,25 +44,19 @@ by using the closest LTS version available.
 <p>
 To use the apt repository, follow these steps:
 </p>
-<ul>
-  <li>
-    <select id="debseries" name="field.series" class="custom-select">
-      <option selected="selected" value="YOUR_UBUNTU_VERSION_HERE">Choose your Ubuntu version</option>
-      <option value="focal">Focal (20.04)</option>
-      <option value="bionic">Bionic (18.04)</option>
-      <option value="xenial">Xenial (16.04)</option>
-    </select>
- </li>
-  <li>Create the file <code>/etc/apt/sources.list.d/pgdg.list</code> and add a line
-    for the repository
-    <pre class="code">deb http://apt.postgresql.org/pub/repos/apt/ <span id="series-deb">YOUR_UBUNTU_VERSION_HERE</span>-pgdg main</pre>
- </li>
-  <li>
-    Import the repository signing key, and update the package lists
-    <pre class="code">wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
+
+<div id="scriptdiv">
+    <pre id="scriptbox" class="code"># Create the file repository configuration:
+sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+
+# Import the repository signing key:
+wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
+
+# Update the package lists:
 sudo apt-get update</pre>
-  </li>
-</ul>
+    <button id="scriptcopy" onclick="copyScript()">Copy Script</button>
+</div>
+
 <p>
 For more information about the apt repository, including answers to frequent
 questions, please see the <a href="https://wiki.postgresql.org/wiki/Apt" target="_blank">PostgreSQL Apt Repository</a> page on
