In the table below, see the apt command for any given function, as well as which command it replaces. Note: If you need a one-page reference sheet with commands, you can use our downloadable Linux commands cheat sheet. Apart for simplifying existing commands, apt has a couple of its own. They were added to fulfill the needed command functions listed below. Most Linux users suggest using the apt command instead of apt-get whenever you can.
Not only is it easier to type and remember, it performs tasks much faster. Naturally, there are instances where substituting apt-get or apt-cache is not possible. Although you may still need to switch between command-line interfaces, many believe the apt command will eventually take over. For now, there is no official statement when or whether that will happen.
After reading this, you should have a better understanding of the differences between apt and apt-get. Using one or the other is a matter of habit. Therefore, try to get in the practice of using the apt command. June 25, What is the apt-get Command? Additional Output and Improved Design 3. New apt Commands When to Use apt Instead of apt-get? Introduction Like many other Ubuntu users, you may have wondered — What is the difference between apt-get and apt? In this tutorial, you will learn the difference between apt and apt-get.
Was this article helpful? The following image contains two screenshots of updating the Ubuntu software packages in the terminal. The top one uses apt-get and the bottom one apt. You can clearly see that apt offers more info by means of the progress bar. Definitely the nicer program to work with. Canonical maintains a large online repository with tens of thousands of software packages for each Ubuntu release. Before you can update the software packages installed on your Ubuntu system, you first download the latest software package information from this online repository.
Your Ubuntu system needs this information to detect the availability of an upgrade for an already installed software package. To update the software package information from the online repository, run this command in the terminal:.
Once the command completed, the last line in the output shows if updates are available for installed software packages on your Ubuntu system. At this point it can get a bit confusing, because multiple apt commands exist for upgrading the software packages:. The apt-get program supports dist-upgrade and apt renamed this one to full-upgrade.
For backward compatibility, apt implemented the dist-upgrade alias for this. With other words, with apt the commands full-upgrade and dist-upgrade are exactly the same.
Okay, with that extra piece of information, we can shorten the command list to:. According the the apt MAN-page, the upgrade command does the following:. If you run an Ubuntu or Debian based operating system, based on a fixed release cycle, you should use upgrade.
For example Ubuntu The idea behind a fixed release cycle is that software versions stay the same and you only get security fixes. Therefore, it will not be necessary to actually remove a package, when upgrading installed software packages. For the examples in this article, I run Ubuntu Budgie Consequently, I will use upgrade. To start the upgrade operation of your installed software packages, run the following command from the terminal:.
Before apt starts the actual software upgrade procedure, it first presents you with all the details:. Press y to proceed with the actual software upgrade operation. After starting the upgrade, you can follow its progress:. Some software packages require a system reboot to complete the update. For example an update to the Linux kernel itself. How do you know if your system requires a reboot after the update?
If this file exists, then your system requires a reboot. To find out if this file exists, you can run the cat command on this file. If this file exists and your system requires a reboot after running sudo apt upgrade , the command output looks like:.
If your system does not require a reboot after running sudo apt upgrade , the file is not available. In this case the command output looks like:. How to reboot your Ubuntu system from the terminal? Note: All these commands, except the apt-cache search command, only work within root or superuser sudo privileges.
Below you will find how to use the apt-get command to work with packages and software on your Linux system. Read through the list to learn more about the possibilities of apt-get. Before you install a package, it is crucial to resynchronize the package index files and update the package repository to the latest version.
This ensures that the packages you install are up-to-date. Search for dependencies with newer versions, install new packages, and remove old ones automatically:.
Note: Be careful when using dist-upgrade as it may remove some packages you still need on your system. To follow the changes made to the Status field of available packages by the traditional Debian packaging tool dselect and perform actions necessary to realize that state, use the command:. If you do not know the exact name of the package, type in the first few letters and press TAB. The system will suggest all the packages available, starting with those letters.
Finally, it will ask you whether you wish to continue with the installation. To answer, you must type in y for yes or n for no. If you have packages with many reverse dependencies and you need the most up-to-date versions, use the apt-get reinstall command.
0コメント