Mục lục

[Tổng hợp] Lệnh cài đặt phần mềm trên Linux/Ubuntu

Chào các bạn, hôm nay mình sẽ hướng dẫn 1 số lệnh cơ bản để cài 1 số phần mềm trên Linux:
  1. Cách cài đặt bộ gõ tiếng Việt:
    IBus – Unikey:
    - dùng lệnh: sudo apt-get install ibus-unikey
    - kích hoạt bộ gõ: im-switch -s ibus
    - hoặc: Vào trình đơn System → Administration → Language Support , Ở phần Keyboard input method system (Hệ thống phương thức nhập) chọn ibus.
  2. Cài đặt Graphic Driver: sudo apt-get install mesa-utils:- Hoặc (sửa lỗi chụp màn hình bị đen):
    sudo add-apt-repository ppa:xorg-edgers/ppa
    sudo apt-get update && sudo apt-get upgrade
    - Vào System setting và Install update

  3. Sửa lỗi không hiển thị hộp thoại khi ấn PrintScreen trên LinuxMint:- Vào SystemSeting → Keyboard → Keyboard shortcuts → Custom shortcuts → Thêm Keyboard shortcuts với thông số sau:
    - Name: Screenshot
    - Command: gnome-screenshot –interactive
    - Lưu lại và chụp thử.

  4. Cài Flash cho trình duyệt:sudo apt-get install flashplugin-installer

  5. Cài đặt Ubuntu-Tweak:
    sudo add-apt-repository ppa:tualatrix/ppa
    sudo apt-get update && sudo apt-get install ubuntu-tweak


  6. Mở thư mục có thể copy và xóa như Windows: gksudo nautilus

  7. Sửa lỗi không giảm độ sáng màn hình được:- Run this command: gksu gedit /etc/default/grub
    - Change the line GRUB_CMDLINE_LINUX="" into GRUB_CMDLINE_LINUX="acpi_osi=Linux".
    - Save the file and quit the text editor.
    - Then run: sudo update-grub
    - Restart.

  8. Sửa lỗi Touchpad không hoạt động:- gsettings set org.gnome.settings-daemon.peripherals.touchpad touchpad-enabled 'true'
    - hoặc:
    sudo gedit /etc/init.d/touchpad
    paste code:
    #!/bin/bash
    gsettings set org.gnome.settings-daemon.peripherals.touchpad touchpad-enabled 'true'

    + Lưu lại
    sudo chmod +x /etc/init.d/touchpad
    sudo update-rc.d touchpad defaults


  9. Cài đặt FileZilla:sudo add-apt-repository ppa:n-muench/programs-ppa
    sudo apt-get update && sudo apt-get install filezilla


  10. Quay phim màn hình:sudo apt-get install ffmpeg
    ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq output.mpg


    - Hoặc vào Ubuntu Software Center tìm cài đặt Kazam

  11. Thêm biểu tượng trên Desktop:sudo apt-get install --no-install-recommends gnome-panel
    gnome-desktop-item-edit --create-new ~/Desktop

    - Chọn từ /usr/bin...

  12. Cài đặt Java:sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update && sudo apt-get install oracle-java7-installer


  13. Dùng Smile của Yahoo trong Pidgin:- Tải gói smile về máy
    - Giải nén file attach và chép vào thư mục “/usr/share/pixmaps/pidgin/emotes/” rồi mở Pidgin lên
    - Vào Tools> Preference > Smiley Themes > Chọn theme có tên là tên thư mục vừa tạo.

  14. Cài đặt VirtualBox:sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian saucy contrib" >> /etc/apt/sources.list'
    wget -q http://download.virtualbox.org/virtu...racle_vbox.asc -O- | sudo apt-key add -
    sudo apt-get update %% sudo apt-get install virtualbox-4.3


    *Dùng USB trong VirtualBox:sudo adduser username vboxusers

  15. VirtualBox lỗi Kernel driver not installed (rc=-1908):sudo apt-get update && sudo apt-get install dkms
    sudo /etc/init.d/vboxdrv setup


  16. Cài đặt phần mềm chỉnh sửa thời gian khởi động Ubuntu:sudo add-apt-repository ppa:danielrichter2007/grub-customizer
    sudo apt-get update && sudo apt-get install grub-customizer


  17. Clean System:sudo apt-get autoclean
    sudo apt-get clean
    sudo apt-get autoremove
    sudo apt-get install gtkorphan


  18. Chạy Applet trên Firefox:- Gỡ bỏ Java plugin trên Firefox
    - Thoát trình duyệt
    - Chạy lệnh: ln -s /usr/lib/java/jdk1.7.0_15/jre/lib/i386/libnpjp2.so

  19. Nâng cấp LibreOffice:- Thêm vào SoftwareSource: deb http://ppa.launchpad.net/libreoffice...ice-4-1/ubuntu raring main
    - sudo add-apt-repository ppa:libreoffice/libreoffice-4-0
    - Trên bản LTS: sudo add-apt-repository ppa:libreoffice/ppa
    sudo apt-get update && sudo apt-get -y dist-upgrade
    * Xem thêm:https://launchpad.net/~libreoffice/ archive/ppa
    http://askubuntu.com/questions/252612/how-do-i-install-libreoffice-4
    - sudo apt-get update && sudo apt-get dist-upgrade

  20. Cài đặt FF Multiple File Converter:sudo add-apt-repository ppa:ffmulticonverter/stable
    sudo apt-get update && sudo apt-get install ffmulticonverter


  21. Cài đặt GIMP:sudo add-apt-repository ppa:eek:tto-kesselgulasch/gimp
    sudo apt-get update && sudo apt-get install gimp


  22. Download Manager:http://flareget.com/download/
    hoặc cài đặt phần mềm XDMAN giống như IDM

  23.  Upgrade Firefox:
    sudo add-apt-repository ppa:ubuntu-mozilla-security/ppa
    sudo apt-get update && sudo apt-get dist-upgrade


  24. Cài đặt phần mềm DVD/CD ảo:sudo add-apt-repository ppa:cdemu/ppa
    sudo apt-get update && sudo apt-get install gcdemu cdemu-client


  25. Phần mềm cắt, ghép file PDF: PDFSAMsudo apt-get install pdfsam

  26. Phần mềm tải và chuyển đổi định dạng YouTube:sudo add-apt-repository ppa:clipgrab-team/ppa
    sudo apt-get update && sudo apt-get install clipgrab


  27. Thêm Menu vào chuột phải:sudo add-apt-repository ppa:nae-team/ppa
    sudo apt-get update
    sudo apt-get install nautilus-refresh (Thêm menu refresh)
    sudo apt-get install nautilus-open-terminal (Thêm menu Open in Terminal)
    nautilus -q


  28. Cài Font Microsoft:Vào Ubuntu Software Center gõ ttf-mscorefonts và install

  29. Hiện Menu Boot sau khi cài Windows sau Ubuntu:- Chạy LiveCD Ubuntu
    - gõ lệnh để xem tên ổ đĩa: sudo fdisk -l (phân vùng linux có tên là /dev/sda1)
    sudo mount /dev/sda1 /mnt
    sudo mount /dev/sda1 /mnt/boot

    sudo grub-install --boot-directory=/mnt/boot /dev/sda
    - Khởi động lại từ ổ cứng, lúc này sẽ boot từ ubuntu
    - Vào Ubuntu gõ tiếp lệnh: sudo update-grub để update boot menu.
    - Khởi động lại từ ổ đĩa và chọn OS

  30. Tạo USB Ghost với CloneZilla:Tải về tại: http://clonezilla.org/downloads.php
    Format USB về FAT32 (dung lượng yêu cầu: 200MB)
    Gõ lệnh sudo mkdir -p /media/usb; sudo mount /dev/sdb1 /media/usb/
    Giải nén và copy toàn bộ gói đã tải về vào thư mục /media/usb (hoặc dùng lệnh: unzip clonezilla.zip -d /media/usb/).
    Chạy tiếp lệnh: cd /media/usb/utils/linux
    Và cuối cùng: sudo bash makeboot.sh /dev/sdb1

  31. Tối ưu Pin Laptop:sudo add-apt-repository ppa:linrunner/tlp
    sudo apt-get update && sudo apt-get install tlp tlp-rdw
    sudo tlp start


  32. Phần mềm chụp ảnh màn hình chuyên nghiệp: Shutter
    sudo add-apt-repository ppa:shutter/ppa
    sudo apt-get update && sudo apt-get install shutter


  33. Link phần mềm tiện ích cho Linux: http://www.makeuseof.com/pages/best-linux-software

  34. Cài đặt LAMPP trên Linux: (máy chủ PHP)+ Cài đặt Apache
    sudo apt-get install apache2
    Vào http://localhost để kiểm tra kết quả, nếu không được thì chạy lệnh sudo service apache2 restart
    + Cài đặt PHP:
    sudo apt-get install php5 libapache2-mod-php5
    Khởi động lại apache: sudo service apache2 restart
    Để kiểm tra PHP bạn tạo một file info.php trong thư mục /var/www (đây là webroot mặc định của Apache): <?php phpinfo();?>
    + Cài đặt MySQL:
    sudo apt-get install mysql-server mysql-client
    Trong quá trình cài đặt hỏi mật khẩu thì phải nhập mật khẩu vào.
    + Cài đặt PHPMyAdmin:
    sudo add-apt-repository ppa:nijel/phpmyadmin
    sudo apt-get update && sudo apt-get install phpmyadmin

    Trong quá trình cài đặt, phần mềm hỏi chọn webserver thì chọn Apache2.
    Hỏi muốn cấu hình PHPMyAdmin thì chọn Yes, nhập mật khẩu MySQL vào.
    Khởi động lại Apache.
    + Kích hoạt module rewrite module:
    sudo a2enmod rewrite
    Khởi động lại Apache.
    + Cài đặt cURL:
    sudo apt-get install php5-curl
    Khởi động lại Apache.
    + Nếu không rewrite được sau khi cài đặt thì thực hiện:
    sudo gedit /etc/apache2/sites-available/default
    - Sửa AllowOverride None thành AllowOverride All
    + Đổi thư mục WebRoot mặc định của Apache:
    sudo gedit /etc/apache2/sites-available/default
    - sửa lại các chỗ /var/www/ thành thư mục mới, lưu lại rồi khởi động lại Apache
    + Sửa lỗi: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
    sudo gedit /etc/apache2/apache2.conf
    - Thêm ServerName localhost vào cuối tệp và lưu lại
    - Khởi động lại apache
    + Không cho apache chạy khi khởi động:
    sudo update-rc.d -f apache2 remove
    + Chạy apache khi khởi động:
    sudo update-rc.d apache2 defaults
    + PhpMyAdmin logout sau 24 phút:
    - Đổi tệp /usr/share/phpmyadmin/config.sample.inc.php thành /usr/share/phpmyadmin/config.inc.php
    - Thêm $cfg['LoginCookieValidity'] = 60 * 60 * 12; vào cuối tệp
    - Mở tệp: /etc/php5/apache2/php.ini và sửa giá trị của: session.gc_maxlifetime = 43200
    + Login PHPMyAdmin with NO PASSWORD:
    - Đổi mật khẩu MySQL thành null (No Password)
    service mysql stop
    mysqld_safe --skip-grant-tables &
    mysql -u root


    mysql> use mysql;
    mysql> update user set password=PASSWORD("YOUR-NEW-ROOT-PASSWORD") where User='root';
    mysql> flush privileges;
    mysql> quit

    service mysql stop
    service mysql start
    mysql -u root -p

    - Mở tệp: /etc/phpmyadmin/config.inc.php tìm dòng //$cfg['Servers'][$i]['AllowNoPassword'] = TRUE; bỏ 2 dấu // đi

    + Bỏ hiển thị trang đăng nhập khi vào PHPMyAdmin:
    - Mở tệp: /etc/phpmyadmin/config.inc.php
    - Tìm dòng: $cfg['Servers'][$i]['auth_type'] = 'cookie';
    - Thay bằng:
    $cfg['Servers'][$i]['auth_type'] = 'config'; //Default is cookie
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '';
    $cfg['Servers'][$i]['nopassword'] = true; //Default is false
    $cfg['Servers'][$i]['AllowNoPassword'] = true; //Default is false

    + Lỗi Mcrypt không chạy:
    sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
    sudo php5enmod mcrypt
    sudo service apache2 restart


  35. Global Menu cho Netbeans:+ Trong netbeans: Vào menu Tools -> Plugins
    + Nhấp vào tab Setting, thêm 1 Update.
    + Gõ Name: Java Ayatana
    + Thêm URL: http://java-swing-ayatana.googlecode...ns-catalog.xml
    + Vào tab Available Plugins tab chọn Update Newest.
    + Tìm và cài đặt Java Ayatana
    + Khởi động lại Netbeans là xong.

  36. Chuyển thành giao diện Java Meta cho netbean:+ Mở tệp: /home/linux/netbeans-7.3.1/etc/netbeans.conf
    + Thay phần netbeans_default_options thành dòng dưới:
    netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:permSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd --laf Metal"

  37. Chỉnh định dạng ngày trên Panel Ubuntu: gsettings set com.canonical.indicator.datetime time-format custom && gsettings set com.canonical.indicator.datetime custom-time-format '%a %d/%m/%y, %H:%M'

  38. Remove 1 Repository:sudo add-apt-repository --remove ppa:eek:ndrej/php5

  39. Cài đặt Xtreme Download Manager:sudo add-apt-repository ppa:noobslab/apps
    sudo apt-get update
    sudo apt-get install xdman

    ---------------------------------
    Addon bắt link cho Firefox:
    Cài đặt file này từ trình duyệt: http://localhost:9614/xdmff.xpi
    Addon bắt link cho Chrome:
    Go to System Settings > Network > Network Proxy > Select Automatic in Method and paste http://localhost:9614/proxy.pac

  40. Cài đặt Eclipse mới nhất:+ Tải về từ trang chủ Eclipse.
    + Giải nén và move vào /opt/: sudo mv eclipse /opt/
    + Tạo file .desktop: sudo gedit /usr/share/applications/eclipse.desktop sau đó dán đoạn sau vào:
    [Desktop Entry]
    Name=Eclipse
    Type=Application
    Exec=/opt/eclipse/eclipse
    Terminal=false
    Icon=/opt/eclipse/icon.xpm
    Comment=Integrated Development Environment
    NoDisplay=false
    Categories=Development;IDE
    Name[en]=eclipse.desktop


    + Create a symlink in /usr/local/bin using:
    cd /usr/local/bin
    sudo ln -s /opt/eclipse/eclipse

    + Chạy eclipse: /opt/eclipse/eclipse -clean &
    * Nếu lỗi Permision thì:
    Exec=/opt/eclipse/eclipse
    sudo ln -s /opt/eclipse/eclipse
    sudo chmod +x /opt/eclipse/eclipse

    + Copy file thực thi ra desktop:
    cp /usr/share/applications/eclipse.desktop /home/linux/Desktop
    Sau đó kích chuột phải chọn Properties và nhấp vào Allow executing...
    + Lỗi: Faild libGL.so: sudo apt-get install libgl1-mesa-dev
    + Sửa thanh toolbar nhỏ lại:
    - Mở tệp: gedit ~/.gtkrc-2.0
    - Dán đoạn sau vào:
    style "compact-toolbar"{
    GtkToolbar::internal-padding = 0
    xthickness = 1
    ythickness = 1
    }

    style "compact-button"{
    xthickness = 0
    ythickness = 0
    }

    class "GtkToolbar"
    style "compact-toolbar"
    widget_class "*<GtkToolbar>*<GtkButton>"
    style "compact-button"


  41. Cài đặt Geany:sudo add-apt-repository ppa:geany-dev/ppa
    sudo apt-get update && sudo apt-get install geany


    Cài đặt plugin:
    sudo apt-get install geany-plugin-{pluginname}
    Xem danh sách plugin: apt-cache search geany

  42. Cài đặt GTK+ Library Dev C++:sudo apt-get install libgtk-3-dev

  43. Cài đặt Teamviewer trên Ubuntu 13.10 64bit:sudo dpkg --add-architecture i386
    sudo apt-get update


    Hoặc:
    sudo apt-get install libc6:i386 libgcc1:i386 libasound2:i386 libfreetype6:i386 zlib1g:i386 libsm6:i386 libxdamage1:i386 libxext6:i386 libxfixes3:i386 libxrender1:i386 libxtst6:i386

  44. Lệnh Quickly Design lỗi không mở được Designer:sudo add-apt-repository ppa:jfi/test
    sudo apt-get update && sudo apt-get dist-upgrade


  45. Lỗi luôn hiển thị file & folder ẩn:dconf-editor
    Enter and then:
    org->gtk->settings->file-chooser
    uncheck show-hidden

  46.  Cài đặt Wine 1.7:sudo add-apt-repository ppa:ubuntu-wine/ppa
    sudo apt-get update && sudo apt-get install wine1.7


  47.  Cài đặt QTCreator để lập trình Gui với C++:- Cài đặt trình biên dịch tệp thực thi cho Windows trên Linux:
    git clone https://github.com/mxe/mxe.git
    cd mxe && make qt

    + Nếu báo lỗi bison thì:
    sudo apt-get install autoconf automake bash bison bzip2 cmake flex gettext
    git g++ intltool libffi-dev libtool libltdl-dev
    libssl-dev libxml-parser-perl make openssl patch perl
    pkg-config scons sed unzip wget xz-utils


    (On 64-bit Debian, install also: sudo apt-get install g++-multilib libc6-dev-i386)

    + Trong thư mục ứng dụng C++:
    * export PATH=/home/linux/mxe/usr/bin:$PATH
    * /home/linux/mxe/usr/i686-pc-mingw32/qt/bin/qmake && make
    * sẽ được file thực thi *.exe trong thư mục release.

  48. Remove All File Installed:sudo find / -iregex ".*jdownloader.*" -exec rm -R '{}' ;

  49. Cài đặt phần mềm xem thông tin hệ thống (giống CPU-Z):sudo add-apt-repository ppa:nemh/gambas3
    sudo add-apt-repository ppa:i-nex-development-team/stable
    sudo apt-get update
    sudo apt-get install i-nex


    Chạy lệnh i-nex và xem.