ubuntu安裝備忘錄

來源:互聯網
上載者:User

ubuntu安裝備忘錄

一、升級和回退核心

1. 安裝ubuntu

android開發環境建議使用穩定的核心版本,建議安裝ubuntu12.04

2. 升級核心版本

由於ubuntu12.04很容易出現卡死現象,建議升級核心到kernel 3.5

使用如下命令升級即可:

apt-get install linux-generic-lts-quantal xserver-xorg-lts-quantal

3. 回退核心版本

如果在升級核心過程中,不小心升級到了不穩定的高版本核心,可以將不需要的刪除

a. 查看已經安裝的核心版本

dpkg --get-selections | grep linux-image

b. 刪除不想要的核心

sudo apt-get remove "不想要的核心版本"

 

二、安裝無線網卡驅動

1. 查看無線網卡型號,確定使用的驅動版本

2. 根據不同的核心版本安裝不同的wifi驅動

3.2核心安裝:http://download.csdn.net/detail/wlwl0071986/8811945

3.5核心安裝:http://download.csdn.net/detail/wlwl0071986/8811919

3. 編譯驅動源碼,安裝驅動

make,make install,insmod 8188.ko

 

三、ubuntu下安裝搜狗IME

1. 添加源

sudo add-apt-repository ppa:fcitx-team/nightly

2. 更新源

sudo apt-get update

3. 安裝fcitx

sudo apt-get install fcitx

4. 安裝fcitx的組態工具

sudo apt-get install fcitx-config-gtk

5. 安裝fcitx的table-all軟體包

sudo apt-get install fcitx-table-all

6. 安裝im-switch切換工具

sudo apt-get install im-switch

7. 在左上方的搜尋欄中輸入“fcitx”,會出現IME表徵圖,此時安裝完成

8. 在系統設定裡面,將系統語言設定為“漢語-拼音”

 

四、在ubuntu12.04中安裝gcc4.4

1. ubuntu12.04預設安裝的事gcc4.6,需要我們手動安裝gcc4.4

sudo apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib

2. 設定gcc4.4為預設編譯器

update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 50
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50

3. 查看gcc版本,檢查是否安裝成功

gcc -v

 

五、安裝adb工具

1. 通過apt-get安裝adb

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb

2. 拷貝系統編譯出來的adb工具進行安裝

cp ~/android/out/host/linux-x86/bin/adb /usr/local/bin

3. 將android裝置串連至電腦,通過lsusb查看usb裝置

Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 002: ID 03f0:094a Hewlett-Packard
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
4. 建立adb_usb.ini檔案,寫入id

sudo echo 0x1f3a > ~/.android/adb_usb.ini

5. 添加許可權

sudo vim /etc/udev/rules.d/70-android.rules

加入以下內容,注意紅色部分對應的就是lsusb得到的id

SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="1002",MODE="0666"

6. 重啟usb服務

sudo chmod a+rx /etc/udev/rules.d/70-android.rules

sudo service udev restart

7. 重啟adb服務

adb kill-server

sudo adb start-server

adb devices

 

六、ubuntu12.04相關問題解決

1. 解決txt文本亂碼的問題

gsettings set org.gnome.gedit.preferences.encodings auto-detected "['UTF-

8','GB18030','GB2312','GBK','BIG5','CURRENT','UTF-16']"

2. 用apt-get安裝軟體包時異常報錯

E: Sub-process /usr/bin/dpkg returned an error code (1)

解決方案:

sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old //現將info檔案夾更名

sudo mkdir /var/lib/dpkg/info //再建立一個新的info檔案夾

sudo apt-get update

sudo apt-get -f install

sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old //執行完上一步操作後會在新的info檔案夾下產生一些檔案,現將

這些檔案全部移到info_old檔案夾下

sudo rm -rf /var/lib/dpkg/info //把自己建立的info檔案夾刪掉

sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info //把以前的info檔案夾重新改回名字

 

3. VirtualBox出現Kernel driver not installed (rc=-1908)

a. 將目前使用者加入vboxusers使用者組

sudo usermod -G vboxusers -a andee

b. 安裝如下組件

sudo apt-get install linux-headers-`uname -r`

sudo apt-get install virtualbox-dkms

sudo dpkg-reconfigure virtualbox-dkms)

c. 載入

ll /dev/ | grep vboxdrv

sudo modprobe vboxdrv

d. 重新安裝和啟動vboxdrv

sudo /etc/init.d/vboxdrv setup

VirtualBox

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.