报错 “E: Unable to locate package libjasper-dev”
解决方法
1. 首先运行如下命令
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
若运行成功,则跳至第 3 步
2. 若报错如下
1)首先尝试
①
sudo gedit /etc/apt/sources.list
在文件的最后加上以下代码
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb http://security.ubuntu.com/ubuntu xenial-security main
# deb-src http://security.ubuntu.com/ubuntu xenial-security main
② 再分别运行如下命令
sudo apt-get update
sudo apt install libjasper1 libjasper-dev
③ 若还是安装失败,则修改 Python 软链接
# 第一步,进入/usr/bin/文件夹
cd /usr/bin/
# 第二步,查看 Python 的所有软链接
ls -al python*
# 第三步,删除 Python3 的软链接
sudo rm /usr/bin/python3
# 可以再次查看 Python 的所有软链接,确定是否删除成功
ls -al python*
# 第四步,将 Python3 的软链接链接至 Python3.6
sudo ln -s /usr/bin/python3.6 /usr/bin/python3
# 可以再次查看是否链接成功
ls -al python*
若链接成功,则分别运行如下命令
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
3. 运行如下命令
sudo apt update
sudo apt install libjasper1 libjasper-dev