Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Brute Update Ubuntu Mint Linux APT (Run as root, copy and paste into terminal)
#!/bin/bash
#
# Updated 2018-02-20
# If "apt" not exist try "apt-get", because older versions not support "apt"
#
# Preparation, solve problems
sudo w ; \
sudo killall -9 dpkg ; \
#
sudo echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4 ; \
sudo apt-get clean ; \
sudo rm -rf /var/lib/apt/lists/* ; \
sudo apt-get clean ; \
apt --fix-broken --fix-missing -y -f install ; \
#
sudo apt-get install -y apt-transport-https -y ; \
sudo apt-get install linux-image-flavour ; \
sudo apt-get install linux-image-generic ; \
sudo add-apt-repository -y ppa:kernel-ppa/pre-proposed ; \
sudo add-apt-repository -y ppa:kernel-ppa/ppa ; \
#
sudo apt install aptitude -y ; \
sudo apt install aptitude-doc-en aptitude-doc-en tasksel -y ; \
sudo apt install update-manager-core -y ; \
sudo apt-get install snapd snapd-xdg-open -y ; \
#
sudo touch /etc/update-manager/release-upgrades ; \
sudo sed -i 's|Prompt=lts|Prompt=normal|g' /etc/update-manager/release-upgrades ; \
sudo sed -i 's/Prompt=never/Prompt=normal/g' /etc/update-manager/release-upgrades ; \
#
# If "apt" not exist try "apt-get", because older versions not support "apt"
sudo apt install -f -y; \
sudo dpkg --configure -a ; \
sudo apt clean -y ; \
sudo apt autoremove -y ; \
sudo apt update --ignore-missing ; \
sudo apt upgrade -y --ignore-missing ; \
# Important to fix broken install
sudo apt upgrade --fix-missing -y ; \
sudo apt-get dist-upgrade --ignore-missing -y ; \
sudo apt upgrade --fix-missing --ignore-missing -y ; \
sudo apt full-upgrade -y --ignore-missing ; \
sudo apt autoremove -y ; \
sudo apt install -f -y ; \
sudo dpkg --configure -a ; \
sudo do-release-upgrade -p -y ; \
sudo do-release-upgrade -d -y ; \
sudo do-release-upgrade -d -y ; \
sudo apt-get --allow-unauthenticated upgrade -y; #Very Important command
sudo apt-get dist-upgrade -y ; \
sudo do-release-upgrade -y ; \
sudo do-release-upgrade -d -y ; \
#
# Dist Upgrade
sudo apt-get dist-upgrade -y ; \
#
# Updates de Segurança
sudo apt-get install unattended-upgrades -y ;
sudo unattended-upgrades -y ; \
sudo unattended-upgrades -d -y ; \
#
# sudo aptitude update; \
sudo aptitude update -y ; sudo aptitude install -y; sudo aptitude safe-upgrade -y; sudo aptitude full-upgrade -y ; \
#
# Extra, Important too:
# https://gist.github.com/wellington1993/44def31e824d0b7a45fe14609738e696
# https://gist.github.com/wellington1993/63b2490a89559e8c78e505e6a4bc3039
#
# Solve virtualbox modprobe problem
# Kernel driver not installed (rc=-1908)
# where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908)
# modprobe vboxdrv
sudo apt install -y --reinstall virtualbox-dkms virtualbox\* ; \
sudo modprobe vboxdrv ; \
sudo modprobe vboxnetflt ; \
#Snapd Update
sudo apt install pulseaudio -y ; \
sudo apt install snapd -y ; \
sudo snap refresh ; \
sudo snap refresh --edge ; \
#
# Update Python packages
sudo pip install --upgrade pip ; \
sudo -H pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 sudo -H pip install -U ; \
sudo -H pip2 freeze — local | grep -v ‘^\-e’ | cut -d = -f 1 | xargs -n1 sudo -H pip2 install -U ; \
# Update npm
sudo npm i -g npm ; \
#
#From:
# Me...
# Internet and
# https://askubuntu.com/questions/124999/distribution-upgrade-problem-no-new-release-found
# http://www.edivaldobrito.com.br/atualizar-para-o-ubuntu-16-10-via-terminal/
# https://github.com/Security-Onion-Solutions/security-onion/wiki/Upgrading-from-12.04-to-14.04
# https://gist.github.com/mikedamm/1cbe711878f2b776d2ab
# http://www.click4infos.com/upgrade-to-ubuntu-via-terminal/
# https://gist.github.com/wellington1993/4d5ad0b3aa941dc43006f58c12574ce4
# https://gist.github.com/hotsoft-desenv2/28600e9b2e778bf242a9316bc9dc8b80
# http://www.tecmint.com/upgrade-ubuntu-14-04-to-16-04/
# https://askubuntu.com/questions/194/how-can-i-install-just-security-updates-from-the-command-line
# https://repogen.simplylinux.ch/generate.php
# https://askubuntu.com/questions/5763/upgrading-from-the-command-line
# https://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip
# http://mikegrouchy.com/blog/2014/06/pro-tip-pip-upgrade-all-python-packages.html
# https://codeyarns.com/2015/07/08/how-to-upgrade-all-installed-pip-packages/
# https://hackernoon.com/a-pip-hack-to-upgrade-all-your-python-packages-492658c49681
@wellington1993

This comment has been minimized.

Copy link
Owner Author

@wellington1993 wellington1993 commented Oct 16, 2017

To use: As root -> Copy and paste in Terminal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.