Though it sounds like apt-get update should update the packages, that’s not true. You are not the only one to be confused by the terms update and upgrade. What is the difference between apt-get update and apt-get upgrade? This is the main reason why dist-upgrade should be avoided on production machines. This may lead to the removal of some packages, which you might not want. It will attempt to upgrade the most important packages, at the expense of the less important ones. See, it has a “smart” conflict resolution system. It sounds like dist-upgrade is more powerful and intelligent, doesn’t it? But there is a risk with it. It looks for dependencies with the newer version of the package being installed and it tries to install new packages or remove an existing ones on its own. The command apt-get dist-upgrade, on the other hand, is proactive. It never tries to remove any packages or tries to install a new package on its own. The command apt-get upgrade is very obedient. Difference between upgrade and dist-upgrade There is another way to perform a complete upgrade, by using the command below: sudo apt-get dist-upgradeīut you should avoid using this command. To upgrade only a specific program, use the command below: sudo apt-get upgrade When you run this command, you’ll see the information being retrieved from various servers. Updating the package database requires superuser privileges, so you’ll need to use sudo. In fact, this is the first command you need to run on any Debian-based Linux system after a fresh install. If you don’t update this database, the system won’t know if there are newer packages available or not. Update the package database with apt-getĪpt-get basically works on a database of available packages. It’s better to have an understanding of it so that you can handle your Linux system in a slightly better way. I am using Linux Mint in this tutorial, but you can use any other Ubuntu-based Linux distribution, such as elementary OS, Linux Lite, etc. Read this article to know more details about apt and apt-get commands. There is also a newer apt command on the scene which is a simpler version of apt-get. We’ll see all of these commands with examples later in this guide. apt-get is for installing, upgrading, and cleaning packages, while apt-cache command is used for finding new packages. There are two main tools around APT: apt-get and apt-cache. You can use it to find and install new packages, upgrade packages, clean your packages, etc. This way, you don’t have to build a program from the source code.ĪPT (Advanced Package Tool) is the command-line tool to interact with this packaging system. There are already dpkg commands to manage it, but apt is a more user-friendly way to handle packages. A packaging system is a way to provide programs and applications for installation. You can print it or save it for offline viewing. Download apt-get command cheatsheet for future reference.
0 Comments
Leave a Reply. |