To the Ubuntu software Upgrade command

Source: Internet
Author: User
Tags root access

sudo apt-get Update--Updating the software source
sudo apt-get upgrade  -Update the installed software


Update the system with a non-root user

Sudo:sudo is a Linux system Management Directive, a tool that allows the system administrator to let ordinary users perform some or all of the root commands, such as HALT,REBOOT,SU, and so on. This not only reduces the login and administration time of the root user, but also improves security. sudo is not a substitute for the shell, it is for each command.

Apt-get:apt-get is a Linux command for the Deb package managed operating system that is used to automatically search, install, upgrade, uninstall software, or the operating system from the Internet's software warehouse. Apt-get commands typically require root access, so follow the sudo command generally.

One, APT's use (Ubuntu Linux package management tool one)
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
install it ...)
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 download file saved
file && Clean up outdated packages only
sudo apt-get check #-------checks for corrupted dependencies


usage of Apt-get install
apt-get Install <package>
download <package> and all dependent packages while installing or upgrading the package. If a package is set to hold (stop flag, it will be put aside (ie not be upgraded). For more hold details, see below.

apt-get Remove [--purge] <package>
Remove <package> and any other packages that rely on this package.--purge indicates that the package should be completely cleared (purged), for more information please see dpkg-p.

apt-get Update
Upgrade the package list from the Debian image, if you want to install any software on the day, run at least once a day, and each time you modify the
after/etc/apt/sources.list, it must be executed.

apt-get upgrade [-u]
upgrade So the package that has been installed is the latest available version. No new or removed old packages will be installed. If a package changes dependency and requires a new package to be installed, it will not be upgraded, but is marked as hold. Apt-get update does not upgrade packages marked for 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, as you can see which packages will be upgraded.

apt-get Dist-upgrade [-u]
similar to Apt-get upgrade, except that Dist-upgrade installs and removes packages to meet dependency relationships. Therefore, it has certain danger.

Apt-cache Search <pattern>
search for packages and descriptions that meet <pattern>.

Apt-cache Show <package>
Displays the full description of the <package>.

Apt-cache showpkg <package>
display <package> Many details, as well as relationships with other parcels.

Dselect, CONSOLE-APT, Aptitude, gnome-apt, are several graphical front ends of apt (some of which have to be installed before use). Here Dselect is undoubtedly the most powerful, is also the oldest, the most difficult to harness.

To install lamp with Apt-get this way, it is best to run the following command to upgrade your system in order to update the source, and if the source you are looking for is not good, you may have failed to install Lmap.


#sudo apt-get Update to get a list of the most recent packages, and the list contains information about the packages, such as whether the package has been updated
#sudo Apt-get Dist-upgrade If the package does not publish updates, regardless of it, if the update is released, download the package to your computer and install it.
The apt-get Update instruction synchronizes the RPM index list (package list) of the consumer and apt servers, the RPM index list of the APT server is placed in the base folder, and the user-side computer obtains the BZ2 RPM index-list compression file in the base folder , it will be unpacked in/var/state/apt/lists/, and users use Apt-get install or apt-get dist-upgrade command, the data in this folder and the user-side computer in the RPM database, As a result, you know that those RPMs are installed, not installed, or can be upgraded.
Here's the relationship between Apt-get upgrade and Apt-get Dist-upgrade.
because there are various dependencies between packages and packages. Upgrade is just a simple update package, regardless of these dependencies, it does not add packages, or delete packages. Instead, Dist-upgrade can add packages and delete packages based on changes in dependency relationships.
typically between running upgrade or Dist-upgrade, you want to run update.


last run as follows

#sudo apt-get Install Mysql-server
Installing the MYSQL5
#sudo apt-get Install apache2
Installing Apache2
#sudo apt-get Install php5
Installing PHP5
#sudo apt-get Install Php5-mysql
installing the MySQL module for PHP
#sudo apt-get Install PHP5-GD



sudo (apt-get update && apt-get dist-upgrade && apt-get autoremove && apt-get AutoClean) package

To the Ubuntu software Upgrade command

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.