Using 'sudo apt-get install build-essentials' - linux

I was trying to use sudo apt-get install build-essentials to install the g++ compiler on my Ubuntu Linux box. But it gave me the following message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package build-essentials
How do I fix this problem?

Drop the 's' off of the package name.
You want sudo apt-get install build-essential
You may also need to run sudo apt-get update to make sure that your package index is up to date.
For anyone wondering why this package may be needed as part of another install, it contains the essential tools for building most other packages from source (C/C++ compiler, libc, and make).

In my case, simply "dropping the s" was not the problem (although it is of course a step in the right direction to use the correct package name).
I had to first update the package manager indexes like this:
sudo apt-get update
Then after that the installation worked fine:
sudo apt-get install build-essential

Try
sudo apt-get update
sudo apt-get install build-essential
(If I recall correctly the package name is without the extra s at the end).

I know this has been answered, but I had the same question and this is what I needed to do to resolve it. During installation, I had not added a network mirror, so I had to add information about where a repo was on the internet. To do this, I ran:
sudo vi /etc/apt/sources.list
and added the following lines:
deb http://ftp.debian.org/debian wheezy main
deb-src http://ftp.debian.org/debian wheezy main
If you need to do this, you may need to replace "wheezy" with the version of debian you're running. Afterwards, run:
sudo apt-get update
sudo apt-get install build-essential
Hopefully this will help someone who had the same problem that I did.

The package is called build-essential without the plural "s". So
sudo apt-get install build-essential
should do what you want.

Try 'build-essential' instead.

To auto-generate the "source.list" file I suggest to use:
https://debgen.simplylinux.ch/
Where you can select the country, the distribution, ..etc
After that, all you need to do is to replace (take a backup of the file first) your original source.list file with the generated one and do as mentioned in other answers:
sudo apt-get update
sudo apt-get install build-essential

Manifest for installing rust and build-essentials on ubuntu 20.04.03
rustup self uninstall
apt-get update
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe"
apt-get -u dist-upgrade
apt install aptitude
sudo aptitude install libc6=2.31-0ubuntu9
sudo aptitude install build-essential
apt-get update
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain none -y
rustup toolchain install nightly --allow-downgrade --profile minimal --component clippy
rustup default stable
rustup update nightly
rustup update stable
rustup target add wasm32-unknown-unknown --toolchain nightly
sudo apt install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev
rustc --version
source $HOME/.cargo/env
#No tested on me Fast Installation: Install all the required dependencies with a single command. (Be patient, this can take up to
30 minutes)
curl https://getsubstrate.io -sSf | bash -s -- --fast
Finally step test:
https://doc.rust-lang.org/cargo/getting-started/first-steps.html
#ArmanRiazi.Blockchain#Substrate#Dr.GavinWood

Related

Installing kernel headers packages missing error

I am trying to install kernel-headers but getting this error
E: Unable to locate package linux-headers-5.9.0-kali1-amd64
E: Couldn't find any package by glob 'linux-headers-5.9.0-kali1-amd64'
E: Couldn't find any package by regex 'linux-headers-5.9.0-kali1-amd64'
I have updated and uncommented this line in sources.list
deb-src http://http.kali.org/kali kali-rolling main contrib non-free
but errors thats can't locate regex or glob. what I am missing?
Here's what you may need to do
sudo apt-get update # This will update the repositories list
sudo apt-get upgrade # This will update all the necessary packages on your system
sudo apt-get dist-upgrade # This will add/remove any needed packages
reboot # You may need this since sometimes after a upgrade/dist-upgrade, there are some left over entries that get fixed after a reboot
sudo apt-get install linux-headers-$(uname -r) # This should work now
from what am guessing linux-headers-5.9.0 is not available in the kali repository.
you can always use apt-cache search linux-headers to know if it available
but to update to the latest linux headers
sudo apt-get update
sudo apt-get dist-upgrade
then search for Linux-headers available using apt search Linux-headers.
so you install the latest version using
sudo apt-get install -y linux-headers-$(uname -r)

python3-pip has no installation candidate

I am having an error after typing:
sudo apt-get install python3-pip
This is the error:
Package python3-pip is not available but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python3-pip' has no installation candidate
What should I do?
You need to update source list first,
Try running
sudo apt-get update
sudo apt-get upgrade #Optional
sudo apt install python3-pip
hi I had same issue but I ran the following commands to fix it
sudo add-apt-repository universe
sudo apt-get update
sudo apt install python3-pip
and it solved the problem
The solution is to add the universe repository:
sudo add-apt-repository universe
Then update apt:
sudo apt update
And try again:
sudo apt install python3-pip
in Debian 11, part of this answer helped me (I invite you to upvote it unix.stackexchange.com, please): https://unix.stackexchange.com/questions/522758/how-to-install-software-properties-common-in-debian-9/522770#522770
Summarizing, add to /etc/apt/sources.list the next line (replacing by the right Debian version name, as stretch or bullseye):
deb http://deb.debian.org/debian/ <version-name> main
In my case,
deb http://deb.debian.org/debian/ bullseye main
After this, I cold install my missing packages, as software-properties-common python3-pip vim tree

