apt-get install default installation location

In the Linux system, the location of the apt-get command to install the package by default is in the /usr directory. Specifically, the installed executable files will be stored in the /usr/bin directory, and the library files will be stored in the /usr/lib directory. At the same time, the corresponding configuration files and documents will also be stored in the /usr/share directory.

However, this is only the default installation location of the apt-get command, and the actual installation location can also be specified through command line parameters. For example, you can specify the installation path by using the --prefix parameter. If you want to modify the default installation location, you can use the following command:

sudo apt-get install --prefix=
where is the package to install, is the specified installation path.

Note: Modifying the default installation location may cause problems with the dependencies of the software package, so proceed with caution.

Specifically use dpkg -L + software name to view

The dpkg command is one of the basic tools used to query, install, and delete packages under Debian-based Linux distributions. where dpkg -L is an option of the dpkg command to list all files of the installed package.

Enter dpkg -L <package name> in the terminal to display all files and path information installed by the specified software package. For example, typing dpkg -L openssh-server will display a list of all files installed by the openssh-server package, as follows:

/.
/etc
/etc/ssh
/etc/ssh/moduli
/etc/ssh/sshd_config
/etc/ssh/ssh_config
/etc/logrotate.d/ssh
/etc/init.d
/etc/init.d/ssh
/etc/pam.d
/etc/pam.d/ssh
/usr
/usr/share
/usr/share/doc
/usr/share/doc/openssh-server
/usr/share/doc/openssh-server/changelog.Debian.gz
/usr/share/doc/openssh-server/README.Debian.gz
/usr/share/doc/openssh-server/TODO.Debian
/usr/share/doc/openssh-server/TODO.gz
/usr/share/doc/openssh-server/copyright
/usr/share/bug
/usr/share/bug/openssh-server
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/openssh-server
/usr/sbin
/usr/sbin/sshd
/usr/lib
/usr/lib/openssh
/usr/lib/openssh/sftp-server
/usr/lib/openssh/ssh -keysign
/usr/lib/openssh/sftp-server-udeb
/usr/lib/openssh/ssh-keysign-udeb
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/ssh.service
thus It can be seen that the dpkg -L option can easily query and check the files of the software package, and modify or delete these files when necessary.

Guess you like

Origin blog.csdn.net/weixin_37787043/article/details/129791996