Docker enters the container, apt replaces Alibaba source

Fedora and Red Hat have yum installation software, and Ubuntu has apt tool. Simply put, apt is a command way to install software for Ubuntu. (both yum and apt are just tools for installing software)

Comparison item rpm yum dpkg apt
series RedHat series RedHat series Debian series Debian series
the difference Package installation tool Dependency management tools Package installation tool Dependency management tools
Query installed rpm -qa yum list installed dkpg -l apt list –installed
installation rpm -i package.rpm or rpm -ivh  http://www.xxx.net/package.rpm yum install -y dpkg -i package.deb apt-get install package
Update rpm –U software.rpm yum update   apt upgrade
Remove package rpm -e [module1][module2]… yum -remove dpkg -r package apt remove package
Remove software package and configuration     dpkg -P apt purge package
Downloaded package storage location       /var/cache/apt/archives
Software installation default location rpm -ql     /usr/share
Executable file location /usr/bin     /usr/bin
Configuration file location /etc     /etc
lib file location /usr/lib     /usr/lib
manual /usr/share/doc      
Help document /usr/share/man      
Update

If you are connected to the Internet, you want to install software in the docker container: the docker container comes with apt

/etc/apt/sources.list Set the source of the software package
/etc/apt/apt.conf apt configuration file
/etc/apt/apt.conf.d/ apt's fragmented configuration file
/etc/apt/preferences Version parameters
/var/cache/apt/archives/ Store the downloaded software package
/var/cache/apt/archives/partial Store the software package being downloaded
/var/lib/apt/lists/ Store the downloaded software package details
/var/lib/apt/lists/partial/ Store the details of the software package being downloaded

Update the apt in the container and replace the source domain name in /etc/apt/sources.list with mirrors.aliyun.com

mirrors.aliyun.com

Then update: apt-get update

Then install it at will:

apt install vim 

Guess you like

Origin blog.csdn.net/shujuelin/article/details/109730280