LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Distributions (http://www.linuxquestions.org/questions/linux-distributions-5/)
-   -   how to read installation scripts in debian apt suite? (http://www.linuxquestions.org/questions/linux-distributions-5/how-to-read-installation-scripts-in-debian-apt-suite-940836/)

doru 04-20-2012 09:10 AM

how to read installation scripts in debian apt suite?
 
How can I read installation scripts (pre install, post install, pre remove, post remove) using the apt - dpkg suite?

I am sorry that I could not find this on the Internet.

zakame 04-20-2012 10:42 AM

The {pre,post}{inst,rm} scripts for an package are located under /var/lib/dpkg/info , e.g. for the "xml-core" package, the scripts are at /var/lib/dpkg/info/xml-core.{pre,post}{inst,rm} . Also in that directory are the file list and md5sums for each package installed.

For uninstalled packages, you can check the Debian Package Tracking System page for the source package, and look for either the source package archive, or if there's a VCS associated with the package, you can browse the VCS instead.

doru 04-20-2012 02:48 PM

Quote:

Originally Posted by zakame (Post 4658450)
The {pre,post}{inst,rm} scripts for an package are located under /var/lib/dpkg/info , e.g. for the "xml-core" package, the scripts are at /var/lib/dpkg/info/xml-core.{pre,post}{inst,rm} . Also in that directory are the file list and md5sums for each package installed.

For uninstalled packages, you can check the Debian Package Tracking System page for the source package, and look for either the source package archive, or if there's a VCS associated with the package, you can browse the VCS instead.

Thank you very much!

I also found in manuals that
Code:

apt-get source package-name
could download the sources and extract the files, and
Code:

apt-get --download-only install package-name
dpkg-deb -x /var/cache/apt/archives/package-name directory

could be used to read scripts of uninstalled packages. What do you think?

zakame 04-20-2012 09:12 PM

Yep, that's another way, cool of you to find it out on your own! :)

Just make sure you have a 'deb-src' line matching your existing 'deb' lines in your /etc/apt/sources.list for that to work though, e.g.

Code:

deb-src http://ftp.us.debian.org/debian squeeze main

doru 04-21-2012 04:56 AM

Quote:

Originally Posted by zakame (Post 4658849)
Yep, that's another way, cool of you to find it out on your own! :)

Just make sure you have a 'deb-src' line matching your existing 'deb' lines in your /etc/apt/sources.list for that to work though, e.g.

Code:

deb-src http://ftp.us.debian.org/debian squeeze main

Thanks. I prefer to ask somebody before I play with packages, and the fact that the scripts were already on my system is just amazing! Thanks for the deb-src tip.


All times are GMT -5. The time now is 05:09 PM.