新手学堂:APT的安装配置与使用详细介绍


1.下载apt

  http://ftp.freshrpms.net/pub/freshrpms/

  2.安装

  rpm -ivh apt*.rpm

  3.Freshrpms.net 的GPG签名

  GPG签名是用来验证软件包的完整性和安全性, 对于系统安全比较重要,在使用Freshrpms.net 的软件包时,需要把站上的GPG签名导入;

  http://freshrpms.net/RPM-GPG-KEY-freshrpms 导入方法:

  [root@localhost beinan]# rpm ——import http://freshrpms.net/RPM-GPG-KEY-freshrpms

  4.apt的源文件在 /etc/apt/sources.list

  放开相应版本的url

  5.升级

  安装和配置好apt的第一步是执行 apt-get update ,目的是来从apt源中取回软件包的列表;也就是我们上面说的那个sources.list提到的源

  6.安装、升级、移除软件包的用法

  a)软件包的安装;

  [root@localhost beinan]# apt-get install 软件包名称

  注:不要加版本号,软件名就好;

  比如我们想安装或者升级firefox ,就可以直接用 apt-get install firefox ;

  b)移除软件包;

  [root@localhost beinan]# apt-get remove 软件包名

  举例:

  [root@localhost beinan]# apt-get remove firefox

  c)对系统全面升级;

  [root@localhost beinan]# apt-get upgrade

  [root@localhost beinan]# apt-get dist-upgrade

  这两个功能差不多;

  d)常用的参数选项;

  [root@localhost beinan]# apt-get install -y 软件包名

  比如:

  [root@localhost beinan]# apt-get install -y gaim

  注:如果意外中断的包下载和安装,可以用-y参数来继续下载安装,如上面gaim我下载到10%,可以用上面的命令接着来下载安装或者升级;

  [root@localhost beinan]# apt-get install -d 软件包名

  比如:

  [root@localhost beinan]# apt-get install -d

  注:只是下载软件包,不解包,也不安装,下载到本地机的目录为 /var/cache/apt/archives

  3]清理apt-get 后下载下来的包和未完成的包;

  [root@localhost beinan]# apt-get clean

  通过apt-get下载下来的包存放在 /var/cache/apt/archives目录中;有时我们中断一些正在apt-get 的包,这样的包没有完全下载下来;我们也可以清理掉;也可以用继续接着下载安装,也可以清理掉;

  这样apt-get clean 就会删除 已经下载完成的位于/var/cache/apt/archives目录的所有包;也会清理掉下载未完成的包位于/var/cache/apt/archives/partial/

  这个功能还是比较有用的,因为apt-get 下载和安装量极大,要定期清理。

本文作者:
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3