I still need URIs despite the fact that my source list seems to have the correct repositories

C

CrazedNerd

Guest
I'm trying to get the source code for the "su" command, don't ask why it's just for educational purposes...i would have like to have been an amazing programmer by now but i still have a huge amount to learn:

Code:
xarathustra@xarathustra:~$ sudo apt-get source su
Reading package lists... Done
E: You must put some 'deb-src' URIs in your sources.list

"deb-src" is already a part of my source.list file:

Code:
  GNU nano 6.2                  /etc/apt/sources.list                           
# deb cdrom:[Ubuntu 20.04.4 LTS _Focal Fossa_ - Release amd64 (20220223)]/ foca>

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal universe
deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates universe

So, what's the real syntax reason I can't get this source code? A few months ago, i was to just download the source code for Ubuntu and then find the src for the commands in a "bin folder". I downloaded 5 iso files for jammy jellyfish yesterday directly from the ubuntu website, mounted them to a folder i created, and they all appear to be exactly the same and not contain the text files in C for the commands. Are the developers just compressing these as part of something else now? I'm very confused by this...
 


You don't have deb-src available. When a # is put at the beginning of the line, it does not work. (Like in Windows when something is "remed" out.)

You need to edit your sources list and remove the # in the deb-src lines reboot
 
You don't have deb-src available. When a # is put at the beginning of the line, it does not work. (Like in Windows when something is "remed" out.)

You need to edit your sources list and remove the # in the deb-src lines reboot
Oh, lol. That explains a lot...i just figured they'd enable you to download source code by default.
 
This is strange, i somehow suspected that trying to do this still wouldn't work. I updated the repositories, then did this:

Code:
apt-get source su

apt-cache search su | less

it appears that sudo is in my repositories, yet somehow su isn't. I enabled every deb-src line in my file.
 
I'm trying to get the source code for the "su" command
If you would do:
Code:
man su

You may see at the bottom of the man page:
AVAILABILITY
The su command is part of the util-linux package which can be
downloaded from Linux Kernel Archive
<https://www.kernel.org/pub/linux/utils/util-linux/>.

Following that link shows 2.38 to be the latest series. Within that folder, the most recent release is 2.38.1. After you extract that package, look in the login-utils folder and you'll find su-common.c -- I guess that's what you want (or one or more of the adjacent related files).
 
Last edited:
If you would do:
Code:
man su

You may see at the bottom of the man page:


Following that link shows 2.38 to be the latest series. Within that folder, the most recent release is 2.38.1. After you extract that package, look in the login-utils folder and you'll find su-common.c -- I guess that's what you want (or one or more of the adjacent related files).
yeah that's what i'm looking for, i was thinking the source code might be related to GNU but since it's related to the kernel that makes a ton of sense.
 
...i would have like to have been an amazing programmer by now but i still have a huge amount to learn:

Let me know when you are done, crazy, and then you can teach me. LOL.

Wiz
 

Staff online

Members online


Latest posts

Top