Ubuntu experience: (install the software package)

Source: Internet
Author: User
Tags gtk introductions nameserver
Linux and Unix2012-12-06
17: 40 19 people read comments (0) collect reports

1. First, you must configure the network.
There are a lot of interesting introductions on the Internet. Most of them need to remove the NetworkManager.
This is mainly because it overwrites the resolv. conf file every time the system is restarted. As a result, you need to manually modify this file for use.

Add echo "nameserver ***">/etc/resolv. conf to/etc/rc. Local.

2. Installation
With the network, you can do whatever you like.
How to install it?
Sudo apt-Get install *

3. Remove sudo
Just unlock the root user.

4. query the software packages
Apt-cache search <Name>
For example, Apt-cache search MySQL

A detailed article on software package management is attached:
Ubuntu is easy to use, and the most commendable is the way it installs software. A command: sudo apt-Get install xxx can help you solve almost all the software installation problems. But sometimes you may have such a requirement to check whether or not a software package is installed and where it is installed... Let's introduce the Ubuntu software package management method.

I. Ubuntu uses the Debian Package Manager dpkg to manage software packages. For example, all packages in RPM./Var/lib/dpkg/
Directory
Its subdirectory/var/lib/dpkg/info is used to save the configuration file list of each software package:
(1). conffiles records the configuration file list of the software package.
(2). 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.
(3). The md5sums records the MD5 information of the software package. This information is used for package verification.
(4). the prerm script runs before the Debian package unpacks. The main function is to stop the service acting on the package to be upgraded until the package is installed or upgraded.
(5) The postinst script is used to complete the configuration after the Debian package is unwrapped. 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.

The/var/Cache/APT/archives directory is the temporary storage path of the software package when you use apt-Get install to install the software.

/Etc/APT/sources. list stores the software source site. When you execute sudo apt-Get install XXX, UBUNTU downloads the software package from these sites and installs it locally.

Ii. Example of related commands:
(1) view the installation content of a software package
Dpkg-l xxx

(2) find software packages in the software library
Apt-cache search Regular Expression

(3) display the statistics of the system installation package
Apt-Cache stats

(4) display the names of all available software packages of the system
Apt-Cache pkgnames

(5) display details of a software package
Apt-Cache show xxx

(6) Find the package of a file
Apt-file search xxx

(7) check which software packages have been installed
Dpkg-l

(8) query which software packages a software depends on
Apt-Cache depends xxx

(9) query which software packages depend on a software.
Apt-Cache rdepends xxx

(10) Add a CD Source
Sudo apt-CDROM add
Note: When installing the update package, you should first find the update package on the Ubuntu Cd (this will be very useful if you cannot install/update the software online, but have the Ubuntu dvd iso)

(11) system upgrade
Sudo apt-Get update

(12) Clear the remaining configuration files of all deleted software packages
Dpkg-L | grep ^ RC | awk '{print $2}' | sudo xargs dpkg-P

(13) automatic processing of H files is missing during compilation
Sudo auto-apt run./configure

(14) view the temporary storage directory of the software package downloaded during software installation
Ls/var/Cache/APT/Archives

(15) back up the list of all software packages installed on the current system
Dpkg -- Get-selections | grep-V deinstall> ~ /Somefile

(16) Restore all packages from the list file of the installation package backed up above
Dpkg -- Set-selections <~ /Somefile
Sudo dselect

(17) Clear old software caches
Sudo apt-Get autoclean

(18) Clear all software caches
Sudo apt-Get clean

(19) delete isolated software that is no longer used by the System
Sudo apt-Get autoremove

(20) view the address of the software package on the server
Apt-get-QQ -- print-Uris Install SSH | cut-d \ '-F2

The utf8 character set in the Ubuntu environment, the Windows Default character set is GBK, And the Ubuntu default character set is UTF-8, which causes garbled characters when you use Telnet to log on to the remote server or view Windows files. Set the Ubuntu environment to GBK or gb2312, or set the software to correctly display Chinese characters. The following uses the GBK character set as an example to describe:

1. Modify the default Ubuntu character set to GBK.
1. First set sudo VI/var/lib/locales/supported. d/local
Add a row of zh_cn.gbk GBK
Sudo locale-gen generates locale

