網頁

顯示具有 Ubuntu 標籤的文章。 顯示所有文章
顯示具有 Ubuntu 標籤的文章。 顯示所有文章

2013年7月6日

Install Nodejs on Ubuntu


sudo apt-get update
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

It installs current stable Node on the current stable Ubuntu. Quantal (12.10) users may need to install the software-properties-commonpackage for the add-apt-repository command to work: sudo apt-get install software-properties-common

As of Node.js v0.10.0, the nodejs package from Chris Lea's repo includes both npm and nodejs-dev.

There is a naming conflict with the node package (Amateur Packet Radio Node Program), and the nodejs binary has been renamed fromnode to nodejs. You'll need to symlink /usr/bin/node to /usr/bin/nodejs or you could uninstall the Amateur Packet Radio Node Program to avoid that conflict.

2013年6月6日

Ubuntu 系统 Update-rc.d 命令

原文:Ubuntu 系统 Update-rc.d 命令

Ubuntu或者Debian系统中update-rc.d命令,是用来更新系统启动项的脚本。这些脚本的链接位于/etc/rcN.d/目录,对应脚本位于/etc/init.d/目录。在了解update-rc.d命令之前,你需要知道的是有关Linux 系统主要启动步骤,以及Ubuntu中运行级别的知识。

Linux 系统主要启动步骤

  1. 读取 MBR 的信息,启动 Boot Manager。
  2. 加载系统内核,启动 init 进程, init 进程是 Linux 的根进程,所有的系统进程都是它的子进程。
  3. init 进程读取 /etc/inittab 文件中的信息,并进入预设的运行级别。通常情况下 /etc/rcS.d/ 目录下的启动脚本首先被执行,然后是/etc/rcN.d/ 目录。
  4. 根据 /etc/rcS.d/ 文件夹中对应的脚本启动 Xwindow 服务器 xorg,Xwindow 为 Linux 下的图形用户界面系统。
  5. 启动登录管理器,等待用户登录。

2013年3月25日

解決Ubuntu下無法更新套件清單或安裝套件的問題 ?

在Ubuntu下使用apt-get的時候,常常會發生無法更新套件清單或安裝套件的問題,原因在於本地端機器無法順利連上Ubuntu伺服器去更新或下載資料。

因此,最簡單解決的方式就是替換掉Ubuntu伺服器位址了。

步驟如下:

1. 備份 sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2. 打開 sources.list
sudo vi /etc/apt/sources.list

3. 變更成美國的伺服器,在 vi 介面裡,用下面指令把  tw 換成 us
:1,$s/tw/us/g

4. 儲存  source.list
:wq!

5.更新套件清單
sudo apt-get update

完成上面的步驟之後,再重新安裝軟體就應該可以了。

參考資料: Ubuntu 如何解決 apt-get 無法更新套件清單或安裝套件的問題 ?

Ububtu Apt 工具的快速參考

Origin: Apt和dpkg快速參考

apt-cache search # ------(package 搜索包)
apt-cache show #------(package 獲取包的相關信息,如說明、大小、版本等)
apt-get install # ------(package 安裝包)
apt-get install # -----(package - - reinstall 重新安裝包)
apt-get -f install # -----(強制安裝?#"-f = --fix-missing"當是修復安裝吧...)
apt-get remove #-----(package 刪除包)
apt-get remove - - purge # ------(package 刪除包,包括刪除配置文件等)
apt-get autoremove --purge # ----(package 刪除包及其依賴的軟體包+配置文件等(只對6.10有效,強烈推薦))
apt-get update #------更新源
apt-get upgrade #------更新已安裝的包
apt-get dist-upgrade # ---------升級系統
apt-get dselect-upgrade #------使用 dselect 升級
apt-cache depends #-------(package 了解使用依賴)
apt-cache rdepends # ------(package 了解某個具體的依賴?#當是查看該包被哪些包依賴吧...)
apt-get build-dep # ------(package 安裝相關的編譯環境)
apt-get source #------(package 下載該包的源代碼)
apt-get clean && apt-get autoclean # --------清理下載文件的存檔 && 只清理過時的包
apt-get check #-------檢查是否有損壞的依賴

apt-get install

下載 以及所有倚賴的包裹,同時進行包裹的安裝或升級。如果某個包裹被設置了 hold (停止標誌,就會被擱在一邊(即不會被升級)。更多 hold 細節請看下面。

apt-get remove [--purge]

移除 以及任何倚賴這個包裹的其它包裹。
--purge 指明這個包裹應該被完全清除 (purged) ,更多信息請看 dpkg -P。

apt-get update

升級來自 Debian 鏡像的包裹列表,如果你想安裝當天的任何軟體,至少每天運行一次,而且每次修改了
/etc/apt/sources.list 后,必須執行。

apt-get upgrade [-u]

升級所以已經安裝的包裹為最新可用版本。不會安裝新的或移除老的包裹。如果一個包改變了倚賴關係而需要安裝一個新的包裹,那麼它將不會被升級,而是標誌為 hold。apt-get update 不會升級被標誌為 hold 的包裹 (這個也就是 hold 的意思)。請看下文如何手動設置包裹為 hold。我建議同時使用 '-u' 選項,因為這樣你就能看到哪些包裹將會被升級。

apt-get dist-upgrade [-u]

和 apt-get upgrade 類似,除了 dist-upgrade 會安裝和移除包裹來滿足倚賴關係。因此具有一定的危險性。

apt-cache search

搜索滿足 的包裹和描述。

apt-cache show

顯示 的完整的描述。

apt-cache showpkg

顯示 許多細節,以及和其它包裹的關係。

dpkg -L <package_name>

使用 apt-get install 之後,不知道軟體裝到哪些地方去?來試試這個。