In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you the content of apt common command in Linux system. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
The apt command can be said to be the most important command under Ubuntu system. Installing, updating, uninstalling software and upgrading the system kernel are inseparable from the apt command.
Update package index (apt update)
The APT package index is basically a database that keeps records of packages available in repositories enabled in the system.
To update the package index, run the following command. This will extract the latest changes from the APT repository:
sudo apt update Always update the package index before upgrading or installing new packages.
Upgrade package (apt upgrade)
Regularly updating a Linux system is one of the most important aspects of overall system security.
To upgrade an installed package to the latest version, run:
sudo apt upgrade This command does not upgrade packages that require removal of installed packages.
If you want to upgrade a single package, pass the package name:
sudo apt upgrade package_name Configuring automatic security updates is always a good idea.
apt full-upgrade
The difference between upgrade and full-upgrade is that the latter removes installed packages if the entire system needs to be upgraded.
sudo apt full-upgrade Use this command with extreme caution.
Installation package (apt install)
Installing packages is as simple as running the following command:
sudo apt install package_name If you are installing multiple packages, specify them as a space-separated list:
sudo apt install package1 package2 To install the local deb file, provide the full path to the file. Otherwise, the command attempts to retrieve and install the package from the APT repository.
sudo apt install /full/path/file.deb Remove package (apt remove)
To remove an installed package, type
sudo apt remove package_name You can also specify multiple packages, separated by spaces:
sudo apt remove package1 package2 The remove command will uninstall the given package, but it may leave some configuration files behind. If you want to delete a package that includes all profiles, use purge instead of remove:
sudo apt purge package_name Delete unused package (apt autoremove)
Package dependencies are also installed whenever a new package that depends on another package is installed on the system. After the package is removed, the dependencies remain on the system. These remaining packages are no longer used by anything else and can be deleted.
To remove unwanted dependencies, use the following command:
sudo apt autoremove View package list
The list command allows you to list available, installed, and upgradeable packages.
To list all available packages, use the following command:
sudo apt list This command prints a list of all packages, including information about the version and architecture of the package. To determine if a particular package is installed, use this grep command to filter the output.
sudo apt list |grep package_name List only installed packages, enter:
sudo apt list --installed It may be useful to get a list of upgradeable packages before actually upgrading them:
sudo apt list --upgradeable search package (apt search)
This command allows you to search for a given package in the list of available packages:
sudo apt search package_name If found, the command returns packages whose names match the search term.
View package information (apt show)
Before removing or installing a new package, information about package dependencies, installation size, package source, and more can be useful.
To retrieve information about a given package, use the following show command:
sudo apt show package_name Thank you for reading! About "Linux system apt commonly used command what" this article is shared here, I hope the above content can have some help to everyone, so that we can learn more knowledge, if you think the article is good, you can share it to let more people see it!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.