2. Modify the Ubuntu Character Set
Method 1: Modify the. profile file in the user directory and add the following content:
Language = "zh_cn: Zh: en_us: en"
Lang = zh_cn.gbk
Log on again.
This method is only valid for this user.
Method 2: Modify/etc/environment and add the following content:
Language = "zh_cn: Zh: en_us: en"
Lang = zh_cn.gbk
Restart X.
This method is valid for users who have not set Lang and language environment variables.

2. Set the software name to display the GBK normally
This requires the software to support multi-character encoding. The most common is IE and other browsers. You can set the encoding to display the GBK character set. Some software in Ubuntu also supports this function. Taking Ubuntu's End-End program as an example, you can enable it to normally display GBK encoding by clicking the menu in the termial window: terminal-> set character encoding-> select GBK.

These days, I suddenly remembered to learn how to use the Debian system. First of all, it was software management. Here I collected some common commands for package management, and I will find and learn them later.
1. dpkg package management tool 
Dpkg -- info "package name" -- list the package names after the package is unwrapped.
Dpkg-l -- list all packages in the current system. You can use it with the parameter less in the split screen view.
Dpkg-L | grep-I "package name" -- view the packages associated with "package name" in the system.
Dpkg-S: query the details of installed packages.
Where the installed software package is installed in the dpkg-l query system.
Which package does dpkg-s query system belong to a file.
Dpkg-I queries the detailed information of the Deb package. After downloading a software package to a local computer, check whether it is installed ).
Dpkg-I install the software package manually (this command does not solve the dependency problem before the Software Package). If you encounter software dependency problems when installing a software package, you can use apt-get-F install to solve the reliability problem.
Dpkg-r uninstall the software package. The configuration file does not exist.
Dpkg-P all unmount (but it still cannot solve the dependency problem of the software package)
Dpkg-reconfigure Reconfiguration
2. APT advanced package management tools


(1) "synaptic" of GTK graphics, which is the front-end tool of apt.
(2) "aptitude", which is also the front-end tool of apt.
You can use the apt management tool to manage packages by using the following methods:
(1) Use the installation disk as the source. The method is as follows:
Apt-CDROM ident scan information of the disc
Apt-CDROM Add add a CD Source
(2) The most common method is to add the source to/etc/APT/source. list, and then update the apt-Get Update column.


Common commands of APT management tools
Apt-Cache can be used with different sub-commands and parameters to find and display software, package information, and package trust relationships.
Apt-Cache stats displays statistics of all the debain data sources used by the current system.
Apt-cache search + "package name" to find related software packages.
Apt-Cache show + "package name" to display the details of the specified software package.
Apt-Cache depends + "package name", you can find the dependency of the software package.
Apt-Get upgrade: update all packages in the system to the latest version.
Apt-Get install installation package
Apt-Get -- reindtall install reinstall the Software Package
Apt-Get remove uninstall software package
Apt-Get -- purge remove uninstall software package completely
Apt-Get clean clear useless software packages
Before using the command apt-Get install, download the software package to/var/Cache/APT/archives and then install it. so we can use apt-Get clean to clear software packages in the/var/Cache/APT/archives directory.
Source code package installation
Apt-Cache showsrc: Find the file information of the source package (before download)
Apt-Get source to download the source package.
Apt-Get build-dep + "package name" build the compiling environment of the source package.

3. Some basic usage of APT-Get and dpkg
Apt-Get install packagename # install a new software package
Apt-Get remove packagename # uninstall an installed software package (keep the configuration file)
Apt-Get -- purge remove packagename # uninstall an installed software package (delete the configuration file)
Dpkg -- force-all -- purge packagename # force uninstall, high risk!
Apt-Get upgrade # update all installed software packages
Apt-Get dist-upgrade # upgrade the system to the new version
Apt-Get clean # Clear all software caches
Apt-Get autoclean # Clear Old Version Software Cache
Apt-Get autoremove # Delete isolated software that is no longer used by the System
Apt-CDROM add # Add a CD Source
Auto-apt run./configure # automatic processing of H files is missing during compilation
Apt-cache search Regular Expression # search strings in the package list
Dpkg-l Regular Expression # list all software packages that match the pattern
Dpkg-L | grep ^ RC | awk '{print $2}' | # xargs dpkg-P # Clear the residual configuration files of all deleted packages
Dpkg-I, -- install XXX. Deb # Install XXX. Deb package: dpkg -- install stardict_3.0.1-1_i386.deb
Dpkg-R, -- remove,-P, -- purge package... |-A | -- pending # delete a software package: dpkg-r stardict

