How to install and uninstall software under Ubuntu

Source: Internet
Author: User

1, the installation of the Deb package situation:
Install the. Deb Package:
Code: sudo dpkg-i package_file.deb
Anti-install. Deb Package:
Code: sudo dpkg-r package_name

2, through the Apt-get installation situation:
Installation
Code: sudo apt-get install package_name
Anti-Installation
Code: sudo apt-get remove package_name

3, sudo dpkg-p package_name Uninstall the package and its configuration file, but cannot resolve the dependency!
sudo aptitude purge pkgname Uninstall packages and their configuration files with dependency packs!


Clears the residual profile for all deleted packages
Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p
If you report the following error, prove that there is no residual configuration file in your system, do not need to worry.


--------------------------------------------------------------------------------

Dpkg:--purge needs at least one package Name argument

Type dpkg--help for help about installing and deinstalling packages

  • ;
    Use the ' dselect ' or ' aptitude ' for the user-friendly package management;
    Type Dpkg-dhelp for a list of dpkg debug flag values;
    Type dpkg--force-help for a list of forcing options;
    Type dpkg-deb--help for help about manipulating *.deb files;
    Type dpkg--license for copyright license and lack of warranty (GNU GPL)
  • .

    Options marked
  • Produce a lot of output-pipe it through "less" or ' more '!


    4, dpkg can be installed with apt unloading, conversely can also


    5. Aptitude, like Apt-get, is a very powerful package management tool in Debian and its derivative systems. Unlike Apt-get, aptitude is better at dealing with dependency issues. For example, when aptitude deletes a package, it also deletes the packages it depends on. This way, the system will not be left with useless packets, the whole system is cleaner. The following is a summary of some of the common aptitude commands, for reference only.

    Command function
    Aptitude update updates the list of available packages
    Aptitude Upgrade Upgrade Available packages
    Aptitude Dist-upgrade Upgrade the system to a new release
    Aptitude Install Pkgname installation package
    Aptitude Remove Pkgname Delete Package
    Aptitude Purge Pkgname Delete package and its configuration file
    Aptitude search String Searching package
    Aptitude show Pkgname shows the details of the package
    Aptitude Clean Delete the downloaded package file
    Aptitude AutoClean Delete Expired package files only


    Of course, you can also use aptitude in text interface mode.

    6, Common APT command

    Apt-cache Search #------(Package Finder)
    Apt-cache Show #------(package gets information about packages, such as description, size, version, etc.)
    sudo apt-get Install #------(Package installer)
    sudo apt-get Install #-----(Package-Reinstall reinstall packages)
    sudo apt-get-f Install #-----(Force install? # "-F =--fix-missing" When it is a repair installation ...)
    sudo apt-get Remove #-----(Package Delete pack)
    sudo apt-get Remove--Purge #------(Package delete packages, including delete profiles, etc.)
    sudo apt-get autoremove--purge #----(Package delete packages and their dependent packages + profiles etc (only valid for 6.10, highly recommended))
    sudo apt-get update #------Updating source
    sudo apt-get upgrade #------Update an installed package
    sudo apt-get dist-upgrade #---------Upgrade System
    sudo apt-get dselect-upgrade #------Upgrade with Dselect
    Apt-cache depends #-------(package understands usage dependencies)
    Apt-cache Rdepends #------(Package understands a specific dependency? #当是查看该包被哪些包依赖吧 ...)
    sudo apt-get BUILD-DEP #------(Package Installation-related compilation environment)
    Apt-get Source #------(Package downloads the source of the bundle)
    sudo apt-get clean && sudo apt-get AutoClean #--------Cleanup the archive of downloaded files && clean up outdated packages only
    sudo apt-get check #-------checks for corrupted dependencies
    7, the introduction of dpkg and command use:

    Brief introduction
    Dpkg is an intermediate package manager for Debian, similar to RPM.

    Dpkg is a mainstay of the Debian package management system, responsible for securely uninstalling packages, configuring, and maintaining installed packages. It is also the back end of many package management tools in the Debian system. For more information about dpkg see: http://www.dpkg.org

    All packages information in the system is in the/var/lib/dpkg/directory, where the subdirectory "/var/lib/dpkg/info" is used to hold the configuration file list for each package.

    . Conffiles records the list of configuration files for the package
    The list of files in the package is saved, and the user can find the specific installation location of the files in the package from the. List information.

    The. Md5sums records the package's MD5 information, which is used for packet validation.

    The. Prerm script runs before the Debian packet is unpacked, and the main function is to stop the service that acts on the package that will be upgraded until the package installation or upgrade is complete.

    The. Postinst script is a configuration that completes after the Debian package is unpacked and is typically used to perform commands and service restarts for the installed packages.

    The content of the/var/lib/dpkg/available file is a description of the package, which includes all packages in the Debian installation source used by the current system, including installed and not installed packages on the current system.

    Dpkg
    Querying all installed Deb packages for the current system
    The Dpkg–l command is used to query information about all the Deb packages that are installed on the current system. More complex query work can be done with less and grep.

    For example, find a package related to vim, dpkg–l |grep–ivim

    (If the IU is found to indicate that the package is not successfully installed, II indicates a successful installation)



    View details of installed packages
    The Dpkg–s command looks at the details of the package, including the version, dependencies, and the like



    Querying the files installed by the packages installed in the system
    The Dpkg–l command is used to query the installation of installed packages in the system installed files to the location of the system and installs those.


    Tip: How can I see where the software is packaged?
    Install with Apt-get *


    How can I see where the software is packaged?
    Dpkg-l Package-name|more



    Querying the system for a file that belongs to that package
    The Dpkg–s command is used to understand that the current software belongs to that package



    Querying for information that is not installed
    Query does not install package details
    The Dpkg–i command is used to view the details of a package that is not installed to see if the package needs to be installed.



    Querying the files contained in the Deb package file
    DPKG–C displays a list of files that are included in the installation of the Deb package, and the installation location



    Install packages
    Installing the Deb Package
    Dpkg–i manually installs the Deb package into the system, but sometimes there is a dpends relationship, it is recommended to use Apt-get to install.
    If the dpends relationship is not successfully installed after installing the software through Dpkg–i, you can resolve it by apt-get–f install


    Fix dpends problem with Dpkg–i install Deb package
    Apt-get–f install solves dpends problem.
    Example: Dpkg–i lftp_3.1.3-1_i386.deb

    Selecting previously deselected package lftp.
    (Reading database ... 20654 files and directories currently installed.)
    Unpacking lftp (from Lftp_3.1.3-1_i386.deb) ...
    Dpkg:dependency problems prevent configuration of lftp:
    Lftp depends on LIBEXPAT1 (<=1.95.8); however
    Dpkg:error processing lftp (--install)
    Dependency Problems–leaving unconfigured
    Errors were encountered while processing:
    Lftp
    LFTP Package Installation Failed
    Dpkg–l |grep lftp
    IU lftp 3.1.3-1 Sophisticated
    Command-Line Ftp/http client P
    "Dpkg-l" Query information indicates that the LFTP package was not successfully installed
    (IU indicates no successful installation, II indicates successful installation)

    Use apt-get–f Install to resolve



    Uninstalling the Deb Package
    The dpkg–r is used to unload the specified package, which uninstalls only the files installed on the system, not the configuration files of the package, and therefore not the full meaning of the uninstallation. However, the package is saved in the system and can be provided for later use when installing the package.
    For example: Dpkg–r prozilla Remove and then use Dpkg–l |grep Prozilla to view

    will see RC proc 1.3.6-3woody3 multi-thraded Download Accelerator

    Indicates that the package has been uninstalled, but the configuration file is still in the "RC" with the table profile.


    Uninstalling the package and clearing the configuration file
    Dpkg–p used to uninstall the package and also delete the configuration file, Dpkg–p does not resolve the dpends problem, it is recommended to use the Apt-get operation when uninstalling



    Reconfigure the package
    For many packages in the Debian system (especially the system and server packages), a dialog window is displayed for the first time the package is installed, prompting the user to enter the necessary configuration information. When the user needs to configure the package again, You can use Dpkg-reconfigure to configure the specified package.
    Like dpkg-reconfigure locales.



    Alien Package Conversion Tool


    If we have a favorite RPM package and no Deb version. How to do it? can be converted or installed directly with the alien, this little guy is a very convenient thing!

    The basic commands are as follows:
    First installed by Apt-get install Alien.
    And then
    Alien-i name-of-the-pakage.rpm/* for direct installation of RPM packages
    alien-d,--to-deb/*make Debian Packages,this is the default
    Example: Alien–d package.rpm
    Alien–r,--to-rpm/*make RPM packages

    Example: Alien–r package.deb
    Alien–p,--to-pkg/*make Solaris pkg Packages
    ALIEN–-TO-SLP/*make SLP Packages
    Alien–t,--to-tgz/*make tgz Packages
    Alien–t detection

    Alien–-patch=patch Setting up Patches

sudo apt-get remove Softwarename

How to install and uninstall software under Ubuntu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.