Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 424e93f

Browse files
committed
Remove unsupported/unused commands for apt
We don't use these two apt commands and we shouldn't have to run them manually, so remove them. `upgrade()` is potentially bad because it can create disparity between machines or environments. We automatically upgrade Ubuntu packages with security updates using `unattended-upgrades` and we should use Puppet to upgrade the packages we manage by setting `ensure` to `latest` where appropriate. `dist_upgrade()` is potentially bad for the same reasons, but also because it may remove packages. There's no need for us to run it manually.
1 parent ea9ced4 commit 424e93f

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

apt.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,6 @@ def security_updates():
1313
run("/usr/local/bin/govuk_check_security_upgrades --human-readable")
1414

1515

16-
@task
17-
def upgrade():
18-
"""Upgrade packages with apt-get"""
19-
sudo("apt-get update; apt-get upgrade -y")
20-
21-
22-
@task
23-
def dist_upgrade():
24-
"""Perform non-interactive dist-upgrade using apt-get"""
25-
prompt('dist-upgrade is a dangerous operation, can remove packages and generally break all the things. Are you sure you want to proceed? (y/n)', validate=r'^[Yy]$')
26-
sudo("apt-get -q update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\" -yuq dist-upgrade")
27-
28-
2916
@task
3017
def unattended_upgrade():
3118
"""Perform an unattended-upgrade"""

0 commit comments

Comments
 (0)