How to install and uninstall software in ubuntu
Use 'dselect 'or 'aptitude' for user-friendly package management; Type dpkg-Dhelp for a list of dpkg debug flag values; Type dpkg -- force-help for a list of forcing options; Type dpkg-deb -- help for help about manipulating *. deb files; Type dpkg -- license for copyright license and lack of warranty (gnu gpl)
Options marked Produce a lot of output-pipe it through 'less 'or 'more '!
4. You can use apt to unload the dpkg security package, or vice versa.
5. Like apt-get, aptitude is an extremely powerful package management tool in Debian and its derivative systems. Unlike apt-get, aptitude is better in dealing with dependency issues. For example, aptitude deletes the packages it depends on when deleting a package. In this way, useless packages will not be left in the system, and the whole system will be cleaner. The following are some common aptitude commands that I have summarized for your reference only.
Command function Aptitude update updates the list of available packages Available packages for aptitude upgrade Aptitude dist-upgrade: upgrade the system to the new release Aptitude install pkgname installation package Aptitude remove pkgname Delete package Aptitude purge pkgname: Delete the package and its configuration file Aptitude search string search package Aptitude show pkgname displays the package details Aptitude clean: delete downloaded package files Aptitude autoclean only deletes expired package files
You can also use aptitude in text interface mode.
6. Common apt commands
Apt-cache search # ------ (package search package) Apt-cache show # ------ (package obtains package information, such as description, size, and Version) Sudo apt-get install # ------ (package installation package) Sudo apt-get install # ----- (package--reinstall re-installation package) Sudo apt-get-f install # ----- (Force installation? # "-F = -- fix-missing" should be fixed and installed ...) Sudo apt-get remove # ----- (delete package) Sudo apt-get remove--purge # ------ (delete a package, including deleting a configuration file) Sudo apt-get autoremove -- purge # ---- (package deletes packages and their dependent packages + configuration files (only valid for 6.10, it is strongly recommended )) Sudo apt-get update # ------ update source Sudo apt-get upgrade # ------ Update installed packages Sudo apt-get dist-upgrade # --------- upgrade the system Sudo apt-get dselect-upgrade # ------ upgrade with dselect Apt-cache depends # ------- (package knows how to use dependencies) Apt-cache rdepends # ------ (does package know a specific dependency? # Check which packages the package depends on ...) Sudo apt-get build-dep # ------ (package installation related compilation environment) Apt-get source # ------ (package downloads the source code of the package) Sudo apt-get clean & sudo apt-get autoclean # -------- clear the archive of downloaded files & only clear outdated packages Sudo apt-get check # ------- check for any corrupted Dependencies 7. dpkg introduction and command usage:
Introduction Dpkg is the Debian intermediate Software Package Manager, similar to RPM.
Dpkg is the mainstay of the Debian software package management system. It is responsible for safely uninstalling, configuring, and maintaining installed software packages. it is also the backend of many software package management tools in the Debian system. for more information about dpkg, see: http://www.dpkg.org
All packages in the system are stored in the/var/lib/dpkg/directory. The subdirectory "/var/lib/dpkg/info" is used to save the configuration file list of each software package.
. Conffiles records the configuration file list of the software package. . List stores the file list in the software package. You can find the specific installation location of the file in the software package from the. list information.
. Md5sums records the md5 information of the software package. This information is used for package verification.
The. prerm script runs before the Debian report package. The main function is to stop the service acting on the package to be upgraded until the package is installed or upgraded.
The. postinst script is used to complete the configuration after the Debian package is unbundled. It is usually used to execute commands related to the Installed Package and restart the service.
The/var/lib/dpkg/available file contains the description of the software package, which includes all the software packages in the Debian installation source used by the current system, these include installed and uninstalled software packages in the current system.
Dpkg Query all deb packages installed in the current system The dpkg-l command is used to query information about all deb packages installed in the current system. You can perform more complex queries through less and grep.
For example, find the vim-related software package, dpkg-l | grep-ivim
(If iU is found, the software package is not successfully installed, and ii indicates that the installation is successful)
View Details of installed software packages Run the dpkg-s command to view the details of the software package, including the version and dependency.
File installed by the software package installed in the query system The dpkg-L command is used to query the installation files of the software packages installed in the system and the installation files.
TIPS: How can I check where the software is packaged? Use apt-get install *
How can we see where the software is packaged? Dpkg-L package-name | more
Which package does a file belong to in the query system? The dpkg-S command is used to understand which package the current software belongs.
Query uninstalled Information Query details of uninstalled software packages The dpkg-I command is used to view the details of a software package that is not installed, so that you can see whether the software package needs to be installed.
Query the files contained in the deb package file Dpkg-c displays the list of files not installed with the deb package, and the installation location
Install software package Install deb Software Package Dpkg-I manually install the deb package to the system, but sometimes there is a Dpends relationship. We recommend that you use apt-get to install it. If the software is not successfully installed due to the relationship between Dpends and dpkg-I, you can use apt-get-f install to solve the problem.
Solve the Problem of Dpends when dpkg-I installs the deb package Apt-get-f install solves the Dpends problem. Example: dpkg-I lftp_3.1.3-1_i386.deb
Selecting previusly deselected package lftp. (Reading database... 20654 files and directories currently installed .) Unpacking lftp (from lftp_3.1.3-1_i386.deb )... Dpkg: dependency problems prevent configuration of lftp: Lftp depends on libexpat1 (<= 1.95.8); however Dpkg: error processing lftp (-- install) Dependency problems-leaving unconfigured Errors were encountered while processing: Lftp // Lftp package installation failed Dpkg-l | grep lftp IU lftp 3.1.3-1 Sophisticated Command-line FTP/HTTP client p // "Dpkg-l" indicates that the lftp package is not successfully installed. (IU indicates that the installation is not successful, ii indicates that the installation is successful)
Use apt-get-f install
Uninstall deb Software Package Dpkg-r is used to uninstall a specified software package. This command only uninstalls the software package and installs it in the system, instead of deleting the configuration file of the software package. however, the software package is stored in the system and can be provided for later use when installing the software package. For example, dpkg-r prozilla is removed and then viewed with dpkg-l | grep prozilla.
The rc proc 1.3.6-3woody3 multi-thraded download accelerator is displayed.
Indicates that the package has been uninstalled, but the configuration file is still in the "rc" Table configuration file.
Uninstall the software package and clear the configuration file Dpkg-P is used to uninstall the software package and delete the configuration file. dpkg-P cannot solve the Dpends problem. We recommend that you use the apt-get operation when uninstalling the software package.
Reconfigure the Software Package For many software packages (especially system and server software packages) in the Debian system, a dialog box is displayed when the software package is installed for the first time, prompting you to enter necessary configuration information. when you need to configure the software package again, you can use dpkg-reconfigure to configure the specified software package. For example, dpkg-reconfigure locales
Alien package Conversion Tool
What if we have a favorite RPM package but no deb version ~? It can be converted or directly installed through alien. This little guy is very convenient!
The basic commands are as follows: First install alien through apt-get install. Then Alien-I name-of-the-pakage.rpm/* for direct installation of rpm packages Alien-d, -- to-deb/* Make debian packages, This is the default Example: alien-d package. rpm Alien-r, -- to-rpm/* Make rpm packages
Example: alien-r package. deb Alien-p, -- to-pkg/* Make Solaris pkg packages Alien -- to-slp/* Make slp packages Alien-t, -- to-tgz/* Make tgz packages Alien-T Detection
Alien -- patch = patch |
Method 1: Install and uninstall the software in ubuntu. deb package: Code: sudo dpkg-I package_file.deb anti-installation. deb package: Code: sudo dpkg-r package_name2. installation through apt-get: Installation code: sudo apt-get install package_name: sudo apt-get remove package_name3, sudo dpkg-p package_name uninstall the software package and its configuration file, but the dependency cannot be solved! Sudo aptitude purge pkgname uninstall the software package, its configuration file, and dependency package!
Clear the remaining configuration files of all deleted packages
Dpkg-l | grep ^ rc | awk '{print $2}' | sudo xargs dpkg-P
If the following error is reported, it indicates that no configuration file is left in your system.
--------------------------------------------------------------------------------
Dpkg: -- purge needs at least one package name argument
Type dpkg -- help for help about installing and deinstalling packages
Sudo apt-get remove softwarename