Skip to main content

linux-apt-安装文件位置

dpkg 查看ubuntu apt安装软件的位置

使用远程docker开发环境, 重启后安装的软件都没了, 想要进行volume映射, 需要找到软件安装的位置. 不过看起来并不是只有bin文件夹, 就先放弃了.

dpkg - package manager for Debian

-L, --listfiles package-name...
List files installed to your system from package-name.

测试tmux和vim的安装位置, 可以发现并不只是bin, 还有其他文件被安装.

ubuntu@VM-8-16-ubuntu:~$ dpkg -L tmux
/.
/usr
/usr/bin
/usr/bin/tmux
/usr/share
/usr/share/doc
/usr/share/doc/tmux
/usr/share/doc/tmux/NEWS.Debian.gz
/usr/share/doc/tmux/README
/usr/share/doc/tmux/changelog.Debian.gz
/usr/share/doc/tmux/copyright
/usr/share/doc/tmux/example_tmux.conf
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/tmux.1.gz


ubuntu@VM-8-16-ubuntu:~$ dpkg -L vim
/.
/usr
/usr/bin
/usr/bin/vim.basic
/usr/share
/usr/share/bug
/usr/share/bug/vim
/usr/share/bug/vim/presubj
/usr/share/bug/vim/script
/usr/share/doc
/usr/share/doc/vim
/usr/share/doc/vim/NEWS.Debian.gz
/usr/share/doc/vim/changelog.Debian.gz
/usr/share/doc/vim/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/vim

Where are the packages installed with apt-get install in Docker containers?

https://stackoverflow.com/questions/35325372/where-are-the-packages-installed-with-apt-get-install-in-docker-containers

Since phusion/baseimage use Ubuntu

Ask the package management what files the package contains:

dpkg -L libgsl0ldbl

This shows the files simply copied to those locations. These files are marked as managed by the package management