1. First, you must configure the network.
There are a lot of interesting introductions on the Internet. Most of them need to remove the NetworkManager.
This is mainly because it overwrites the resolv. conf file every time the system is restarted. As a result, you need to manually modify this file for use.

Add echo "nameserver ***">/etc/resolv. conf to/etc/rc. Local.

2. Installation
With the network, you can do whatever you like.
How to install it?
Sudo apt-Get install *

3. Remove sudo
Just unlock the root user.

4. query the software packages
Apt-cache search <Name>
For example, Apt-cache search MySQL

A detailed article on software package management is attached:
Ubuntu is easy to use, and the most commendable is the way it installs software. A command: sudo apt-Get install xxx can help you solve almost all the software installation problems. But sometimes you may have such a requirement to check whether or not a software package is installed and where it is installed... Let's introduce the Ubuntu software package management method.

I. Ubuntu uses the Debian Package Manager dpkg to manage software packages. For example, all packages in RPM./Var/lib/dpkg/
Directory
Its subdirectory/var/lib/dpkg/info is used to save the configuration file list of each software package:
(1). conffiles records the configuration file list of the software package.
(2). 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.
(3). The md5sums records the MD5 information of the software package. This information is used for package verification.
(4). the prerm script runs before the Debian package unpacks. The main function is to stop the service acting on the package to be upgraded until the package is installed or upgraded.
(5) The postinst script is used to complete the configuration after the Debian package is unwrapped. 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.

The/var/Cache/APT/archives directory is the temporary storage path of the software package when you use apt-Get install to install the software.

/Etc/APT/sources. list stores the software source site. When you execute sudo apt-Get install XXX, UBUNTU downloads the software package from these sites and installs it locally.

Ii. Example of related commands:
(1) view the installation content of a software package
Dpkg-l xxx

(2) find software packages in the software library
Apt-cache search Regular Expression

(3) display the statistics of the system installation package
Apt-Cache stats

(4) display the names of all available software packages of the system
Apt-Cache pkgnames

(5) display details of a software package
Apt-Cache show xxx

(6) Find the package of a file
Apt-file search xxx

(7) check which software packages have been installed
Dpkg-l

(8) query which software packages a software depends on
Apt-Cache depends xxx

(9) query which software packages depend on a software.
Apt-Cache rdepends xxx

(10) Add a CD Source
Sudo apt-CDROM add
Note: When installing the update package, you should first find the update package on the Ubuntu Cd (this will be very useful if you cannot install/update the software online, but have the Ubuntu dvd iso)

(11) system upgrade
Sudo apt-Get update

(12) Clear the remaining configuration files of all deleted software packages
Dpkg-L | grep ^ RC | awk '{print $2}' | sudo xargs dpkg-P

(13) automatic processing of H files is missing during compilation
Sudo auto-apt run./configure

(14) view the temporary storage directory of the software package downloaded during software installation
Ls/var/Cache/APT/Archives

(15) back up the list of all software packages installed on the current system
Dpkg -- Get-selections | grep-V deinstall> ~ /Somefile

(16) Restore all packages from the list file of the installation package backed up above
Dpkg -- Set-selections <~ /Somefile
Sudo dselect

(17) Clear old software caches
Sudo apt-Get autoclean

(18) Clear all software caches
Sudo apt-Get clean

(19) delete isolated software that is no longer used by the System
Sudo apt-Get autoremove

(20) view the address of the software package on the server
Apt-get-QQ -- print-Uris Install SSH | cut-d \ '-F2

The utf8 character set in the Ubuntu environment, the Windows Default character set is GBK, And the Ubuntu default character set is UTF-8, which causes garbled characters when you use Telnet to log on to the remote server or view Windows files. Set the Ubuntu environment to GBK or gb2312, or set the software to correctly display Chinese characters. The following uses the GBK character set as an example to describe:

1. Modify the default Ubuntu character set to GBK.
1. First set sudo VI/var/lib/locales/supported. d/local
Add a row of zh_cn.gbk GBK
Sudo locale-gen generates locale

2. Modify the Ubuntu Character Set
Method 1: Modify the. profile file in the user directory and add the following content:
Language = "zh_cn: Zh: en_us: en"
Lang = zh_cn.gbk
Log on again.
This method is only valid for this user.
Method 2: Modify/etc/environment and add the following content:
Language = "zh_cn: Zh: en_us: en"
Lang = zh_cn.gbk
Restart X.
This method is valid for users who have not set Lang and language environment variables.

