linux之ubuntu学习005——软件安装/aptitude(续)

刚在linuxcast.net上看了一个linux基础入门视频——RPM软件包管理,在Ubuntu上一边看视频一边实践,看了一半的时候觉得坑爹了,视频里讲的RPM软件包是基于Red Hat的,而Ubuntu是属于Debian系。但还是将视频看完,心安理得。之后google一下关于Ubuntu下“安装软件程序”的资料,发现了很多有用的东东。在此记录下来,总结一下。

在Ubuntu上安装软件,第一次是使用了apt-get 这个命令,到今天为止还是一直使用这个工具命令来安装所需的软件。

刚刚google了一下,发觉自己又长见识了。

原来基于Debian系统,dpkg命令是基于Debian系PMS工具的核心,这个PMS包含了三个强大的工具:

● apt-get 这个刚刚说了,本人一直使用的就是这个命令。

● apt-cache

● aptitude

其中命令行工具aptitude是最常用的(这个别人的博客这样说的),先了解一下aptitude工具。

aptitude工具本质上是apt工具和dpkg的前端。dpkg是一个软件管理工具,而aptitude是一个完整的软件包管理系统。——《linux命令行与shell脚本编程大全》提到的。

aptitude这个工具还可一解决一个在Linux上的一个难题,就是可以解决软件安装时的依赖关系(这个在linuxcast.net那个视频里提到的RPM工具也可以解决软件的依赖关系)。

为了实践这个命令行工具aptitude,专门安装了MySQL数据库。

具体的步骤如下:

$ aptitude search mysql

接着就看到了出来一大堆关于mysql的软件包(这里仅复制了一些出来):

i mysql-client – MySQL database client (metapackage depending on
v mysql
-client:i386 –
v mysql
-client-4.1
v mysql
-client-4.1:i386 –
i A mysql
-client-5.5 MySQL database client binaries
p mysql
-client-5.5:i386 – MySQL database client binaries
i A mysql
-client-core-5.5 MySQL database core client binaries
p mysql
-client-core-5.5:i386 – MySQL database core client binaries
i A mysql
-common – MySQL database common files, e.g. /etc/mysql/my
v mysql
-common:i386 –
v mysql
-common-4.1
v mysql
-common-4.1:i386 –
p mysql
-mmm-agent – Multi-Master Replication Manager for MySQL – ag
p mysql
-mmm-common – Multi-Master Replication Manager for MySQL – co
p mysql
-mmm-monitor – Multi-Master Replication Manager for MySQL – mo
p mysql
-mmm-tools – Multi-Master Replication Manager for MySQL – to
p mysql
-navigator – GUI client program for MySQL database server
p mysql
-navigator:i386 – GUI client program for MySQL database server
p mysql
-proxy – high availability, load balancing and query mod
p mysql
-proxy:i386 – high availability, load balancing and query mod
i mysql
-server – MySQL database server (metapackage depending on
i A mysql
-server-5.5 MySQL database server binaries and system datab
p mysql
-server-5.5:i386 – MySQL database server binaries and system datab
v mysql
-server-core –
v mysql
-server-core:i386 –
i A mysql
-server-core-5.5 – MySQL database server binaries

注意:首项i是代表已经安装了的软件包,p是没有安装的。这里可以看到我一经安装了mysql-server, mysql-client等等软件包!

刚刚是搜索mysql软件包,接着就是安装,这个安装的命令其实与apt-get没有什么大的差别,也是很简单滴一条命令:

aptitude install mysql-server mysql-client

如果不是使用root用户请在前面加上sudo~

这就完成了mysql的安装工作了。

而,aptitude的功能不仅如此,还有其他好玩的功能。

1、可以进入aptitude的全屏模式,查看软件包安装情况;

2、使用单命令模式查看软件包详细信息,eg:

aptitude show mysql-server

出来的结果如下,包括软件包名称,版本号,依赖关系,概述等等。

Package: mysql-server
State: installed
Automatically installed: no
Version:
5.5.29-0ubuntu0.12.04.2
Priority: optional
Section: database
Maintainer: Ubuntu Developers
<[email protected]>
Architecture: all
Uncompressed Size:
116 k
Depends: mysql
-server-5.5
Description: MySQL database server (metapackage depending on the latest version)
This is an empty package that depends on the current
best version of mysql-server
(currently mysql
-server-5.5), as determined by the MySQL maintainers. Install this
package
if in doubt about which MySQL version you need. That will install the version
recommended by the package maintainers.

MySQL is a fast, stable and true multi-user, multi-threaded SQL database server. SQL
(Structured Query Language) is the most popular database query language
in the world. The
main goals of MySQL are speed, robustness and ease of use.
Homepage: http:
//dev.mysql.com/

3、还有使用命令查找软件包,形式如下:

aptitude search package_name

4、使用aptitude更新软件,这里有三条命令可供选择:safe-upgrape/full-upgrape/dist-upgrape。使用apt-get命令也可以是apt-get update.

5、删除卸载软件。可以选用remove或者purge。

 

本文链接



You must enable javascript to see captcha here!

Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress

无觅相关文章插件,快速提升流量