In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to use the dpkg command in the Ubuntu system. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
Dpkg is used to manage the deb package of the system, which can be installed, uninstalled, deb packaged, deb decompressed and other operations. Related apt-get tools can be downloaded and installed online with deb package.
Parameters:
-I: install the package
-r: delete the software package
-P: delete the configuration file of the software package while deleting it
-L: displays the files associated with the package
-l: displays a list of installed packages
-- unpack: unlock the software package
-c: displays a list of files in the package
-- confiugre: configure the package.
Example 1
The code is as follows:
Dpkg-I package.deb # installation package
Dpkg-r package # delete package
Dpkg-P package # delete package (including configuration files)
Dpkg-L package # lists the files associated with the package
Dpkg-l package # shows the version of the package
Dpkg-- unpack package.deb # unlock the contents of the deb package
Dpkg-S keyword # searches the contents of the package to which it belongs
Dpkg-l # lists currently installed packages
Dpkg-c package.deb # lists the contents of the deb package
Dpkg-configure package # configuration package
Example 2
The code is as follows:
# dpkg-I package # installation package
# dpkg-R / usr/local/src # install all packages in a directory
# dpkg-- unpack package # unlock a package. If used with-R, the parameter can be a directory.
# dpkg-configure package # reconfigure and release the package
# dpkg-r package # Delete package
# dpkg-merge-avail # merge package
# dpkg-P # Delete package, including configuration file
# dpkg-A package # read software information from the software package
# dpkg-Information on update-avail # alternative software packages
# dpkg-forget-old-unavail # Delete the package information of Uninstall
# dpkg-- clear-avail # Delete the Avaliable information of the package
# dpkg-C # find only partially installed software packages
# dpkg-- compare-versions ver1 op ver2 # compare the differences between different versions of the same package
# dpkg-b directory [filename] # create a deb file
# dpkg-c filename # displays a directory of Deb files
# dpkg-p package # displays the details of the package
# dpkg-S filename-search-pattern # search for files in the specified package (fuzzy query)
# dpkg-L package # displays the file directory information of a package installed into the system
# dpkg-s package # report the status information of the specified package
# dpkg-l # displays all installed Deb packages, along with the version number and a short description
An example of locating a software package:
The way to locate a package is to know the name of a key file in the package. For example, if you need a ".h" header file when you compile, look for the package that provides it, and you can run:
The code is as follows:
# dpkg-S stdio.h
Libc6-dev: / usr/include/stdio.h
Libc6-dev: / usr/include/bits/stdio.h
Perl: / usr/lib/perl/5.6.0/CORE/nostdio.h
Or:
The code is as follows:
# dpkg-S / usr/include/stdio.h
Libc6-dev: / usr/include/stdio.h
It is useful to understand the package names of the installed software in the system, for example, when you want to clean up the hard disk space, you can run:
The code is as follows:
# dpkg-l | grep mozilla
Ii mozilla-browse 0.9.6-7 Mozilla Web Browser
The disadvantage of this command is that it "truncates" the name of the package. In the above example, the full name of the package is mozilla-browser, and the COLUMNS environment variable can be used to solve this problem:
The code is as follows:
[kov] @ [couve] $COLUMNS=132 dpkg-l | grep mozilla
Ii mozilla-browser 0.9.6-7 Mozilla Web Browser-core and browser
Or appear like this:
The code is as follows:
# apt-cache search "Mozilla Web Browser"
Mozilla-browser-Mozilla Web Browser
After reading the above, do you have any further understanding of how to use the dpkg command in the Ubuntu system? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.