顯示具有 Linux設定檔 標籤的文章。 顯示所有文章
顯示具有 Linux設定檔 標籤的文章。 顯示所有文章

2015年5月6日 星期三

Ubuntu 網卡設定DHCP


  1. sudo  vim /etc/network/interfaces
  2. iface eth0 inet static 改成 iface eth0 inetdhcp
  3. sudo /etc/init.d/networking restart
VirtualBox就重開機一下吧。
PS. 如果你有第二張網卡 





auto eth1
iface eth1 inetdhcp


PS. 如果想用固定IP
#Class C 設法
iface eth0 inet static 
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1


資料來源:
  • http://askubuntu.com/questions/446183/how-to-set-up-nat-and-host-only-networking-with-static-ip-address-in-virtualbox

2012年3月8日 星期四

apt主機設定檔 ect/apt/source.list

//編輯 source.list
#sudo vi /etc/apt/source.list

//內容
# deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)]/ dists/oneiric/main/binary-i386/

# deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)]/ oneiric main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu oneiric main restricted
deb-src http://archive.ubuntu.com/ubuntu oneiric main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu oneiric-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu oneiric-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://archive.ubuntu.com/ubuntu oneiric universe
deb-src http://archive.ubuntu.com/ubuntu oneiric universe
deb http://archive.ubuntu.com/ubuntu oneiric-updates universe
deb-src http://archive.ubuntu.com/ubuntu oneiric-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu oneiric multiverse
deb-src http://archive.ubuntu.com/ubuntu oneiric multiverse
deb http://archive.ubuntu.com/ubuntu oneiric-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu oneiric-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu oneiric-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu oneiric-backports main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu oneiric-security main restricted
deb-src http://archive.ubuntu.com/ubuntu oneiric-security main restricted
deb http://archive.ubuntu.com/ubuntu oneiric-security universe
deb-src http://archive.ubuntu.com/ubuntu oneiric-security universe
deb http://archive.ubuntu.com/ubuntu oneiric-security multiverse
deb-src http://archive.ubuntu.com/ubuntu oneiric-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu oneiric partner
deb-src http://archive.canonical.com/ubuntu oneiric partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu oneiric main
deb-src http://extras.ubuntu.com/ubuntu oneiric main
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner

2012年3月7日 星期三

Ubuntu Server apt proxy設定

Step1.
  #sudo vi /etc/apt/apt.conf


//若vi不能顯示中文時,將其環境先改成英文顯示

  #LANG=en_US 



Step2.
vi中按下i進入編輯模式,輸入:


Acquire::http::proxy "http://[proxy address]:[prot number]";
Acquire::https::proxy "https://[proxy address]:[prot number]";
Acquire::ftp::proxy "ftp://[proxy address]:[prot number]";


 vi中按下Esc回到一般模式,打入:w!儲存檔案


如此apt指令才能更新




參考:
鳥哥http://linux.vbird.org/linux_server/0450apt.php



2012年3月3日 星期六

關於Linux 環境變數 profile

  • /etc/profile:全體使用者都會套用的環境變數(只有管理者可修改)。
  • ~/.bashrc:個體用戶的環境變數,若此處有與/etc/profile相同選項設定,將會蓋過設定,bashrc是隱藏檔,須使用ls -a即可看見。

參考與引用資料:
http://kalug.linux.org.tw/~lloyd/LLoyd_Hand_Book/book/bash-edit-profile.html

http://alex.obm.tw/cn/forum/%E9%97%9C%E6%96%BCubuntu9.04%E9%96%8B%E6%A9%9F%E6%AA%94%E6%A1%88rc.local%E3%80%81/etc/bash.bashrc%E3%80%81/bashrc-/etc/profile-/.profile