1. 如何用命令行判斷系統是gnome,kde還是unity?
eliefly@thinkpad-s5:/etc$ update-alternatives --display x-session-manager
x-session-manager - 自動模式
link best version is /usr/bin/gnome-session
鏈接目前指向 /usr/bin/gnome-session
link x-session-manager is /usr/bin/x-session-manager
slave x-session-manager.1.gz is /usr/share/man/man1/x-session-manager.1.gz
/usr/bin/gnome-session - 優先級 50
次要 x-session-manager.1.gz:/usr/share/man/man1/gnome-session.1.gz
2.firefox卸載安裝
把firefox完全卸載掉重裝:
查看安裝的firefox版本:
dpkg --get-selections |grep firefox
根據命令結果卸載重裝
比如:
$ dpkg --get-selections | grep firefox
firefox install
firefox-locale-en install
firefox-locale-en install
unity-scope-firefoxbookmarks install
卸載
sudo apt-get purge firefox firefox-locale-en firefox-locale-en unity-scope-firefoxbookmarks
安裝
sudo apt-get install firefox firefox-locale-en firefox-locale-en unity-scope-firefoxbookmarks
重裝
sudo apt-get --reinstall install firefox firefox-locale-en firefox-locale-en unity-scope-firefoxbookmarks
3.后綴deb文件的安裝
dpgk -i <filename>
[1]. 目前WPS for Linux公式顯示需要相應的Symbol字體(比如symbol, windings, mt extra等), 由於版權原因,WPS for Linux未對此類字體打包安裝,如果您需要,請在授權的情況下使用此類字體
4.fcitx框架下谷歌輸入法的安裝
在這篇教程中,我將告訴你如何在ubuntu系統上安裝谷歌拼音輸入法。谷歌拼音輸入法有基於ibus框架的,也有基於fcitx框架的。我只演示fcitx框架下谷歌拼音輸入法的安裝,因為ibus框架的谷歌拼音已經不會更新了。
打開終端輸入下面的命令
sudo apt-get install fcitx fcitx-googlepinyin im-config
然后在終端中輸入下面的命令打開輸入法配置
im-config
點擊OK按鈕,再點擊Yes按鈕,將fcitx設為默認的輸入法框架,最后點擊OK。
然后重啟系統。在桌面右上角你會發現ibus的En圖標不見了,fcitx的鍵盤圖標會出現。
點擊fcitx的鍵盤圖標,選擇text entry settings
在打開的窗口中點擊+號
然后在文本框中輸入pinyin查找谷歌拼音輸入法,將其添加到輸入法列表中。如果查找不到,重啟系統后再試一次。
接下來你就能使用谷歌拼音輸入法了。
5.修改grub引導順序
1、打開編輯grub配置文件
sudo vim /etc/default/grub
找到:GRUB_DEFAULT = 0 位置,把最后的0修改為自己的菜單id(比如上文Vista的啟動序號為4),然后保存即可。
2、更新Grub引導
sudo update-grub
執行上述命令后,會自動更新/boot/grub/grub.cfg文件,下次啟動即生效。
6.在ubuntu下安裝sublime
直接下載安裝在 /usr/local/bin/sublime_text_3/sublime_text 下。
為了能在終端直接使用sublime打開文件,添加軟鏈接:
sudo ln -s /usr/local/bin/sublime_text_3/sublime_text ./sublime
7.ubuntu下的python指令指向python3.5(默認是指向python2.7)
/usr/bin目錄下
sudo ln -sf ./python3.5 ./python
8.安裝網易雲的deb包出現包依賴問題
eliefly@thinkpad-s5:/usr/local/src$ sudo dpkg -i netease-cloud-music_1.0.0_amd64_ubuntu16.04.deb
sudo: 無法解析主機:thinkpad-s5
正在選中未選擇的軟件包 netease-cloud-music。
(正在讀取數據庫 ... 系統當前共安裝有 213679 個文件和目錄。)
正准備解包 netease-cloud-music_1.0.0_amd64_ubuntu16.04.deb ...
正在解包 netease-cloud-music (1.0.0) ...
dpkg: 依賴關系問題使得 netease-cloud-music 的配置工作不能繼續:
netease-cloud-music 依賴於 libqt5x11extras5 (>= 5.1.0);然而:
未安裝軟件包 libqt5x11extras5。
netease-cloud-music 依賴於 gstreamer1.0-plugins-bad;然而:
未安裝軟件包 gstreamer1.0-plugins-bad。
netease-cloud-music 依賴於 gstreamer1.0-plugins-ugly;然而:
未安裝軟件包 gstreamer1.0-plugins-ugly。
netease-cloud-music 依賴於 libqt5multimedia5-plugins;然而:
未安裝軟件包 libqt5multimedia5-plugins。
netease-cloud-music 依賴於 libqt5multimediawidgets5;然而:
未安裝軟件包 libqt5multimediawidgets5。
netease-cloud-music 依賴於 libqt5libqgtk2;然而:
未安裝軟件包 libqt5libqgtk2。
dpkg: 處理軟件包 netease-cloud-music (--install)時出錯:
依賴關系問題 - 仍未被配置
正在處理用於 hicolor-icon-theme (0.15-0ubuntu1) 的觸發器 ...
正在處理用於 gnome-menus (3.13.3-6ubuntu3) 的觸發器 ...
正在處理用於 desktop-file-utils (0.22-1ubuntu5) 的觸發器 ...
正在處理用於 bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) 的觸發器 ...
Rebuilding /usr/share/applications/bamf-2.index...
正在處理用於 mime-support (3.59ubuntu1) 的觸發器 ...
在處理時有錯誤發生:
執行sudo apt-get install -f
-f, --fix-broken
Fix; attempt to correct a system with broken dependencies in place.
This option, when used with install/remove, can omit any packages
to permit APT to deduce a likely solution. If packages are
specified, these have to completely correct the problem. The option
is sometimes necessary when running APT for the first time; APT
itself does not allow broken package dependencies to exist on a
system. It is possible that a system's dependency structure can be
so corrupt as to require manual intervention (which usually means
using dpkg --remove to eliminate some of the offending packages).
Use of this option together with -m may produce an error in some
situations. Configuration Item: APT::Get::Fix-Broken.
再次執行sudo dpkg -i netease-cloud-music_1.0.0_amd64_ubuntu16.04.deb
就可安裝
eliefly@thinkpad-s5:/usr/local/src$ sudo dpkg -i netease-cloud-music_1.0.0_amd64_ubuntu16.04.deb
sudo: 無法解析主機:thinkpad-s5
[sudo] eliefly 的密碼:
(正在讀取數據庫 ... 系統當前共安裝有 214758 個文件和目錄。)
正准備解包 netease-cloud-music_1.0.0_amd64_ubuntu16.04.deb ...
正在將 netease-cloud-music (1.0.0) 解包到 (1.0.0) 上 ...
正在設置 netease-cloud-music (1.0.0) ...
正在處理用於 hicolor-icon-theme (0.15-0ubuntu1) 的觸發器 ...
正在處理用於 gnome-menus (3.13.3-6ubuntu3) 的觸發器 ...
正在處理用於 desktop-file-utils (0.22-1ubuntu5) 的觸發器 ...
正在處理用於 bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) 的觸發器 ...
Rebuilding /usr/share/applications/bamf-2.index...
正在處理用於 mime-support (3.59ubuntu1) 的觸發器 ...
eliefly@thinkpad-s5:/usr/local/src$ whereis netease-cloud-music
netease-cloud-music: /usr/bin/netease-cloud-music /usr/lib/netease-cloud-music
9.安裝新立得
新立得是Ubuntu的包管理工具 apt, 的圖形化前端。
$ sudo apt-get install synaptic
...過程省略...
$ whereis synaptic
synaptic: /usr/sbin/synaptic /usr/share/synaptic /usr/share/man/man8/synaptic.8.gz
ubuntu16.04為firefox添加pepperflash插件
在新立得軟件管理器中搜索pepperflash,找到兩個包,安裝它們即可
10.ubuntu下截圖工具
安裝ksnapshot
$ sudo apt-get install ksnapshot
錯誤:
在處理時有錯誤發生:
python-pip
python-pkg-resources
python-setuptools
python-wheel
E: Sub-process /usr/bin/dpkg returned an error code (1)
問題原因:可能是python指向python3.5導致,改會python2.7裝了個有道詞典沒有出錯。
11.ubuntu16.04下安裝 youdao-dict_1.1.0-0~ubuntu_amd64.deb
Depends: python3, python3-pyqt5, python3-requests, python3-xlib, tesseract-ocr, tesseract-ocr-eng, tesseract-ocr-chi-sim, tesseract-ocr-chi-tra, python3-pil, ttf-wqy-microhei, python3-lxml, python3-xdg, python3-pyqt5.qtmultimedia, python3-pyqt5.qtquick, python3-pyqt5.qtwebkit, gir1.2-appindicator3-0.1, python3-dbus, qtdeclarative5-controls-plugin, libqt5multimedia5-plugins
因為官方的deb包(Ubuntu版本的)依賴gstreamer0.10-plugins-ugly,但是該軟件在16.04里面已經沒有了。但其實沒有該包,完全不影響有道詞典的使用。所以我們可以去掉deb包里面對於該庫的依賴。具體操作如下:
1. 從官方下載Ubuntu版本的deb包:youdao-dict_1.1.0-0-ubuntu_amd64.deb
2. 創建youdao-dict目錄,把該deb包解壓到youdao-dict目錄:
$ dpkg -X ./youdao-dict_1.1.0-0-ubuntu_amd64.deb youdao-dict
3. 解壓deb包中的control信息(包的依賴就寫在這個文件里面):
$ dpkg -e ./youdao-dict_1.1.0-0-ubuntu_amd64.deb youdao-dict/DEBIAN
4. 編輯control文件,刪除Depends里面的gstreamer0.10-plugins-ugly。
5. 重新打包:
$ dpkg-deb -b youdao youdaobuild.deb
6. 安裝重新打包的安裝包
$ dpkg -i youdaobuild.deb
12.重裝軟件
sudo apt-get --reinstall install [softname]