Ubuntu how to show contents of a package before installing?

By | April 3, 2015

If you want to know what files are going to be installed/placed on your computer when you download a package for Ubuntu, you can run this command:
apt-file list package_name

If you run this and get this error: The program ‘apt-file’ is currently not installed. You can install it by typing: sudo apt-get install apt-file, then you have to find install apt-file by typing in: sudo apt-get install apt-file just like the message said.

Next you want to type: sudo apt-file update.

From Wikipedia: “This command attempts to fetch the Contents-.gz files from the remote sources that are specified in /etc/apt/sources.list. Once this is done, the database can be queried for a list of packages that contain a file.”

eg:
user@kfc:~/code$ apt-file list libcurl4-openssl-dev
libcurl4-openssl-dev: /usr/bin/curl-config
libcurl4-openssl-dev: /usr/include/curl/curl.h
libcurl4-openssl-dev: /usr/include/curl/curlbuild.h
libcurl4-openssl-dev: /usr/include/curl/curlrules.h
libcurl4-openssl-dev: /usr/include/curl/curlver.h
libcurl4-openssl-dev: /usr/include/curl/easy.h
libcurl4-openssl-dev: /usr/include/curl/mprintf.h
libcurl4-openssl-dev: /usr/include/curl/multi.h
libcurl4-openssl-dev: /usr/include/curl/stdcheaders.h
libcurl4-openssl-dev: /usr/include/curl/typecheck-gcc.h
libcurl4-openssl-dev: /usr/lib/x86_64-linux-gnu/libcurl.a
libcurl4-openssl-dev: /usr/lib/x86_64-linux-gnu/libcurl.la
libcurl4-openssl-dev: /usr/lib/x86_64-linux-gnu/libcurl.so
libcurl4-openssl-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/libcurl.pc
libcurl4-openssl-dev: /usr/share/aclocal/libcurl.m4
libcurl4-openssl-dev: /usr/share/doc/libcurl4-openssl-dev/NEWS.Debian.gz
libcurl4-openssl-dev: /usr/share/doc/libcurl4-openssl-dev/changelog.Debian.gz
libcurl4-openssl-dev: /usr/share/doc/libcurl4-openssl-dev/copyright
libcurl4-openssl-dev: /usr/share/man/man1/curl-config.1.gz
user@kfc:~/code$

Leave a Reply

Your email address will not be published. Required fields are marked *