问题:在安装库的时候,报错
$ sudo apt-get install qpdf
[sudo] jie 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
E: 无法定位软件包 qpdf
解决方法:
原因是镜像源有问题,没有这个软件,需要换个镜像源
换镜像源的方法:
这里提供 Ubuntu 22.04 的阿里云镜像源列表。若为其他版本,将所有jammy更改为其他版本代号即可。
常用的Ubuntu版本代号如下:
Ubuntu 22.04:jammy
Ubuntu 20.04:focal
Ubuntu 18.04:bionic
Ubuntu 16.04:xenia
vim /etc/apt/source.list
将文件内容清空,然后复制下方代码粘贴,wq保存退出即可。
注意:一定要注意ubuntu的版本,我的是22.04,版本代码为jammy,下面提供的也就是22.04的阿里云的镜像源,如果是其他版本的ubuntu系统,一定要修改jammy为自己的版本号。具体版本号见上面一小节常用的Ubuntu版本代号。(将下面的jammy换为对应单词即可,比如20.04换为focal,每一行都换)
deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
# deb https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multivers
然后必须更新镜像源
sudo apt update
下面再运行安装qpdf命令就安装成功了.