Last active
March 9, 2018 06:18
-
-
Save tonejito/540ace6adeb3c01880375689801200f9 to your computer and use it in GitHub Desktop.
First aid script for @Debian APT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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