0

I have recently started working on ubuntu and I have been facing a lot of difficulties installing programs in it. I don't know how I managed to install NetBeans and JAVA JDK and JRE. Unfortunately the NetBeans came without C++ compiler and debugger. I've been googling for two days and all I could find and understand was some thing like this:

sudo apt-get install build-essential
sudo apt-get install gcc g++
sudo apt-get install gdb

I finally -don't know how- installed the compiler but still no debugger.
Then I start doing some crazy stuff. I purged gcc, g++, gdb and not sure what else. Anyway I downloaded the gcc-4.6 (4.6.3-1ubuntu5) Source Package from this link: http://packages.ubuntu.com/source/precise/gcc-4.6 And as you may guess didn't know how to install it. So please any help would be greatly appreciated ^_^

2

1 Answer 1

3

Ubuntu is not like the Windows operating system you are used to. Old habits are hard to break but the sooner the better. You're gonna have to scrap the whole mentality of downloading an .exe from whoever and installing whatever to your system. That's one of the many reasons windows has so much malware (although, Netbeans Java and Virtualbox etc are better off downloading from oracle IMO).

One of the advantages of running a linux operating system is that most programs ("packages") are installed through a package manager. This is similar to the "app-store" or "google-apps" and even more like "homebrew" if you are familiar with OSX.

You don't need to download the source of the source package to install a package (program) using Ubuntu. All you need to do is type sudo apt-get followed by the package name. To install gcc-4.6 and build essential open a terminal and type the following commands:

sudo apt-get update
sudo apt-get install gcc-4.6 build-essential

If you see no errors, the package is installed. If you need to see if any gcc packages are installed, you can type the following command in an open terminal:

dpkg -l | grep gcc

The output will list every package installed containing the letters gcc in the name. No output = no packages installed.

Also,

dpkg -l 

Will list all installed packages.

To search for available packages related to "netbeans" you can type the following command:

apt search netbeans

To narrow the results, type this command instead:

apt search netbeans | grep netbeans

Another search example:

apt search c++ | grep compiler

Finally, you can install a GUI frontend (synaptic package manager) to help you search for and install packages by typing the following command:

sudo apt-get install synaptic

Search for synaptic package manager amongst your installed apps or open a terminal and type the following command:

sudo synaptic
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.