Ubuntu Basic command--apt, dpkg

Source: Internet
Author: User
Tags save file

First, the software installation method in Ubuntu

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 install softname1 softname2 ...;

2, Dpkg Way

(1) General installation: Dpkg-i Package_name.deb

3, source installation (. Tar, tar.gz, tar.bz2, tar. Z)

Unzip the source Tarball first and then complete it with the tar command.

A Solution Xx.tar.gz:tar ZXF xx.tar.gz
b Solution Xx.tar.z:tar ZXF Xx.tar.z
C Solution Xx.tgz:tar ZXF Xx.tgz
D Solution Xx.bz2:bunzip2 xx.bz2
E Solution Xx.tar:tar XF Xx.tar

Then go to 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 (in fact, I only need the L command) to view the executable file, The executable file will be marked with the trailing sign of the * number.

Generally executed in turn./configure

Make

sudo make install

To complete the installation.

Second, the uninstall method of software package in Ubuntu

1. Apt mode

(1) Remove type unloading: Apt-get remove softname1 softname2 ...; (Remove the 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 ...;(ditto, also clear config file)

2, Dpkg Way

(1) Remove type unloading: dpkg-r pkg1 pkg2 ...;

(2) Clear type unloading: dpkg-p pkg1 pkg2 ...;

Third, the query method of software package in Ubuntu

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 control information in the status file. In the info/directory, backup the control file, and in the. list file below it, record the installation file list under the. Mdasums Save File The MD5 encoding.

$ dpkg-l | Moredesired=unknown/install/remove/purge/ hold| status=not/inst/conf-files/unpacked/half-conf/half-inst/trig-await/trig-Pend|/err?= (None)/reinst-required (status,err:uppercase=Bad )|| /Name Version Architectur E Description+++-=====================================================-===================================================-= ===========-===============================================================================II Account-plugin-aim3.8.6-0ubuntu9.2AMD64 Messaging Account Plugin foraimii Account-plugin-facebook0.11+14.04.20140409.1-0UBUNTU2 all GNOME Control Center account Plugin forSingle Signon-facebookii Account-plugin-flickr0.11+14.04.20140409.1-0UBUNTU2 all GNOME Control Center account Plugin forSingle Signon-Flickrii Account-plugin-google0.11+14.04.20140409.1-0UBUNTU2 all GNOME Control Center account Plugin forSingle signonii account-plugin-jabber3.8.6-0ubuntu9.2AMD64 Messaging Account Plugin forjabber/Xmppii Account-plugin-salut3.8.6-0ubuntu9.2AMD64 Messaging Account Plugin forLocal XMPP (Salut) II account-plugin-twitter0.11+14.04.20140409.1-0UBUNTU2 all GNOME Control Center account Plugin forSingle Signon-Twitterii Account-plugin-yahoo3.8.6-0ubuntu9.2AMD64 Messaging Account Plugin forYahoo!II Accountsservice0.6. *-0ubuntu7.2AMD64 Query and manipulate user account informationii ACL 2.2. the-1AMD64 Access Control List utilitiesii ACPI-support0.142AMD64 scripts forhandling Many ACPI eventsii acpid1:2.0. +-1UBUNTU2 AMD64 Advanced Configuration and Power Interface event daemon

Each record corresponds to a package, note the first, two, three characters of each record (desired, Status, ERR?). This is the status identifier of the package, followed by the package name, version number, and a simple description.

    • The first character is the expected value (desired), which includes:
      • The 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 character (status), which 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 character identifies the error state (ERR), which can be summarized in four states. The first state identifies no problem and is empty. The other three symbols identify the corresponding problem.
      • The H package is enforced because other packages are dependent on requirements and cannot be upgraded.
      • The R package is corrupted and may need to be reinstalled for normal use (including deletion).
      • X soft packages are destroyed and are forced to remain.

The software in the following refers to package packages (you can also install the Apt-file,apt-get install apt-file)

1. Search for related software:

Apt-cache seach [keyword]

2. Obtain information about the software, such as description, size, version, etc.

Apt-cache Show [Package]

3. Look for software that has been installed or uninstalled (but the configuration file is still in, that is, remove--purge)

Dpkg-l (lowercase L), dpkg-l | grep ' Someone ' or dpkg-l [one software]

4. View the details of the software that has been installed or uninstalled (but not--purge when the configuration file is still in, that is, remove)

Dpkg-s [Installed software]

5. View a file's attribution (Fuzzy Lookup) (can also use Apt-file, need to install, Apt-get installs Apt-file)

$ dpkg-/usr/share/doc/nano/faq.htmlpython-chardet:/usr/share/doc/python-chardet/faq.html

6. Check the Software installation location (such as Eclipse's non-installation software, not found)

Dpkg-l python

7. Update the image list

Apt-get Update

8. Software update, kernel upgrade (upgrade to a higher iteration, large version unchanged. A large version upgrade can only be re-installed, when there is a package dependency conflict issue, stop the update upgrade

Apt-get upgrade (requires Apt-get update before running)

9. Software updates, kernel upgrades, and resolution of dependencies, with risk

Apt-get Dist-upgrade (requires Apt-get update before running)

Ubuntu Basic command--apt, dpkg

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.