2. Set the software name to display the GBK normally
This requires the software to support multi-character encoding. The most common is IE and other browsers. You can set the encoding to display the GBK character set. Some software in Ubuntu also supports this function. Taking Ubuntu's End-End program as an example, you can enable it to normally display GBK encoding by clicking the menu in the termial window: terminal-> set character encoding-> select GBK.

These days, I suddenly remembered to learn how to use the Debian system. First of all, it was software management. Here I collected some common commands for package management, and I will find and learn them later.
1. dpkg package management tool 
Dpkg -- info "package name" -- list the package names after the package is unwrapped.
Dpkg-l -- list all packages in the current system. You can use it with the parameter less in the split screen view.
Dpkg-L | grep-I "package name" -- view the packages associated with "package name" in the system.
Dpkg-S: query the details of installed packages.
Where the installed software package is installed in the dpkg-l query system.
Which package does dpkg-s query system belong to a file.
Dpkg-I queries the detailed information of the Deb package. After downloading a software package to a local computer, check whether it is installed ).
Dpkg-I install the software package manually (this command does not solve the dependency problem before the Software Package). If you encounter software dependency problems when installing a software package, you can use apt-get-F install to solve the reliability problem.
Dpkg-r uninstall the software package. The configuration file does not exist.
Dpkg-P all unmount (but it still cannot solve the dependency problem of the software package)
Dpkg-reconfigure Reconfiguration
2. APT advanced package management tools


(1) "synaptic" of GTK graphics, which is the front-end tool of apt.
(2) "aptitude", which is also the front-end tool of apt.
You can use the apt management tool to manage packages by using the following methods:
(1) Use the installation disk as the source. The method is as follows:
Apt-CDROM ident scan information of the disc
Apt-CDROM Add add a CD Source
(2) The most common method is to add the source to/etc/APT/source. list, and then update the apt-Get Update column.


Common commands of APT management tools
Apt-Cache can be used with different sub-commands and parameters to find and display software, package information, and package trust relationships.
Apt-Cache stats displays statistics of all the debain data sources used by the current system.
Apt-cache search + "package name" to find related software packages.
Apt-Cache show + "package name" to display the details of the specified software package.
Apt-Cache depends + "package name", you can find the dependency of the software package.
Apt-Get upgrade: update all packages in the system to the latest version.
Apt-Get install installation package
Apt-Get -- reindtall install reinstall the Software Package
Apt-Get remove uninstall software package
Apt-Get -- purge remove uninstall software package completely
Apt-Get clean clear useless software packages
Before using the command apt-Get install, download the software package to/var/Cache/APT/archives and then install it. so we can use apt-Get clean to clear software packages in the/var/Cache/APT/archives directory.
Source code package installation
Apt-Cache showsrc: Find the file information of the source package (before download)
Apt-Get source to download the source package.
Apt-Get build-dep + "package name" build the compiling environment of the source package.

3. Some basic usage of APT-Get and dpkg
Apt-Get install packagename # install a new software package
Apt-Get remove packagename # uninstall an installed software package (keep the configuration file)
Apt-Get -- purge remove packagename # uninstall an installed software package (delete the configuration file)
Dpkg -- force-all -- purge packagename # force uninstall, high risk!
Apt-Get upgrade # update all installed software packages
Apt-Get dist-upgrade # upgrade the system to the new version
Apt-Get clean # Clear all software caches
Apt-Get autoclean # Clear Old Version Software Cache
Apt-Get autoremove # Delete isolated software that is no longer used by the System
Apt-CDROM add # Add a CD Source
Auto-apt run./configure # automatic processing of H files is missing during compilation
Apt-cache search Regular Expression # search strings in the package list
Dpkg-l Regular Expression # list all software packages that match the pattern
Dpkg-L | grep ^ RC | awk '{print $2}' | # xargs dpkg-P # Clear the residual configuration files of all deleted packages
Dpkg-I, -- install XXX. Deb # Install XXX. Deb package: dpkg -- install stardict_3.0.1-1_i386.deb
Dpkg-R, -- remove,-P, -- purge package... |-A | -- pending # delete a software package: dpkg-r stardict

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.