Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between Apt and Apt-Get in ubuntu

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what is the difference between Apt and Apt-Get in ubuntu. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

I. concept

The difference between apt and apt-get

1. Apt-get

Advanced Package Tool, also known as apt-get, is an application manager for Unix and Linux systems.

Originally released in 1998, it is used to retrieve applications and load them into the Debian Linux system. It is mainly used to automatically search, install, upgrade and uninstall software or operating system from the software repository of the Internet.

One of the reasons for Apt-get 's fame is its excellent ability to solve software dependencies. It usually uses .deb-formatted files, but with modifications, you can use apt-rpm to process Red Hat's Package Manager (RPM) files.

Apt-get is widely used in the Linux community and has become an important tool for managing desktops, laptops, and the web. With the popularity of Linux in the enterprise, it is advantageous for Windows and Mac users to know how to load applications using apt-get.

In addition, with the increase of the heat of single-chip microcomputer devices such as Raspberry Pi, apt-get is a more convenient way to load applications on these platforms. If the application you want to load requires a library or another application to work properly, apt-get will help you find and load the required library or application code.

The current stable version of apt-get is 1.0.9.2, which was released in October 2014.

Mainstream Linux systems that use apt-get include Debian and Ubuntu mutant versions. In most cases, run the tool from the command line. There are several graphical front ends available on the desktop, including Synaptic Package Manager, Ubuntu Software Center, Aptitude, and Kpackage.

Users of Raspberry Pi and Beaglebone Black nanoLinux versions can easily use the apt-get loader because these systems usually come from Ubuntu or Debian code. Is a package management tool for the debian,ubuntu distribution, very similar to the "yum" tool in Red Hat.

The apt-get command generally requires "root permission" to execute, so it usually follows the sudo command.

2. Apt

The first stable version of the apt command line utility was released in 2014 for the installation of the Debian distribution .deb package. It was originally used in unstable versions of Debian and then became standard in Debian 8.

After the release of Ubuntu 16.04, apt became popular and replaced apt-get in some way.

As the frequency and popularity of the apt install package command gradually surpasses that of apt-get install package, more and more other Linux distributions are starting to follow in the footsteps of Ubuntu, encouraging users to use apt instead of apt-get.

Most people don't understand the difference between apt and apt-get and are often confused when using one or the other.

Both are open source command-line tools for managing software packages such as installation, update, upgrade, and deletion.

However, there are still some differences between them.

Let's look at some apt commands instead of apt-get, which can be viewed by typing apt help or by typing apt man in the terminal to access the apt man page. It will display all the information related to apt.

Apt help

II. The difference between apt-get and apt

The first difference between apt and apt-get is the command itself. For example, if you want to update the system repository index using apt-get update, you can run:

# apt-get update

Using apt, enter the command:

# apt update

The apt update command not only updates the repository index, but also tells you whether software is available in the repository and how many new versions are available.

1. Command comparison

Apt-getapt function apt-getapt installation package apt-get removeapt remove delete package apt-get removeapt remove replace all packages apt-get purgeaptpurge remove packages and configuration files apt-get upgradeapt upgrade update all packages (automatically handle dependencies) apt-get autoremoveapt autoremove automatically delete unwanted packages apt-get dist-upgradeapt full-upgrade automatically handles dependencies apt-cache searchapt search search application apt-cache showapt show display details when upgrading software packages

Remove unnecessary dependencies on apt-get autoremoveapt autoremove remove the package apt-get purgeapt purge with related configuration

In the above table, if you replace apt-get with apt, all commands are the same except the apt upgrade command. The old apt-get upgrade command updates all packages that currently exist on the system, and it does not install or remove existing packages on the system. The new apt upgrade command installs packages that are added as dependencies of upgradeable packages. Although similar to an apt-get upgrade, it does not remove previously installed packages.

The apt show command prints output in alphabetical order and hides the less important information displayed by the apt-cache show command.

The difference between apt and apt-get is not limited to commands; another visual feature has been added to the new apt command to satisfy end users. Whenever you update a package using an apt upgrade, an apt full upgrade, or an apt dist upgrade, you will see a progress bar informing you of the progress of the process.

Apt install

It also appears when you delete a package using apt remove or apt purge.

In addition, if we run "apt list-- upgradeable", it will show some colors to provide a clear overview of the latest versions of the packages provided by the repository.

Apt list-upgradeable

two。 Two new orders

In addition to the replacement command, apt introduces two new commands:

The new apt command feature apt list lists apt edit-sources editing sources for packages that contain conditions (installed, upgradeable, etc.)

Hongmeng official Strategic Cooperation to build HarmonyOS Technology Community

Apt list-when the apt list command is used with-installed or-upgradeable, it lists the packages that have been installed, can be installed, or need to be upgraded.

Apt edit-sources-when you use this command, it opens the sources.list file in the editor for editing. Apt-get still can't be completely replaced by apt, and I don't think it will ever be completely terminated. You may be thinking about what you should choose: apt or apt-get. In my opinion, choosing apt is worthwhile because it provides all the necessary features for package management, and it is faster, more friendly, and easy to use.

Third, use apt or apt-get?

At present, there is no official message from the Linux distribution that apt-get will be disabled, at least it has more and more detailed operational features than apt. For low-level operations, apt-get is still required.

Since both commands are useful, should I use apt or apt-get?

As a regular Linux user, the system geek advises you to adapt as soon as possible and start using apt first. Not only are Linux publishers recommending apt, but more importantly, it provides the necessary options for Linux package management.

Most importantly, the apt command options are fewer, easier to remember, and therefore easier to use, so there's no reason to stick to apt-get.

Finally, we offer two suggestions on how to use it:

Apt can be seen as a subset of the apt-get and apt-cache commands, providing the necessary command options for package management.

Although apt-get has not been deprecated, as an ordinary user, you should use apt first.

This is the end of the article on "what is the difference between Apt and Apt-Get in ubuntu". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report