• deb包的安装及dpkg命令小结


    DPKG commands

    There are two actions, they are dpkg-query and dpkg-deb.

    Install a package

    # sudo dpkg -i {package_name}    
    # sudo dpkg -i skype-ubuntu-precise_4.2.0.11-1_i386.deb
    

    Remove a package

    # sudo dpkg -r {package_name}
    # sudo dpkg -r vlc
    

    Remove a package and its configuration files

    # sudo dpkg -P {package_name}
    # sudo dpkg -P vlc
    

    List all installed packages.

    You can pipe the command to less (a pager) so you can more easily scroll the content:

    # dpkg -l | less
    

    Check if the package is installed or not

    # dpkg -l {package_name}
    # dpkg -l vlc
    

    Check if the package is installed or not, and if it is, launch it:

    # dpkg -l | vlc
    

    See whether a package is installed or not

    And this will show the location where the package will be installed. Here -S (capital S) to search whether the package was installed or not.

    # sudo dpkg -S {package_name}
    # sudo dpkg -S skype
    

    Install a *.deb package from a specified location

    Here -R is recursive. (Recursively handle all regular files matching the pattern *.deb found at specified directories and all of its subdirectories).

    # sudo dpkg -R --install {package_location}
    # sudo dpkg -R --install /home/sysadmin/soft
    

    Show package details

    Here -p (lowercase p) will show the package info:

    # dpkg -p {package_name}
    # dpkg -p apache2
    

    View the content of a package

    Use -c (lowercase c) to show the content:

    # sudo dpkg -c {package_name}
    # sudo dpkg -c skype-ubuntu-precise_4.2.0.11-1_i386.deb
    

    Extract the *.deb package file

    Use -x (lowercase x) to extract:

    # dpkg -x {package_name} {location_were_to_extract}
    # dpkg -x libqt4-phonon_4.6.3-4+squeeze1_i386.deb /home/sysadmin/
    

    Extract and display the filenames contained in a package

    Use -X (uppercase X) to display the content with extraction.

    # dpkg -X {package_name} {location_were_to_extract}
    # dpkg -X libqt4-phonon_4.6.3-4+squeeze1_i386.deb /home/sysadmin/
    

    Display information about a package

    Here -I stands for information:

    # dpkg -I {package_name}
    # dpkg -I libqt4-phonon_4.6.3-4+squeeze1_i386.deb
    

    Reconfigure an already installed package

    dpkg-reconfigure reconfigures packages after they already have been installed. Pass it the name(s) of a package or packages to reconfigure. It will ask configuration questions, much like when the package was first installed.

    # dpkg-reconfigure postfix
    

    This will reconfigure postfix the same way as when you installed it for the first time.

    Need to know more about dpkg commands? Have a look at the manual page:

    # man dpkg


    原文:http://askubuntu.com/questions/40779/how-do-i-install-a-deb-file-via-the-command-line
  • 相关阅读:
    虚拟机NetworkAdapter三种方式的区别
    skia
    android gralloc是什么意思
    两个工作机会
    Ubuntu apt-get更新源替换及加速方法
    Vuforia和Metaio相继被收购,开发者们还有这些AR引擎可以选
    OpenCV 为啥勾搭上 OpenGL
    感受2万元的黑科技 微软MR头显HoloLens测评
    影创 我们的职位
    java基础-servlet-2:生命周期
  • 原文地址:https://www.cnblogs.com/cursorhu/p/5776366.html
Copyright © 2020-2023  润新知