Several ways to install Ubuntu software

Source: Internet
Author: User

Description: Because of graphical interface methods (such as Add/remove ... and synaptic package Manageer) is relatively simple, so here is a summary of how the terminal packages are installed, uninstalled, and deleted through the command line. First, Ubuntu Software installation Method 1, Apt mode (1) General installation: Apt-get install softname1 softname2 ...; (2) Repair installation: apt-get-f install softname1 softname2 ...;(-f atemp to correct broken dependencies) (3) Reinstall: Apt-get--reinstall in Stall softname1 softname2 ...; 2, dpkg mode (1) General installation: Dpkg-i package_name.deb3, source installation (. Tar, tar.gz, tar.bz2, tar. Z) First unzip the source tarball and then complete a with the tar command. Solution Xx.tar.gz:tar ZXF Xx.tar.gzb. Solution Xx.tar.z:tar ZXF Xx.tar.Zc. Solution Xx.tgz:tar ZXF Xx.tgzd. Solution Xx.bz2:bunzip2 xx.bz2e. Solution Xx.tar:tar XF Xx.tar and then into the extracted directory, it is recommended to read the Readme and other documents, because at this time there is no homologous code package or precompiled package may be different, and then recommend the use of ls-f--color or ls-f command (actually I only need l command) to view the executable file, the executable file will be marked with the tail of the * number. Normally execute./configure make sudo make install to complete the installation. Second, the uninstall method of the software package in Ubuntu 1, Apt mode (1) Removal uninstall: Apt-get remove softname1 softname2 ...; (Remove package, when the end of the package has +, meaning to install) (2) Clear uninstall: Apt-get--purge remove softname1 softname2 ...;(also clear the configuration) Clear uninstall: Apt-get purge sofname1 Softname2.;(Ibid., also clear config file) 2, dpkg mode (1) Remove uninstall: Dpkg-r pkg1 pkg2 ...; (2) Clear type unloading: dpkg-p pkg1 pkg2 ...; Third, in UbuntuThe query method for the package dpkg uses a text file as a database. Commonly known in the/var/lib/dpkg directory. The generic term stores the state of the software and controls information in the status file. In the info/directory, back up the control file, and in the. list file below it, record the installation file manifest, under which the. Mdasums saves the MD5 encoding of the file. The time to experience using the database is: $ dpkg-l desired=unknown/install/remo Ve/purge/hold | Status=not/installed/config-files/unpacked/failed-config/half-installed |/err?= (none)/Hold/Reinst-required/X= Both-problems (Status,err:uppercase=bad) | | /Name Version Description +++-===========-================-======================================== II AALIB1 1.4P5-28 ASCII Art library-transitional Package II AddUser 3.85 ADD and remove users and Groups II alien. Install non -native Packages with dpkg ... Each record corresponds to a package, noting the first, two, three characters of each record. This is the status identifier of the package, followed by the package name, version number, and a simple description. The first character is expected, which includes the following: U state is unknown, which means that the package is not installed and the user has not issued an installation request. I user requests to install the package. R user requested to uninstall the package. P user requests that the package be purged. H user requests to keep package version locked. The second column is the current state of the package. This column includes the six states of the package. N package is not installed. I install the package and complete the configuration. The C package was previously installed and is now deleted, but its configuration files remain in the system. The U package is unpacked but not yet configured. F tried to configure the package, but failed. H package was installed, but did not succeed. The third column identifies the error state, which can be summarized in four states. The first state identifies no problem and is empty. The other three symbols identify the corresponding problem. H package isForced to persist because other packages depend on requirements and cannot be upgraded. The R package is corrupted and may need to be reinstalled for normal use (including deletion). X Soft package is destroyed and is forced to remain. You can also use the wildcard pattern for fuzzy queries, such as I want to find all packages starting with the Nano character: $ dpkg-l nano* Desired=unknown/install/remove/purge/hold | Status=not/installed/config-files/unpacked/failed-config/half-installed |/err?= (none)/Hold/Reinst-required/X= Both-problems (Status,err:uppercase=bad) | | /Name Version Description +++-==============-==============-============================================ II Nano 1.3.10-2 free Pico clone with some new features PN Nano-tiny (no description available) UN Nanoblogger (no description available) above status Description: The system installed the nano version of 1.3.10-2; installed Nano-tiny, and then cleared; Nanoblogger has never been installed. If you feel dpkg too many parameters, not conducive to memory, you can use Dpkg-query for dpkg database query. Application Example: Query system for files belonging to Nano: $ dpkg--listfiles nano o R $ dpkg-query-l Nano View software Nano Details: $ dpkg-s Nano or $ dpkg-query-s nano View system in package status, Support Fuzzy query: $ DPKG-L or $dpkg-query -L View a file's attribution package: $ dpkg-query-s nano or $ dpkg-s Nano III, other applications summary Apt-cache Search #------(Package search pack) Apt-cache Show #------( Package get information about packages, such as description, size, version, and so on) apt-get Install #------(Package installation packages) apt-get Install #-----(Package--reinstall Reinstall packages) Apt-get-f Install #-----(mandatory installation, "-F =--fix-missing" When it is a repair installation ...) Apt-get Remove #-----(Package Delete pack) apt-get Remove--purge #------(Package delete packages, including delete profiles, etc.) Apt-get autoremove--purge #----( Package Delete packages and their dependent packages + profiles (only valid for 6.10, highly recommended)) Apt-get Update #------updating source Apt-get Upgrade #------Update installed packages Apt-get Dist-upgrade #---------Upgrade System Apt-get Dselect-upgrade #------Use Dselect upgrade Apt-cache depends #-------(package understands use dependency) Apt-cache Rdepends #------(Package Understand a specific dependency, when it is to see which packages are dependent on the package ...) Apt-get BUILD-DEP #------(Package Installation-related compilation environment) Apt-get Source #------(packages download the source code for the bundle) Apt-get clean && apt-get aut Oclean #--------Clean up the archive of downloaded files && only clean up outdated packages apt-get Check #-------Checks if there is a corrupted dependent dpkg-s filename----- Find out which package filename belongs to apt-file search filename-----Find out which package the filename belongs to apt-file list PackageName-----List The contents of the package Apt-file Update--Updates apt-file database dpkg--info "package name"--lists package names after package unpacking. Dpkg-l--Lists all packages in the current system. Can be used with the parameter less in Split-screen viewing. (similar to RPM-QA) dpkg-l |grep-i "package name"--View the package that is associated with the package name in the system. Dpkg-s query the details of the installed package. Dpkg-l Query the location of installed packages installed in the system. (similar to RPM-QL) dpkg-s query the system for which package a file belongs to. (similar to RPM-QF) dpkg-i query the details of the Deb package, and after a package has been downloaded to the local, take a look at the installation (look at it). Dpkg-i Install the package manually (this command does not solve the dependency problem before the package), If you encounter software dependencies when installing a package, you can use apt-get-f install to solve the problem of reliability. Dpkg-r Uninstall the package. It is not completely uninstalled, and its configuration file still exists. Dpkg-p All Uninstall ( However, it is still not possible to resolve the dependencies of the package) Dpkg-reconfigure reconfigure the Apt-get install download package, as well as all dependent packages, while installing or upgrading the package. If a package is set to hold (stop flag, it will be placed on one side (i.e. it will not be upgraded). See below for more hold details. Apt-get Remove [--purge] and any other packages that depend on this package. --purge indicates that the package should be completely cleared (purged), please see dpkg-p for more information. Apt-get Update upgrades the list of packages from the Debian image, if you want to install any software on the day, run at least once a day, and must be executed after each modification of/etc/apt/sources.list. Apt-get upgrade [-u] upgrades all installed packages to the latest available version. New or removed old packages are not installed. If a package changes the dependency and needs to install a new package, it will not be upgraded, but is flagged as hold. Apt-get Update does not upgrade the package that is flagged as hold (this is the meaning of hold). See below how to manually set the package to hold. I recommend using the '-u ' option at the same time because you can see which packages will be upgraded. Apt-get Dist-upgrade [-u] and Apt-get upgrade are similar except that Dist-upgrade installs and removes packages to satisfy dependencies. Therefore, it has a certain danger. Apt-cache Search in the package name and description, find the package containing XXX. Apt-cache Show shows the complete description of a package. Apt-cache showpkg shows more details about the package, as well as relationships with other packages. Several graphical front ends of the dselectconsole-aptaptitudegnome-aptapt (some of which need to be installed before use). Here Dselect is undoubtedly the most powerful, is also the oldest, the most difficult to control. Common Dpkg usage dpkg-i install a Debian package file, such as a file that you manually download. Dpkg-c the contents listed. The dpkg-i extracts the package information from it. Dpkg-r removes an installed package. Dpkg-p completely clears an installed package. Unlike remove, remove just deletes the data and executable files, and purge also removes all the configuration files. DPKG-L Lists all installed file listings. Also see Dpkg-c to check the contents of a. deb file. DPKG-S displays information about the installed package. Also see Apt-cache displays the package information in the Debian archive, as well as dpkg-i to display the package information extracted from a. deb file. Dpkg-reconfigure to reconfigure an already installed package if it is using debconf (debconf provides a unified configuration interface for package installation). You can re-formulate debconf it itself, as you want to change its front end or ask for priority.For example, to reconfigure the debconf, use a dialog front end, simple to run: dpkg-reconfigure--frontend=dialog debconf (if you chose the wrong installation, you can change it back to Yo:) echo "Hold" | Dpkg--set-selections Set the status of Hlod (command line) dpkg--get-selections "" The Current state (command line mode) supports wildcard characters, such as: debian:~# dpkg--get-selections *wine*libwine Holdlibwine-alsa holdlibwine-arts holdlibwine-dev holdlibwine-nas holdlibwine-print holdlibwine-twain Holdwine holdwine+ Holdwine-doc Holdwine-utils hold For example: Everyone is now using gaim-0.58 + Qq-plugin, in order to prevent the Gaim is upgraded, We can use the following methods: Method one: debian:~# echo "Gaim hold" | Dpkg--set-selections then use the following command to check: debian:~# dpkg--get-selections "Gaim" Gaim hold now the status of the flag is on, can not be upgraded. What if we want to recover? debian:~# echo "Gaim Install" | dpkg--set-selectionsdebian:~# dpkg--get-selections "Gaim" Gaim install then the status flag is reset to install, you can continue to upgrade. Comrades will ask, which of these status signs are written in which file? In/var/lib/dpkg/status, you can also implement hold by modifying this file. Sometimes you will find that some software status signs are purge, don't be surprised. such as: aMSN has been installed in advance, and then to unload it. Apt-get Remove--purge amsn then the status flag is changed from install to purge. Method Two: Manually build a Preferences file content under/etc/apt: Package:gaimPin:version 0.58* Save dpkg-s Find in the package database and tellWhich of your packages contains this file. (Note: Looking for a package that has been installed beforehand)-------------------------------------------- The Debian Package management tool commands are not fully listed--------------------------------------------all package information in the Debian system is under/var/lib/dpkg. where/var/lib/ The Dpkg/info directory holds the information and management files for each package. Each file functions as follows: A list of configuration files that end with ". Conffiles" for a package. A file that ends with a ". List" records the list of files for the package, The user can find the specific installation location of the package file in the file. A file that ends with ". Md5sums" records MD5 information for the verification of the package. The file that ends with ". config" is the installation configuration corner of the package. ". Postinst" This is the configuration that is performed after the Debian package has been unpacked and is typically used to perform the restart of the commands and services associated with the installed package. To run with the ". Preinst" angle before the Debain unpacking, The primary role is to stop the package service from being upgraded until the package is installed or upgraded. The ". Prerm" script is responsible for stopping the daemon service associated with the package and executing it before deleting the package associated file. The ". Postrm" script is responsible for modifying the package link or file association, or delete the file created by it./var/lib/dpkg/available is a description of the package. Includes all packages from the Debian installation source used in the current system, and includes packages that are already installed and not installed on the current system. 1.DPKG Package Management tool Dpkg-r Uninstall the package. Not a full uninstall, its configuration file also exists. dpkg--info "package name"--Lists the package name after package unpacking. Dpkg-l-- Lists all packages in the current system. Can be used with the parameter less in Split-screen viewing. dpkg-l |grep-i "package name"--View the package that is associated with the package name in the system. Dpkg-s query the details of the installed package. Dpkg-l Query the location of installed packages in the system. Dpkg-s query the system for which package a file belongs to. dpkg-i Query the details of the Deb package, and after a package has been downloaded to the local, look for it to be installed (look at it). Dpkg-i Install the package manually ( This command does not solve the dependency problem before the package, if a package is installedTo the problem of software dependencies, you can use apt-get-f install to solve the problem of trust. Dpkg-reconfigure reconfigure dpkg-p all uninstall (but still cannot resolve the issue of dependencies of the package) 2. APT Advanced package management tool (1) GTK graphics "synaptic", which is apt's front-end tool. (2) "aptitude", which is also the front-end tool for Apt. APT management tools for the management of the package, there are several ways to do the Source: (1) Take the installation disk as the source, the method is as follows: Apt-cdrom ident scanning disc Information Apt-cdrom add to add a disc source (2) This is also the most common method is to add the source to the/etc/apt/ Source.list, after the update column Apt-get UPDATEAPT management tools commonly used commands Apt-cache plus the use of different subcommands and parameters can be implemented to find, display software, package information and package trust relationships and other functions. Apt-cache stats Displays statistics for all debain data sources used by the current system. Apt-cache Search + "package name" to find related packages. Apt-cache Show + package name to display the details of the specified package. Apt-cache depends + " Package name to find dependencies for packages. Apt-get Upgrade update all packages in the system to the latest version Apt-get install package Apt-get--reindtall Install reinstall package Apt-get Remove Uninstall Package Apt-get--purge Remove completely uninstall Package Apt-get clean clears useless packages before using the command Apt-get install, the package is downloaded to/var/cache/apt/archives first. After the installation. So we can use apt-get clean to clear the packages in the/var/cache/apt/archives directory. Source package Installation Apt-cache SHOWSRC Find the file information of the source package (before downloading) apt-get SOURCE download Source package. Apt-get BUILD-DEP + "package name" builds the source package's compilation environment. Clear the RC package dpkg-l |grep ^rc|awk ' {print $} ' |tr ["\ n"] [""] | sudo xargs dpkg-p-

Several ways to install Ubuntu software

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.