歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux管理 >> Linux維護 >> 新手學堂:APT的安裝配置與使用詳細介紹

新手學堂:APT的安裝配置與使用詳細介紹

日期:2017/3/2 10:39:04   编辑:Linux維護

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 © Linux教程網 All Rights Reserved