顯示具有 install application 標籤的文章。 顯示所有文章
顯示具有 install application 標籤的文章。 顯示所有文章

2015年10月10日 星期六

更新 Ubuntu 12.04 LTS 的 Libreoffice

Ubuntu 12.04 LTS 預設安裝的版本為 LibreOffice 3;如果要更新 Ubuntu 12.04 LTS 中的 LibreOffice 版本可以參考下列指令:
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update  
sudo apt-get install libreoffice

到今天為止,當你執行完後,最新的版本為 LibreOffice 5。
[參考鏈結]




2015年10月9日 星期五

Ubuntu 與安裝軟體有關的指令

要在 Ubuntu 作業系統安裝軟體的基本步驟如下:
  1. 將某個軟體的網站加到軟體來源列表裡(/etc/apt/sources.list)
  2. 更新系統的軟體資料庫列表
  3. 安裝該軟體套件
軟體來源列表是一個文字檔案(/etc/apt/sources.list),我們可以透過下面指令來查看該檔案的內容。
   
   sudo gedit /etc/apt/sources.list

下面為該檔案的部分內容,# 號開頭的為檔案註解可以不理會它;deb 開頭表示是 debian 套件包 (Ubuntu 的底層核心是 debian);接下來可以看到一個網址列,這是告訴系統要到哪個網站裡去下載這個套件包;接下來可以看到 precise ,這個是代表版號,每個版本都有不同的代號,代號可以查看這裡。最後的 universe 代表是社群維護的套件庫。Ubuntu 有四個內定的套件庫如下表:
  
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ precise universe 

Ubuntu 四個內定的套件庫如下表:
名稱 套件庫說明
Main 主要套件庫,由 Ubuntu 所支援維護。
Restricted 私有版權的硬體驅動程式。
Universe 由社群所維護支援的套件庫。
Multiverse 非自由的軟體套件庫。這裡指的非自由並非是不合法的軟體,而是這些軟體並不符合自由軟體授權模式。

在 Ubuntu 中所謂加入第三方軟體庫,只是很簡單的打開 /etc/apt/sources.list 這個文字檔,然後把官網提供的網址附加到最後一行,儲存起來就搞定了。但是由於手動更動這個文字檔有相當大的風險存在,因此 9.10 版本之後有了一個更好用的指令:
   
   add-apt-repository

這個指令顧名思義的就是加入第三方來源庫的指令,主要避免使用 gedit 文字處理器來處理一行行的網址列,同時配合近來流行的 PPA (Personal Pacakge Archives),讓你可以很方便的下載各式各樣的應用軟體。
接下來我們來實際安裝 Ubuntu-tweak 軟體套件,基本上你沒有加入該套件到軟體來源列表,當透過下面指令安裝程式時會出現 E: Unable to locate package ubuntu-tweak 的訊息:
   
josh:~$ sudo apt-get install ubuntu-tweak
[sudo] password for josh: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ubuntu-tweak

如我們前面所提要在 Ubuntu 作業系統安裝軟體的基本三步驟 1.加入第三方來源、2.更新軟體資料庫、3.安裝軟體:
 
sudo add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

apt-get 的全名是 Advanced Package Tool-get,專業的套件包工具。update 是命令系統進行更新套件庫的動作。install 代表安裝,安裝甚麼呢,就是後面提供的套件名稱。

當我想知道套件庫裡有沒有一個套件叫做 scibus 的文書排版軟體,可以透過下面指令來查詢:
   
   apt-cache search scribus

上面的指令會在 apt 套件資料庫的快取裡,查詢名稱內容裡有 scribus 的套件並顯示出來。
安裝 scibus 套件:
   
   sudo apt-get install scribus

把它移除,但是保留設定檔:
   
   sudo apt-get remove scribus

把它移除,連設定檔也一併清除:
 
   sudo apt-get purge scribus
或  
   sudo apt-get remove --purge scribus

手動更新系統:
 
   sudo apt-get update
   sudo apt-get upgrade

注意:你可從網站下載附檔名為 deb 的安裝檔案,透過 deb 格式安裝的軟體並不會自動更新,也就是說假設安裝了 1.0 版本,但是現在有 1.1 版了,必須自行再次下載安裝;同時安裝 deb 格式時,有時候會遇到套件相依不足的問題,因此建議,若非必要,不要直接使用 deb 格式的檔案來進行應用程式安裝,而應該使用軟體中心或其他軟體來源庫的方式安裝。
[參考連結]

