I was trying to install a package for robotic operational system (ROS). And I just go ahead and type sudo apt-get install <package>
After installation, I see a list of files in /opt/share
folders, which are the packages I want.
But if I go into src
, the source code (.cpp files) aren't there.
I can see the source code if I go to developer's github pages, but how come the package is installed without using the source code? How can I download the source code and install the package using apt-get install
command?
Best Answer
By default
apt-get install
does not download the source codes of packages. There is a specificapt-get
option to do that which issource
.From
man apt-get
:So the syntax to download the source package of something to the current directory would be (no need to be
root
):Also note that as the
man
pages says you need to have thedeb-src
repositories enabled for all the regulardeb
repositories you want to keep track of source packages. The simplest way to do that would be to just add-src
to the original repo's initialdeb
string:On a different note, you might have checked the
/usr/src
directory which is the designated place for all kernel sources.