Corresponding package names in "yum" from "apt-get"

My program has the following dependencies in Ubuntu:
apt-get install unzip wget
apt-get install mesa-common-dev -y
apt-get install libglu1-mesa-dev -y
apt-get install libfontconfig1 -y
apt-get install libglib2.0-0 -y
apt-get install libxcursor-dev libxtst-dev libxi-dev libxrender-dev -y
apt-get install libxss-dev libxcomposite-dev libxslt1-dev -y
apt-get install libasound2-dev -y
Now I also need to deploy on RHEL which uses "yum" instead of "apt-get" so my question is what is the "yum" equivalent of all the packages used above. Is there a table where they are mapped? Basically for each package above I want to know or how to find out the "yum" repository equivalent.
Also, if I'm writing a SPEC file with BuildRequires...are they all yum package names because RPM is mainly for RedHat?
RHEL variants will use -devel convention instead of -dev from debian world. Beside that the names would be similar, a yum search PKG would point out the right direction
If things get hard you can use dpkg -L PKG, grab a key file and yum whatprovides FILE to find out what packages provides that file.

How do I fix the Rust error "linker 'cc' not found" for Debian on Windows 10?

I'm running Debian on Windows 10 (Windows Subsystem for Linux) and installed Rust using the command:
curl https://sh.rustup.rs -sSf | sh
There were no errors in the install, but when I tried to compile with rustc I got the error linker 'cc' not found.
The Linux Rust installer doesn't check for a compiler toolchain, but seems to assume that you've already got a C linker installed! The best solution is to install the tried-and-true gcc toolchain.
sudo apt install build-essential
If you need to target another architecture, install the appropriate toolchain and target the compilation as follows:
rustc --target=my_target_architecture -C linker=target_toolchain_linker my_rustfile.rs
I ran the following 2 commands and it worked.
sudo apt-get update
sudo apt install build-essential
You have to install some dependencies
for Arch Linux sudo pacman -S base-devel
for Ubuntu sudo apt install build-essential
for Centos sudo yum install gcc
for Solus sudo eopkg it -c system.devel
Solution for CentOS:
yum -y install gcc
if u are on wsl2 - ubuntu try to update the pacakges with following cmds:
sudo apt-get update
sudo apt install build-essential
Solution for Solus:
sudo eopkg it -c system.devel
Please do an "Update and Upgrade" before installing setup tools.
You can fix this problem by adding build essential package in linux
sudo apt install -y build-essential
IF ABOVE IS NOT WORKING: cc is included in the "GCC" package. You need to uninstall GCC and then reinstall it if you have accidentally replaced or removed the cc binary.
I ran the following commands in wsl1, it worked
sudo apt-get update
sudo apt install build-essential

Build-Essential: Command Not Found on WSL

I am currently trying to setup my Windows 10 Dev Box with WSL. I have successfully install Ubuntu (Ubuntu 16.04.3) on a Windows 10 Insider Preview Version 1803 (OS Build 17666.1000). Using this walkthru to setup a RoR Dev ENV. Getting Rails app to...
sudo apt-get update seems to run fine.
sudo apt-get install git-core curl zlib1g-dev seems to run fine except libfreetype6 is no longer required.
When I try to run a build-essential command it gives me this message: build-essential: command not found
I try to apt-get autoremove to see if the libfreetype6 is causing the issue, no dice. I try sudo apt-get install --reinstall build-essential and it installs, but as soon as I run another build-essential command, it's not found again. Am I missing something?
Any help or direction would be awesome. Thanks.
You're missing nothing. build-essential is a package, not a command.
If you do apt show build-essential, you will notice this line:
Depends: libc6-dev | libc-dev, gcc (>= 4:7.2), g++ (>= 4:7.2), make, dpkg-dev (>= 1.17.11)
So it's just a convenient package that installs a set of essential build tools.
Furthermore, if you do dpkg -L build-essential, you will find that it contains nothing in /usr/bin (or whatever binary directory).
you have to install build-essential. first update repo list and update your libs, then install it.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
It works for me in WSL, thanks Roberto

Resources