Skip to content

Instantly share code, notes, and snippets.

@tonejito
Last active March 9, 2018 06:18
Show Gist options
  • Save tonejito/540ace6adeb3c01880375689801200f9 to your computer and use it in GitHub Desktop.
Save tonejito/540ace6adeb3c01880375689801200f9 to your computer and use it in GitHub Desktop.
First aid script for @Debian APT
#!/bin/bash -vx
# = ^ . ^ =
# https://gist.github.com/tonejito/540ace6adeb3c01880375689801200f9
# Clean all the old repo data
aptitude clean && find /var/lib/apt/lists/ -type f -print0 | xargs -0 rm
# Update repository data and check for system updates
aptitude update | egrep -v '://' && \
aptitude --simulate --show-why --download-only --assume-yes safe-upgrade
# Download deb packages before upgrading
aptitude --download-only --assume-yes safe-upgrade | grep -v '://'
# Show dependencies and perform the safe-upgrade and
aptitude --show-why --assume-yes safe-upgrade
# Remove old deb packages
aptitude autoclean && aptitude clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment