“Windows ++ VirtualBox Ubuntu” 問題與解決筆記【持續更新】
系統版本 Ubuntu 16.04 LTS

一、Virtual Box 相關問題
1. virtualbox+ubuntu設置共享文件夾
http://www.cnblogs.com/huanghuang/archive/2011/09/23/2185968.html
http://www.linuxidc.com/Linux/2014-02/96713.htm
手動掛載共享文件夾:
mkdir share_windows
sudo mount -t vboxsf myshare share_windows
cd share_windows
ls
在Home目錄下就可以看到共享文件夾了
卸載命令為:
sudo umount -f share_windows
2. VitualBox 出現 "FATAL:?could not read from the boot medium" 問題
https://zhidao.baidu.com/question/234582301.html
二、Ubuntu 相關問題
1. su 認證失敗
解決方法:sudo passwd root (更新密碼),然后再su root(輸入新密碼)
退出root權限:
① exit
② logout
③ ctrl D
2. Ubuntu apt-get 卸載命令
3.?Linux(Ubuntu)下如何安裝JDK
http://www.cnblogs.com/savagemorgan/p/3650926.html
① tar.gz 文件的解壓命令:
sudo tar zxvf xxx.tar.gz
② bin 文件的解壓安裝命令:
sudo chmod u+x a.bin //此行給文件執行權限
sudo ./a.bin
③ deb文件的安裝命令:
dpkg -i file.deb
④ 如果Eclipse 找不到 JDK 的路徑
在eclipse目錄下新建jre目錄,并連接jdk下的jre/bin目錄到該目錄下。
mkdir jre
cd jre
ln -s 你的JDK目錄/bin bin
4.?ubuntu常用命令
mv:移動文件或文件夾
http://jingyan.baidu.com/article/0aa22375b8d9bf88cc0d643f.html
rm: 刪除文件或文件夾
http://jingyan.baidu.com/article/3f16e003cb810f2591c10339.html
5. ~/.bashrc 的編輯
我還是習慣用 gedit ~/.bashrc,雖然很多人推崇vi / vim
6.?Permission denied
chmod 777
如果想連其所有子目錄都一起修改:
chmod -R 777
https://zhidao.baidu.com/question/506645291.html
或者得到root 權限
【$NDK/build 有時也會遇到這個問題,如果以上修改權限后還不行,嘗試手動刪除obj目錄】
7. Unable to lock the administration directory (/var/lib/dpkg/)
sudo rm /var/lib/apt/lists/lock
或?sudo rm /var/cache/apt/archives/lock
http://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process
8.?ubuntu上安裝ffmpeg
http://thierry-xing.iteye.com/blog/2017864
△ 帶x264庫的安裝
http://blog.csdn.net/season_hangzhou/article/details/24399371
△ 帶fdk-aac庫的安裝
① http://blog.csdn.net/vblittleboy/article/details/25223699
其中亂碼的代碼如下:
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
cd fdk-aac
autoreconf -fiv
//./configure --disable-shared // 禁用shared的情況
./configure --enable-shared // 啟用shared的情況
make && make install
ldconfig /usr/local/lib
./configure --enable-libfdk_aac --enable-nonfree --enable-libmp3lame
/configure --prefix=/usr/local/ffmpeg --enable-shared --enable-yasm --enable-libx264 --enable-gpl --enable-pthreads --enable-libfdk-aac --enable-nonfree --enable-pic --enable-libmp3lame --extra-cflags=-I/usr/local/x264/include --extra-ldflags=-L/usr/local/x264/lib
②?http://www.cnblogs.com/lixiaodi/p/4702535.html
③ 如果以上兩個庫都是通過包管理器下載安裝的話,那configure 就可以簡化為
./configure --enable-shared --enable-libfaac --enable-libx264 --enable-gpl --enable-nonfree --enable-pic
附上:
ffmpeg 的 configure選項 對照表
9. Ubuntu 安裝 OpenCV
http://blog.csdn.net/junmuzi/article/details/49888123
10. OpenCV 安裝遇到 “libavcodec.a make fails - recompile with -fPIC”
完整錯誤信息:/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet' can not be used when making a shared object; recompile with -fPIC
需要重新configure 并 make ffmpeg
sudo CFLAGS="-fPIC" ./configure --enable-nonfree --enable-pic --enable-shared
make clean
make
make install
11. apt 的 搜索命令
sudo apt-cache search xxx
12. Ubuntu 下 打不開 Android SDK Manager
進入sdk目錄下的tools,用 ./android 運行即可
13. Ubuntu 下 NDK的安裝
http://blog.csdn.net/telencool/article/details/47057065
14. 修改系統環境變量的方法(以添加NDK的路徑為例):
修改系統環境變量
sudo gedit /etc/profile
export ANDROID_NDK= ndk路徑
export PATH=$ANDROID_NDK:$PATH
source /etc/profile
15.?git錯誤:fatal: Not a git repository (or any of the parent directories): .git
提示說沒有.git這樣一個目錄,git init就可以了
16. Android/NDK編譯 x264、fdk-aac、FFmpeg
網上雖然很多,但我根據自己情況篩選的比較靠譜的三篇文章
http://blog.chinaunix.net/uid-26000296-id-5213411.html
http://blog.chinaunix.net/uid-26000296-id-5213410.html
http://www.itnose.net/detail/6219672.html
最后是我自己將它們整理之后,親測有效的腳本
http://blog.csdn.net/panda1234lee/article/details/53099203
17. 中文輸入法的切換
http://jingyan.baidu.com/article/adc815134f4b92f722bf7350.html
18. Dos2Unix命令
http://codingstandards.iteye.com/blog/810900
轉換整個文件夾:
cd 到想轉換的目錄下,然后輸入以下命令
$ find . -type f -exec dos2unix {} \;
Ubuntu Windows
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。