Ubuntu Pastebin

Paste from MonkeyDust at Sun, 10 Jan 2016 10:52:23 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
echo "Checking for root"
sudo true
sudo echo "OK got root"
echo "You will see no output for up to 5 minutes. Please wait"

echo "  Removing the /var/lib/dpkg directory"
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup

echo "  Reverting to the previous package states"
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available

echo "  Removing the cached lists of packages"
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists

echo "  Remake directories that apt will not remake itsself"
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial

echo "  Removing cached .deb files in case any are corrupted"
sudo apt-get clean

echo "  Updating the list of available package versions"
sudo apt-get update >/dev/null

echo "  Removing dpkg's list of available packages"
sudo dpkg --clear-avail

echo "  Finishing configuring any packages which have yet to be configured."
sudo dpkg --configure -a

echo "  Installing any missing dependencies"
sudo apt-get install -fy >/dev/null

#sudo -k
echo "Done!"
echo
Download as text