sudo apt-get install manpages-posix-dev
想要在ubuntu里面安装manpages-posix-dev这个包,发现弹出错误
E: Unable to locate package manpages-posix-dev
解决方法如下:
1 查看当前ubuntu的版本
abhishek@itsfoss:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
上面的脚本显示版本代码为bionic
2 去ubuntu包查询网址看看你的版本是否真的有这个包
https://packages.ubuntu.com/?ref=itsfoss.com
例如我的版本代号为jammy,查看到确实包含了这个包,但是可以看到后缀有个multiverse的标志
3 执行添加multiverse的库
sudo add-apt-repository universe multiverse
4 更新库
sudo apt update
5 再次安装想要的库manpages-posix-dev,成功
sudo apt-get install manpages-posix-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
manpages-posix
The following NEW packages will be installed:
manpages-posix manpages-posix-dev
0 upgraded, 2 newly installed, 0 to remove and 283 not upgraded.
Need to get 2,718 kB of archives.
After this operation, 3,298 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.aliyun.com/ubuntu jammy/multiverse amd64 manpages-posix all 2017a-2 [932 kB]
Get:2 http://mirrors.aliyun.com/ubuntu jammy/multiverse amd64 manpages-posix-dev all 2017a-2 [1,786 kB]
Fetched 2,718 kB in 2s (1,737 kB/s)
Selecting previously unselected package manpages-posix.
(Reading database ... 240738 files and directories currently installed.)
Preparing to unpack .../manpages-posix_2017a-2_all.deb ...
Unpacking manpages-posix (2017a-2) ...
Selecting previously unselected package manpages-posix-dev.
Preparing to unpack .../manpages-posix-dev_2017a-2_all.deb ...
Unpacking manpages-posix-dev (2017a-2) ...
Setting up manpages-posix (2017a-2) ...
Setting up manpages-posix-dev (2017a-2) ...
Processing triggers for man-db (2.10.2-1) ...
参考:
[Solved] "E: Unable to locate package" Error on Ubuntu (itsfoss.com)