One - One Code All

Blog Content

Ubuntu系统如何搜索要安装的软件包

Linux-Mac   2011-11-25 22:58:01

在CentOS中使用yum search + 软件包的名字就可以搜索。

在Ubuntu系统中使用apt-get的search命令,发现根本不存在。

Ubuntu里面的命令是

    查找软件包

apt-cache search 软件包名

    显示软件包的详细信息

apt-cache show 软件包名

举个例子

我们以PostgreSQL为例

apt-cache search PostgreSQL

会显示出一堆列表,然后我们找到要下载的软件。

我们查看一下该软件的详细信息

apt-cache show postgresql-9.5

版本过低,满足不了要求咋办?

更新ubuntu源
(该源是postgresql的源。 这里只介绍方法,对应的源文件请自行搜索)

添加源列表

    创建文件/etc/apt/sources.list.d/pgdg.list,并为存储库添加一行

sudo vim /etc/apt/sources.list.d/pgdg.list

    在将下面的内容添加进文件

deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main

    导入存储库签名密钥

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
  sudo apt-key add -

    更新软件包列表

sudo apt-get update

我们可以再次使用apt-get search命令来搜索软件包。选择下载。


上一篇:ubuntu安装/查看已安装包的方法
下一篇:python的numpy库中将矩阵转换为列表等函数

The minute you think of giving up, think of the reason why you held on so long.