Ubuntu, Cannot install zlib1g-dev - node.js

I'm trying to install nodejs in Ubuntu, after checking all the missing dependencies I encounter an issue when installing zlib1g-dev, zlib1g is already at 1:1.2.8.dfsg-2ubuntu4.1 :
[pp#src]$ sudo apt-get install zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
zlib1g-dev : **Depends: zlib1g (= 1:1.2.8.dfsg-2ubuntu4) but 1:1.2.8.dfsg-2ubuntu4.1 is to be installed**
E: Unable to correct problems, you have held broken packages.
[pp#src]$ sudo apt-get install zlib1g
Reading package lists... Done
Building dependency tree
Reading state information... Done
**zlib1g is already the newest version (1:1.2.8.dfsg-2ubuntu4.1)**.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I was able to do the installation with:
sudo apt-get update && sudo sudo apt-get install zlib1g-dev
After updating /etc/apt/sources.list with the following:
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http:// us.archive .ubuntu. com/ubuntu/ xenial main restricted universe multiverse
deb-src http:// us.archive .ubuntu. com/ubuntu/ xenial main restricted universe multiverse
###### Ubuntu Update Repos
deb http:// us.archive .ubuntu. com/ubuntu/ xenial-security main restricted universe multiverse
deb http://us.archive .ubuntu. com/ubuntu/ xenial-updates main restricted universe multiverse
deb http:// us.archive .ubuntu. com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http:// us.archive .ubuntu. com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http:// us.archive .ubuntu. com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http:// us.archive .ubuntu. com/ubuntu/ xenial-proposed main restricted universe multiverse
###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner

I would try a sudo apt-get update to start (sometimes the problem is trivial!).
Consider including the results of dpkg --get-selections | grep hold
in the comments.
Autoremove might help, too!
Finally, trying again with aptitude (https://unix.stackexchange.com/questions/767/what-is-the-real-difference-between-apt-get-and-aptitude-how-about-wajig) might highlight the issue.
Tough to diagnose without more information.

Answer for this is given by SeinopSys in Error installing zlib1g-dev
you need to take note of the required package version (in your case = = 1:1.2.8.dfsg-2ubuntu4), then run the command below to downgrade to that version:
$ sudo apt install zlib1g== 1:1.2.8.dfsg-2ubuntu4
Then you can try re-installing.

Related

linode | ubuntu | sudo apt-get update | mirror 404 error

On Linode (Ubuntu 16.10), after enabling UFW firewall via
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw allow in "Apache Full"
(though I'm not completely sure the firewall setup is the source of my issues...)
sudo apt-get update is giving me the following message:
Ign:1 http://mirrors.linode.com/ubuntu yakkety InRelease
Ign:2 http://mirrors.linode.com/ubuntu yakkety-updates InRelease
Ign:3 http://mirrors.linode.com/ubuntu yakkety-backports InRelease
Err:4 http://mirrors.linode.com/ubuntu yakkety Release
404 Not Found [IP: ****:****:*::****:**** 80]
Err:5 http://mirrors.linode.com/ubuntu yakkety-updates Release
404 Not Found [IP: ****:****:*::****:**** 80]
Err:6 http://mirrors.linode.com/ubuntu yakkety-backports Release
404 Not Found [IP: ****:****:*::****:**** 80]
Ign:7 http://security.ubuntu.com/ubuntu yakkety-security InRelease
Err:8 http://security.ubuntu.com/ubuntu yakkety-security Release
404 Not Found [IP: ****:***:****::** 80]
Reading package lists... Done
E: The repository 'http://mirrors.linode.com/ubuntu yakkety Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://mirrors.linode.com/ubuntu yakkety-updates Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://mirrors.linode.com/ubuntu yakkety-backports Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://security.ubuntu.com/ubuntu yakkety-security Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
The source file /etc/apt/source.list :
# deb http://mirrors.linode.com/ubuntu/ yakkety main restricted
# deb http://mirrors.linode.com/ubuntu/ yakkety-updates main restricted
# deb http://security.ubuntu.com/ubuntu yakkety-security main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.linode.com/ubuntu/ yakkety main restricted
# deb-src http://mirrors.linode.com/ubuntu/ yakkety main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.linode.com/ubuntu/ yakkety-updates main restricted
# deb-src http://mirrors.linode.com/ubuntu/ yakkety-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://mirrors.linode.com/ubuntu/ yakkety universe
# deb-src http://mirrors.linode.com/ubuntu/ yakkety universe
deb http://mirrors.linode.com/ubuntu/ yakkety-updates universe
# deb-src http://mirrors.linode.com/ubuntu/ yakkety-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.linode.com/ubuntu/ yakkety multiverse
# deb-src http://mirrors.linode.com/ubuntu/ yakkety multiverse
deb http://mirrors.linode.com/ubuntu/ yakkety-updates multiverse
# deb-src http://mirrors.linode.com/ubuntu/ yakkety-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.linode.com/ubuntu/ yakkety-backports main restricted universe multiverse
# deb-src http://mirrors.linode.com/ubuntu/ yakkety-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu yakkety partner
# deb-src http://archive.canonical.com/ubuntu yakkety partner
deb http://security.ubuntu.com/ubuntu yakkety-security main restricted
# deb-src http://security.ubuntu.com/ubuntu yakkety-security main restricted
deb http://security.ubuntu.com/ubuntu yakkety-security universe
# deb-src http://security.ubuntu.com/ubuntu yakkety-security universe
deb http://security.ubuntu.com/ubuntu yakkety-security multiverse
# deb-src http://security.ubuntu.com/ubuntu yakkety-security multiverse
I've tried sudo apt-get dist-update to no avail (also gives 404 errors).
I've also done unset http_proxy and unset https_proxy;
apt-get -o Acquire::ForceIPv4=true update - it still fails when using IPv4
I can ping 8.8.8.8 just fine.
...nothing's worked yet. Anyone have any idea how to fix this?
Response from Linode Support:
It looks like you are using an Ubuntu versions that's reached its end of life status.
https://wiki.ubuntu.com/Releases
You can reference the following link to see if you are able to update this in another manner. The other option is deploy an updated Ubuntu image for your server and copy your data over to the new disk.
https://help.ubuntu.com/community/EOLUpgrade
I was stuck on this as well. But I got it working.
I had to replace "us.archive.ubuntu.com" and "security.ubuntu.com" in /etc/apt/sources.list WITH "old-releases.ubuntu.com" and then I was able to finish downloading some of the packages, like Ayush Kumar said in sudo apt-get update fail on Ubuntu 17.04.
For the other updates that were listed by my Hosting company, Linode, I used the following:
I had to use the --allow-unauthenticated flag with sudo apt-get update.
sudo apt-get update --allow-unauthenticated
Then I was able to finish updating.

Installing npm in Ubuntu

I am truly struggling to install npm. I have installed the nodejs package successfully, but still my operating system UbuntuĀ 15.10 (Wily Werewolf) doesn't recognize the npm command like it is shown below, even though after several update attempts with sudo apt-get update:
user#user-T420:~$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
The following packages were automatically installed and are no longer required:
authbind diffstat hardening-includes libapt-pkg-perl libarchive-zip-perl
libbonobo2-0 libbonobo2-common libcamel-1.2-29 libclass-accessor-perl
libclone-perl libedataserver-1.2-15 libemail-valid-perl libgles1-mesa
libgnome2-0 libgnome2-bin libgnome2-common libidl-common libidl0
libindicate5 libio-pty-perl libio-string-perl libipc-run-perl
libnet-dns-perl libnet-domain-tld-perl libnet-ip-perl liborbit2
libperlio-gzip-perl libpoppler19 libqt5x11extras5 libsdl-image1.2
libtext-levenshtein-perl libtiff4 libva-drm1 libxcb-composite0 libxcb-xv0
linux-headers-4.2.0-16 linux-headers-4.2.0-16-generic
linux-image-4.2.0-16-generic linux-image-extra-4.2.0-16-generic patchutils
t1utils vlc-plugin-notify vlc-plugin-samba
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
user#user-T420:~$ npm -v
The program 'npm' is currently not installed. You can install it by typing:
sudo apt-get install npm
user#user-T420:~$ sudo apt-get install npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
npm : Depends: nodejs-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
user#user-T420:~$ sudo apt-get install nodejs-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nodejs-dev : Depends: libssl-dev (>= 1.0.0g) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
user#user-T420:~$ sudo apt-get install libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libssl-dev : Depends: libssl1.0.0 (= 1.0.1-4ubuntu5.36) but 1.0.2d-0ubuntu1.4 is to be installed
Depends: zlib1g-dev but it is not going to be installed
Recommends: libssl-doc but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
user#user-T420:~$ sudo apt-get install zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
zlib1g-dev : Depends: zlib1g (= 1:1.2.3.4.dfsg-3ubuntu4) but 1:1.2.8.dfsg-2ubuntu4 is to be installed
E: Unable to correct problems, you have held broken packages.
It looks an infinite tree of dependencies. Is there a solution to fix it?
If this would be of any help, here's my sources.list file:
#############################################################
############### OFFICIAL UBUNTU REPOSITORIES ################
#############################################################
###### Ubuntu Main Repositories
deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
###### Ubuntu Partner Repository
deb http://archive.canonical.com/ubuntu precise partner
deb-src http://archive.canonical.com/ubuntu precise partner
###### Ubuntu Extras Repository
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
Use aptitude instead of apt-get. It is more intelligent. It not only will handle downgrading conflicting packages for you, but it will make a series of recommendations asking you which of many possible suggested working scenarios you would like.
sudo aptitude install myNewPackage
If you don't have aptitude on your machine yet, get it with
sudo apt-get install aptitude

install emacs 24.4 error on mint

I followed this link. But got error, how to fix?
$ sudo apt-get build-dep emacs24
[sudo] password for oracle:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to find a source package for emacs24
$ cat /etc/apt/sources.list
#deb cdrom:[Linux Mint 17 _Qiana_ - Release amd64 20140530]/ trusty contrib main non-free
deb http://packages.linuxmint.com qiana main upstream import
deb http://extra.linuxmint.com qiana main
deb http://mirror.nexcess.net/ubuntu trusty main restricted universe multiverse
deb http://mirror.nexcess.net/ubuntu trusty-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ trusty partner
Open the software-sources application, and click "Enable source code repositories"
Then try again.
This is from my recipe for Travis CI:
sudo add-apt-repository -y ppa:cassou/emacs
sudo apt-get update -qq
sudo apt-get install -qq emacs24
Might be useful.

Installing build-dep on linux mint

I'm trying to install build-dep on Linux mint 15, but I'm getting an error. I've checked my source list and looks fine. I've also updated the system (apt-get update)
This is the command
apt-get build-dep --no-install-recommends linux-image-$(uname -r)
And this is the error:
Picking 'linux' as source package instead of 'linux-image-3.8.0-19-generic'
E: Unable to find a source package for linux
And this is my source.list:
deb http://archive.getdeb.net/ubuntu raring-getdeb apps games
deb-src http://cran.ms.unimelb.edu.au/bin/linux/ubuntu raring/
deb http://packages.linuxmint.com/ nadia main upstream import
deb http://archive.ubuntu.com/ubuntu/ quantal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ quantal-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ quantal-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ quantal partner
deb http://packages.medibuntu.org/ quantal free non-free
# deb http://archive.getdeb.net/ubuntu quantal-getdeb apps
# deb http://archive.getdeb.net/ubuntu quantal-getdeb
You are missing the source uri to install the build-dep. Do:
sudo bash -c 'echo "deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse" >> /etc/apt/sources.list'
sudo apt-get update
sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r) # or any other package
The kernel is special. Install linux-source; apt-get will default to your current version.

Debian Squeeze apt-get errors when installing Git?

I'm new to Linux/Debian (squeeze). I'm trying to do an apt-get to install git and receive this error message.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package git-core 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 'git-core' has no installation candidate
i tried editing my sources.list to the following
# deb cdrom:[Debian GNU/Linux 6.0.5 Squeeze - Official i386 DVD Binary-1 20120512-13:45]/ > squeeze contrib main
# deb cdrom:[Debian GNU/Linux 6.0.5 Squeeze - Official i386 DVD Binary-1 20120512-13:45]/ squeeze contrib main
deb http://security.debian.org/ squeeze/updates main contrib
deb-src http://security.debian.org/ squeeze/updates main contrib
deb http://ftp.us.debian.org/debian/ squeeze/updates main contrib
deb-src http://ftp.us.debian.org/debian/ squeeze/updates main contrib
deb http://http.us.debian.org/debian squeeze/updates main contrib
deb-src http://http.us.debian.org/debian squeeze/updates main contrib
# squeeze-updates, previously known as 'volatile'
# A network mirror was not selected during install. The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
deb http://ftp.debian.org/debian/ squeeze-updates main contrib
deb-src http://ftp.debian.org/debian/ squeeze-updates main contrib
as i said i'm very new to this so i don't know what needs to be in the sources.list file. I can't actually install anything right now. i tried installing php as well and got the same error. please help :(
The git-core package is obsolete, try installing git.
EDIT
Furthermore you only have squeeze updates repositories in your sources.list, add at least one regular squeeze repository to get access to all packages, not just updated ones:
deb http://ftp.debian.org/debian/ squeeze main contrib non-free
Afterwards run apt-get update to update your local package index.

Resources