理解apt与apt-get区别

  • apt

One of the noticeable new features of Ubuntu 16.04 was the “introduction” of apt command. The reality is that the first stable version of apt was released in the year 2014 but people started noticing it in 2016 with the release of Ubuntu 16.04.

It became common to see apt install package instead of the usual apt-get install package. Eventually, many other distributions followed Ubuntu’s footsteps and started to encourage users to use apt instead of apt-get.

  • apt-get

Function apt-get apt
Install package apt-get install apt install
Remove package apt-get remove apt remove
Remove package including configuration apt-get purge apt purge
Update sources apt-get update apt update
Update packages (without removing or reinstalling) apt-get upgrade apt upgrade1
Update packages (with removing and reinstalling) apt-get dist-upgrade apt full-upgrade
Remove unnecessary dependencies apt-get autoremove apt autoremove
Search package apt-get search apt search
Display package information apt-cache show apt show
Display active package sources in detail apt-cache policy apt policy
Display available and installed package versions apt-cache policy apt policy
  • Why apt was introduced in the first place ?

Debian, mother Linux of distributions like Ubuntu, Linux Mint, elementary OS etc, has a robust packaging system and every component and application is built into a package that is installed on your system. Debian uses a set of tools called Advanced Packaging Tool (APT) to manage this packaging system. Don’t confuse it with the command apt, it’s not the same.

There are various tools that interact with APT and allow you to install, remove and manage packages in Debian based Linux distributions. apt-get is one such command-line tool which is widely popular. Another tool is Aptitude with both GUI and command-line options.

Another one is apt-cache, which arises the problem.

These commands are way too low level and they have so many functionalities which are perhaps never used by an average Linux user. On the other hand, the most commonly used package management commands are scattered across apt-get and apt-cache.

The apt commands have been introduced to solve this problem. apt consists some of the most widely used features from apt-get and apt-cache leaving aside obscure and seldom used features.

apt = most common used command options from apt-get and apt-cache

  • References

  1. Difference Between apt and apt-get Explained
  2. apt vs. apt-get

猜你喜欢

转载自blog.csdn.net/The_Time_Runner/article/details/107968076
今日推荐