2015年10月8日 星期四

在 Ubuntu 12.04 LTS 上安裝 nautilus-gksu

Ubuntu 12.04 版本後 nautilus-gksu 套件,已經從 Ubuntu repositories 中移除了,要安裝必須把它重新加入,請參考下面方式加入及安裝 nautilus-gksu。

sudo apt-add-repository ppa:upubuntu-com/ppa
sudo apt-get update
sudo apt-get install nautilus-gksu

用下面指令或是登出系統在登入以重新啟動 nautilus,點選目錄右鍵後就可以在選單中看到 "Open as administrator" (以系統管理員身分開啟)選項。

nautilus -q

[Reference]

2015年9月23日 星期三

如何升級升級/降級 Ubuntu 12.04 的 Firefox 以及安裝 Chrome

你可以透過 apt-cache show firefox | grep Version 指令來查詢目前 Ubuntu 所提供的套件版本資訊。在執行前請先執行 sudo apt-get update 指令以確保得到是最新資訊。執行後應該會顯示如下的訊息:
linux$ apt-cache show firefox | grep Version
Version: 41.0+build3-0ubuntu0.12.04.1
Version: 11.0+build1-0ubuntu4

更新 firefox 只需要下達如下指令即可,如果有新的版本可用便會開始安裝新版本。
sudo apt-get update
sudo apt-get install firefox

更新完後新版本如果有問題,如何將 firefox 安裝成以前的版本呢?

1. 到 https://launchpad.net/ubuntu/precise/+source/firefox 下載你要的版本。
這邊我們下載 firefox version 31.0 64 bit https://launchpad.net/~ubuntu-mozilla-security/+archive/ubuntu/ppa/+build/6185582/+files/firefox_31.0%2Bbuild1-0ubuntu0.12.04.1_amd64.deb

2. 解除安裝 firefox
sudo apt-get purge firefox


3. 安裝在第一步驟所下載的 firefox 套件。
sudo dpkg -i firefox_31.0+build1-0ubuntu0.12.04.1_amd64.deb

萬一在你下在 firefox 舊套件前你就把你的 firefox 移除的話,你可以透過 wget 來下載套件,然後在執行安裝即可。
wget https://launchpad.net/~ubuntu-mozilla-security/+archive/ubuntu/ppa/+build/6185582/+files/firefox_31.0%2Bbuild1-0ubuntu0.12.04.1_amd64.deb

如何安裝 Chrome,到 https://www.google.com.tw/chrome/browser/desktop/ 網頁按"下載"按鈕後;選擇你的 Linux 平台後按 "接受並安裝" 按鈕後;點選 "Open with" 然後選擇 "Ubuntu Software center" 如下圖所示:

等Ubuntu Software center開啟後按 install 按鈕即可以安裝 Chrome;如下圖所示:

[參考鏈結]

2015年9月21日 星期一

如何更新 Ubuntu 12.04 上的 gcc 與 g++

當安裝好 Ubuntu 12.04 其預設安裝的 gcc 與 g++ 版本為 4.6 你可以透過 g++ --version 來查詢你系統上的版本:
linux:~$ g++ --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

更新步驟可依序執行下列指令即可:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5

為了讓 update-alternatives 知道我們系統上有 2 套 gcc 與 g++ 編譯器,我們必須為每套 gcc 與 g++ 建立安裝紀錄;然後再透過 config 來設定系統所要載入的版本,設定方法如下:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 40 --slave /usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --config gcc

當你執行 sudo update-alternatives --config gcc 會看到如下的選單畫面,而在此畫面我選擇了 2:
linux:~$ sudo update-alternatives --config gcc
There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/gcc-4.6   60        auto mode
  1            /usr/bin/gcc-4.6   60        manual mode
  2            /usr/bin/gcc-5     40        manual mode

Press enter to keep the current choice[*], or type selection number: 2       
update-alternatives: using /usr/bin/gcc-5 to provide /usr/bin/gcc (gcc) in manual mode.

完成上面設定後執行 g++ --version 你應該可以看到如下面的訊息:
linux:~$ g++ --version
g++ (Ubuntu 5.1.0-0ubuntu11~12.04.2) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


[參考連結]