https://www.notion.so/APT-GET-dbecaa1ed4944d26844b2d1c3342d15d
1
2
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vim /etc/apt/sources.list
Remove sources.list content using below instead.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
1
2
3
sudo apt-get update
sudo apt-get -f install
sudo apt-get -y upgrade
Use aptitude instead of apt-get
1
sudo apt-get install aptitude
aptitude issues
1
W: Unable to read /etc/apt/preferences.d/ - DirectoryExists (2: No such file or directory)
To fix
1
mkdir /etc/apt/preferences.d
1
E: The method driver /usr/lib/apt/methods/https could not be found.
To fix
1
2
sudo wget http://archive.ubuntu.com/ubuntu/pool/universe/a/apt/apt-transport-https_1.6.1_all.debb
sudo dpkg -i apt-transport-https_1.6.1_all.deb