How to install the apt-get command on ubuntu linux Server

Source: Internet
Author: User
Some Usage of the apt-get command for installing software on ubuntu linux Server-Linux Enterprise Application-Linux server application information. The following is a detailed description. How to directly find the software you want to install under ubuntu. For example, I want to install tomcat. however, I don't know which version is in ubuntu or what I need to install, but I can confirm that I have installed tomcat, so I can use the search command: for example: $ apt-cache search tomcat then I will get the following results: libtomcat5-java-Java Servlet engine -- core libraries
Tomcat5-Java Servlet 2.4 engine with JSP 2.0 support
Tomcat5-admin-Java Servlet engine -- admin web interfaces
Tomcat5-webapps-Java Servlet engine -- documentation and example web applications
In this way, I know that ubuntu's software library contains Tomcat 5, so I can use $ apt-get install tomcat5 to install APT from Debian GNU/Linux, in the same version number, Debian is divided into seconds according to the kit maturity.
Table, testing, and unstable.

If we use Debina 3.0r2 stable, use apt-get upgrade.

You can upgrade the software for stable, and use apt-get dist-upgrade to select
Upgrade from stable to testing or unstable,

The results of apt-get upgrade and apt-get dist-upgrade are basically the same,
Apt-get dist-upgrade will install a new suite for dependency while upgrading, While apt-g
Et upgrade does not exist. Therefore, it is recommended that you use apt-get dist-upgrade for upgrade.

Apt-cache search

Search: we can use this command to search for upgrade packages,

Example: apt-cache search httpd,

Apt-cache depends

Dependency: we can use this command to view all dependency files of the software package,

For example: apt-cache depends httpd,

Apt-get install

Install: install the software package,

For example: apt-get install httpd, so that apt will automatically download httpd from the Internet and then install it. If
When httpd has dependency suites, apt will automatically download and install

Apt-get clean

Clear: when the apt-get install command is used to install the package, the downloaded rpm will be placed in/var/
Cache/apt/archives, which can be cleared using the apt-get clean command to avoid occupying hard disk space


Apt-get remove

Remove: for example: apt-get remove httpd, httpd will be removed. If there is a dependency suite
And apt will also be removed.

These commands should be enough. To get further instructions, please use man :)

Apt-get update

Update: this command is used to obtain the suite of remote servers recorded in/etc/apt/sources. list.
Before using the "apt-get dist-upgrade" command to upgrade the suite, remember to use this
Command to update the suite file list

Apt-get dist-upgrade

Upgrade: the upgrade here is mainly based on the existing software package updates, not to update the entire system.

You can also use the newly established package manager on the GUI :)

If the manager is not installed, run the following command:

Apt-get install synaptic

After the installation is complete, you can directly press synaptic on the command line to start it.
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.