Linux domestic operating system, UCA-system engineer learns necessary skills, uses dpkg to manage software packages, apt commands, intranet to obtain dependent packages and source code installation

 

Table of contents

​edit

1. Use dpkg to manage software packages

2.apt command

3. Obtain dependent packages from the intranet

4. Source installation


1. Use dpkg to manage software packages

The first method is of course to search the software installation package on the Internet, download and decompress it into software.

The second is what I will introduce next, the dpkg command, the full name of dpkg is called debian package, and the parameters can be as follows:

root@uos~#: man dpkg
root@uos~#: dpkg -l
root@uos~#: dpkg -I 
root@uos~#: dpkg -c
root@uos~#: dpkg -i
root@uos~#: dpkg -L
root@uos~#: dokg -s

-l (small L) This parameter means to list the software packages, dd deepin etc. are the installation packages independently developed by Tongxin

-L (big L) This parameter is to list what is installed in this software

-I This parameter is to view the software package (information)

root@uos~#: dpkg -I /home/tang/Desktop/vsftpd_3.0.3-12_amd64.deb 

  

You will find that you have viewed many files and source codes, including official website information, author information, etc.

-c This parameter is to check the contents of a .deb file.

-i means to install the package and is an installation command.

-s Display the information of the installed package. If it says install ok installed, then it is installed. If not, it means failure. Of course, it also includes other information, such as architecture and type.

root@uos~#: dpkg -l (must be entered completely to query)
root@uos~#: dpkg -r vsftpd
root@uos~#: dpkg -P vsftpd

Both -r and -P are commands to delete software packages, but -r deletes only software, and -P deletes all configuration files.

All in all, dpkg can only install general software packages, and it is difficult to meet the needs of other complex and matryoshka-style software packages.

2.apt command

Apt is an installation command. It is an advanced packaging tool. It does not have dependencies like dpkg, and it will automatically form dependencies.

root@uos:~# apt install apache2^C 
root@uos:~# ping www.baidu.com 
root@uos:~# apt install apache2 (An error occurred, this is because it was used for dpkg before, and the same project cannot apt Mixed with dpkg) 
root@uos:~# dpkg -P apache2 apache2-bin (uninstall first, then install) 
root@uos:~# apt install apache2

  

The following is to uninstall and reinstall, and it will be successful.

  

Next, let’s introduce the software warehouse

root@uos~#: vim /etc/apt/sources.list 
root@uos~#: apt list | wc -l 
root@uos~#: apt update 
root@uos~#: apt install -y apache2 (this is not Need to answer yes/no)

https://professional-packages.chinauos.com/ (index warehouse storage location) desktop-professional eagle

This is also a necessary prerequisite for using the apt installation command.

The next step is about the corresponding uninstallation operation under the apt installation command

root@uos~#: apt purge apache2 (the system will not automatically delete dependent packages) 
root@uos~#: apt autoremove -y (including all dependent packages have been uninstalled) 
root@uos~#: apt upgrade (use with caution, production line To pursue stability) 
root@uos~#: apt full-upgrade 
root@uos~#: apt install -f (forced installation)

able to pass

root@uos~#: apt search uos-bro
root@uos~#: apt install uos-browser-stable
root@uos~#: apt search nginx
root@uos~#: apt show nginx

3. Obtain dependent packages from the intranet

It is best to operate on a virtual machine. The new system is relatively clean and has fewer dependent packages.

root@uos~#: ls -l /var/cache/apt/archives/

   

root@uos~#: apt clean (clear apt dependency package) 
root@uos~#: apt install -d apache2

It will not really install apache2, but save the software package to the specified location, -d means only downloading the package without installing the package

root@uos~#: mkdir /home/tangyimin/Desktop/apache2
root@uos~#: cp /var/cache/apt/archives/*.deb /home/tangyimin/Desktop/apache2
root@uos~#: dpkg -l | grep apache2
root@uos~#: dpkg -i /home/tangyimin/Desktop/apache2/*.deb
root@uos~#: dpkg -l | grep apache2

 

Can view system services

root@uos~#: systemctl status apache2

 

 

4. Source installation

root@uos~#: ls -l /home/qin/Desktop/

nginx-1.14.2tar.gz is the source package we want, it is directly packaged and installed, and it is directly given to us. Note that source packages are not restricted by the operating system. It is difficult, but there are more things to choose, more flexible and free.

 

root@uos~#: tar xzvf /home/qin/Desktop/nginx-1.14.2.tar.gz -C /tmp/
root@uos~#: cd /tmp/nginx-1.14.2/
root@uos: /tmp/nginx-1.14.2# ll

  

Among them, the two files README and configure are very important. configure is an executable file, that is, a configuration file, which means that before the source code is installed, we need to configure the original code environment; the README file will introduce some content of the software

root@uos: /tmp/nginx-1.14.2# vim README

 

 

But it will show that there are too many contents, it is recommended that you check the official website. . .

root@uos: /tmp/nginx-1.14.2# configure

 

It's a pity that many of the above things may not be understandable, many shell commands and parameters, generated variables, and many scripts are currently difficult for us college students to understand.

root@uos: /tmp/nginx-1.14.2# ./configure --help

 

 

If you want to know the meaning, it is recommended to go to Baidu or CSDN to find the answer.

But how can it be used or operated to effectively carry out orders?

root@uos: /tmp/nginx-1.14.2# ./cnfigure --prefix=/opt/qinnginx 
root@uos: /tmp/nginx-1.14.2# make install (the most serious installation)

The make install installation is very fast, because it is to transfer the files under Linux to the designated location, so the speed will be very fast. Of course, you can use ls -l to see if the installation is complete.

root@uos: /tmp/nginx-1.14.2# ls -l /opt/qinnginx/
root@uos: /tmp/nginx-1.14.2# cd /opt/qinnginx/
root@uos: /opt/qinnginx# ls -l

 

conf is all configuration files; html is all web files; logs is all log files; sbin is all commands. (not detailed here)

root@uos: /opt/qinnginx/sbin# ./nginx 
root@uos: /opt/qinnginx/sbin# ps aux | grep nginx

 

 

 

 

Guess you like

Origin blog.csdn.net/Williamtym/article/details/131341478