Linux: Acquiring Source Code: Difference between revisions
Jump to navigation
Jump to search
| Line 1: | Line 1: | ||
== Acquiring Source Code in Ubuntu == | == Acquiring Source Code in Ubuntu (Hirsute) == | ||
# Update/enable the source package URLs. Note that in Ubuntu, these should already be in the sources.list file and just need to be uncommented. i.e. remove the "#" from the deb-src lines | # Update/enable the source package URLs. Note that in Ubuntu, these should already be in the sources.list file and just need to be uncommented. i.e. remove the "#" from the deb-src lines | ||
#:::<code>sudo gedit /etc/apt/sources.list</code> | #:::<code>sudo gedit /etc/apt/sources.list</code> | ||
Revision as of 18:56, 9 May 2021
Acquiring Source Code in Ubuntu (Hirsute)
- Update/enable the source package URLs. Note that in Ubuntu, these should already be in the sources.list file and just need to be uncommented. i.e. remove the "#" from the deb-src lines
sudo gedit /etc/apt/sources.list
- An example line might look like this:
deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute main restricted
- Update the new package information that was added in step 1
sudo apt-get update
- Navigate to the directory that the source code will reside in, and download it.
- Example for downloading the source code for the grep utility
sudo apt-get source grep
- Example for downloading the source code for bash
sudo apt-get source bash
- Example for downloading the source code for the grep utility
- There should be a directory with the source code along with some other files. Move to the new directory to view the downloaded source code.
See Linux: Compiling and Installing Source Code from the Terminal for compiling and installing.