LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-24-2011, 04:32 PM   #1
Ghazale
LQ Newbie
 
Registered: May 2011
Posts: 14

Rep: Reputation: Disabled
install gdb in Linux


Hi,

I need gdb but when I run gdb command I get the following error:

bash: gdb: command not found

Could you please tell me what should I do to fix this error? Probably gdb is not installed on my computer. How can I install gdb?

thanks!
Ghazale
 
Old 09-24-2011, 04:35 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Usually, you'd install things using your distribution's package management system. gdb is a standard piece of software, so I'd be very surprised if your distribution didn't have a package for it. If you need help with using the package manager, you'll need to tell us which distribution you're using.
 
Old 09-24-2011, 04:53 PM   #3
Ghazale
LQ Newbie
 
Registered: May 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
I have Debian.
 
Old 09-24-2011, 05:03 PM   #4
ulmo
LQ Newbie
 
Registered: Jul 2004
Distribution: debian
Posts: 28
Blog Entries: 5

Rep: Reputation: 2
One way to install gdb in debian is:

sudo apt-get update
(This ensures apt knows the newest versions of packeges.)
sudo apt-get install gdb
(This installs gdb.)

But there are a lot of other options to install software in debian, e.g. aptitude, which offers menus.
 
Old 09-24-2011, 05:06 PM   #5
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
apt-get install gdb (as root)

apt-get is the lowest-common-denominator command-line package manager for Debian (and derived distros). There are other ways of managing software on Debian-likes (e.g. Synaptic Package Manager is a GUI frontend to apt), but apt-get is always there when all else fails.

Also, I don't really use Debian on a regular basis (save for a virtual machine I have for testing support suggestions ), so I don't know all the ins and outs of Debian's package management system; this is just advice from someone who's messed with Ubuntu in the past, as well as having a little bit of vanilla Debian experience.

EDIT: damn, too late.

Last edited by MrCode; 09-24-2011 at 05:08 PM.
 
Old 09-24-2011, 05:08 PM   #6
dudeman41465
Member
 
Registered: Jun 2005
Location: Kentucky
Distribution: Ubuntu
Posts: 794

Rep: Reputation: 56
The following command(as root) will install gdb on Debian. You can also hunt it down in the Synaptic GUI if you want.

apt-get install gdb

Edit: Holy crap, in the 20 seconds it took me to reply like 3 other people responded.
 
Old 09-24-2011, 05:22 PM   #7
Ghazale
LQ Newbie
 
Registered: May 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
sudo apt-get install gdb gave me this error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
gdb : Depends: gdbserver but it is not going to be installed
sun-java6-jre : Depends: sun-java6-bin (>= 6.26-0squeeze1) but it is not going to be installed or
ia32-sun-java6-bin (>= 6.26-0squeeze1) but it is not going to be installed
Recommends: gsfonts-x11 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I tried it with -f as well and it gave the same error, any idea?
 
Old 09-24-2011, 05:39 PM   #8
ulmo
LQ Newbie
 
Registered: Jul 2004
Distribution: debian
Posts: 28
Blog Entries: 5

Rep: Reputation: 2
Just a guess: sometimes, I get such problems solved with aptitude. It suggests solutions to unresolved dependencies.

EDIT: Sorry for the misunderstanding: I meant aptitute with the menu-driven user interface. It is started just with:
Code:
aptitute

Last edited by ulmo; 09-24-2011 at 06:51 PM.
 
Old 09-24-2011, 05:54 PM   #9
Ghazale
LQ Newbie
 
Registered: May 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
sudo aptitude install gdb gives this error:

The following NEW packages will be installed:
gdb gdbserver{a}
0 packages upgraded, 2 newly installed, 0 to remove and 190 not upgraded.
Need to get 0 B of archives. After unpacking 4,878 kB will be used.
Do you want to continue? [Y/n/?] Y
E: I wasn't able to locate file for the sun-java6-jre package. This might mean you need to manually fix this package.
E: I wasn't able to locate file for the sun-java6-jre package. This might mean you need to manually fix this package.
E: Internal error: couldn't generate list of packages to download
 
Old 09-24-2011, 06:00 PM   #10
dudeman41465
Member
 
Registered: Jun 2005
Location: Kentucky
Distribution: Ubuntu
Posts: 794

Rep: Reputation: 56
So try manually installing Sun Java with:

Code:
sudo apt-get install sun-java6-jre
Then try installing gdb.
 
Old 09-25-2011, 02:30 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Java : Probably check that "non-free" packages are included :
Synaptic, Settings > Archives > > Other Software.

Refresh Synaptic. Or close Synaptic, and do # apt-get update


The command : 'apt-get update' must be used quite often to include updates.

The safe way is always : apt-get update && apt-get install <package>
Like : apt-get update && apt-get install gdb

.
 
Old 09-25-2011, 06:24 PM   #12
Ghazale
LQ Newbie
 
Registered: May 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
what is Synaptic? There is no file with that name on my computer.
 
Old 09-25-2011, 06:31 PM   #13
Ghazale
LQ Newbie
 
Registered: May 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
sudo apt-get install sun-java6-jre gives this error : (((((((((((((( I don't know what is wrong with my Linux

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package sun-java6-bin needs to be reinstalled, but I can't find an archive for it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
zypper install gdb, does not install the latest version of GDB TheIndependentAquarius SUSE / openSUSE 4 12-30-2010 04:00 AM
Linux gdb tips eggsy84 Programming 4 12-14-2005 04:09 AM
normal gdb and spec gdb for kgdb Igor007 Programming 1 09-23-2005 05:15 PM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 02:41 PM
gdb .. looking for 32 bit gdb.. for ia64 suse.. nkshirsagar SUSE / openSUSE 0 12-09-2004 04:02 AM


All times are GMT -5. The time now is 08:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration