Last active
March 1, 2022 23:26
-
-
Save kevinadhiguna/fed9705a604896b851d3c55e761dbecf to your computer and use it in GitHub Desktop.
Update script for Debian-based Linux distribution
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
# Update OS | |
# '-y' automatically choose 'Yes' on interactive mode (when being asked to whether install/remove a package) | |
# Updates the package lists that need upgrading, as well as new packages that have just come to the repositories | |
#sudo apt update -y | |
# Force update using IPv4 : | |
sudo apt -o Acquire::ForceIPv4=true -y | |
# List all upgradable packages | |
apt list --upgradable | |
#sudo apt upgrade -y | |
# Force upgrade in IPv4 : | |
#sudo apt -o Acquire::ForceIPv4=true upgrade -y | |
#------------------- | |
# WARNING | |
#------------------ | |
# | |
# 'apt upgrade' is unsafe on rolling release distributions. | |
# using 'apt full-upgrade' instead | |
# use 'apt upgrade --force' to override | |
# | |
# Performs the function of upgrade but may also remove installed packages if that is required in order to resolve a package conflict | |
#sudo apt full-upgrade -y | |
# Force full-upgrade in IPv4 : | |
sudo apt -o Acquire::ForceIPv4=true full-upgrade -y | |
# Removes packages that were automatically installed to satisfy dependencies for some package and that are no longer needed | |
sudo apt autoremove -y | |
# Clears out the local repository of retrieved package files. This only removes package files that can no longer be downloaded, and are largely useless. | |
sudo apt autoclean | |
#------------ | |
# References | |
#------------ | |
# | |
# 1. https://askubuntu.com/a/222352 | |
# 2. https://askubuntu.com/a/3169 | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment