Install python-pip on Ubuntu 14.04.2 Issue - linux

Attempting to install python-pip on a fresh Ubuntu 14.04.2 VM.
sudo apt-get update
sudo apt-get install python-pip
The error I get indicates some basic libc package can't be found:
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main linux-libc-dev amd64 3.13.0-52.86
404 Not Found [IP: 91.189.91.15 80]
Fetched 26.1 MB in 4s (5918 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_3.13.0-52.86_amd64.deb 404 Not Found [IP: 91.189.91.15 80]
And indeed, hitting the URL listed from a browser throws a 404.
Same issue happens when trying to install python-dev and python3-pip.
What's the workaround?
EDIT - Solved
The problem was actually that I was building the VM using vagrant and docker.
The RUN sudo apt-get update step in my Dockerfile was cached for some reason, meaning it was being skipped. Consequently, python-pip was probably looking for an outdated dependency.

I'm in a virtualenv, where all I had to do was this:
pip install --upgrade pip
Now that virtualenv is up to date - but I didn't have to mess with the rest of Ubuntu's pip on this system. Probably the best way to go, given how old Ubuntu's is and not wanting to mess with their packaging system.

Related

Problems installing nodejs on Ubuntu 16.10

could someone help me to understand why it fails to find these packages?
sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libuv1
The following NEW packages will be installed:
libuv1 nodejs
0 upgraded, 2 newly installed, 0 to remove and 28 not upgraded.
Need to get 3.346 kB of archives.
After this operation, 14,1 MB of additional disk space will be used.
Err:1 http://it.archive.ubuntu.com/ubuntu yakkety/universe amd64 libuv1 amd64 1.9.1-1
404 Not Found
Err:2 http://it.archive.ubuntu.com/ubuntu yakkety/universe amd64 nodejs amd64 4.2.6~dfsg-1ubuntu5
404 Not Found
E: Failed to fetch http://it.archive.ubuntu.com/ubuntu/pool/universe/libu/libuv1/libuv1_1.9.1-1_amd64.deb 404 Not Found
E: Failed to fetch http://it.archive.ubuntu.com/ubuntu/pool/universe/n/nodejs/nodejs_4.2.6~dfsg-1ubuntu5_amd64.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Try to install it like this
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Follow the Steps to install Nodejs using terminal.. Make sure your connected to internet
cd ~
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
nano nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs
After Installing Check the Version...
nodejs -v
Can also check the NPM version by
npm -v
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04
Or another way, you can use NVM to manage NodeJS version for your machine. NVM is stand for Node Version Manager.

How to install libjpeg62-dev on Raspberry Pi?

I am following the tutorial https://pimylifeup.com/raspberry-pi-webcam-server/ to build a web server for raspberry pi camera stream.
I had the problem: ./motion: error while loading shared libraries: libavformat.so.53: cannot open shared object file: No such file or directory
And after I search for many solutions, one said to install:
sudo apt-get install -y libjpeg62 libjpeg62-dev libavformat53 libavformat-dev libavcodec53 libavcodec-dev libavutil51 libavutl-dev libc6-dev zlib1g-dev libmysqlclient18 libmysqlclient-dev libpq5 libpq-dev
But I got these error:
E: Package 'libjpeg62-dev' has no installation candidate
E: Unable to locate package libavformat53
E: Unable to locate package libavcodec53
E: Unable to locate package libavutil51
I search for long time but don't find solution to install libjepg62-dev.
The reason for this is, these packages have been removed in the latest jessie release. I've figured a way to fix this.
Try the following:
Note: Never pass the -y argument to apt-get install when doing any of the following. It might remove existing packages. So, always confirm the installation manually for every single package you need.
Add the line deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi to the file /etc/apt/sources.list at the top.
Do sudo apt-get update.
Install the library: sudo apt-get install libavformat53
Install other libs too like libpq5.
Remember to undo the change you did in step 1. i.e., remove the line and perform sudo apt-get update

apt-get install fails with Not Found error because package removed from repository

I've been attempting to install the package r-base on Ubuntu Trusty Tahr and there's a package dependency that became broken in the last week.
My commands are as follows:
apt-get update -y
apt-get dist-upgrade -y
apt-get install -y r-base-dev
...
Err http://archive.ubuntu.com/ubuntu/ trusty-security/main libpng12-dev amd64 1.2.50-1ubuntu2.14.04.1
404 Not Found [IP: 91.189.91.23 80]
Fetched 92.8 MB in 28s (3262 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-dev_1.2.50-1ubuntu2.14.04.1_amd64.deb 404 Not Found [IP: 91.189.91.23 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
The command '/bin/sh -c sudo apt-get install -y r-base-dev' returned a non-zero code: 100
I have attempted to pass --fix-missing and --ignore-missing but it still fails.
It appears that the package was removed on Jan 8, 2016 due to a security patch: https://launchpad.net/ubuntu/+archive/primary/+sourcepub/5711916/+listing-archive-extra
Looking at http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/ confirms that the ubuntu2.14.04.1 file is not there but 1.2.50-1ubuntu2.14.04.2 is present.
How do I fix that?
My goal is to get r-base to install.
If I could somehow make it use the version "2" file instead of "1" it would presumably find the file and proceed happily, but I'm not sure how to make apt-get do that.
Alternatively, maybe it's possible to update the dependency list on my side? Or is it up to the r-base maintainers to do so?
Or third, is it possible to add a repository that still has the old package? I'm not running on an AMD processor, so I shouldn't need this particular package at runtime anyway.
Update:
The solution that worked for me was to explicitly remove the package with the broken dependency, download the updated version, and re-install it before running apt-get update.
$ apt-get remove -y libpng12-0
$ curl -O http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.50-1ubuntu2.14.04.2_amd64.deb
$ dpkg -i libpng12-0_1.2.50-1ubuntu2.14.04.2_amd64.deb
$ apt-get update -y
The problem apparently doesn't have much to do with the r-base or r-base-dev packages, even though r-base-dev incidentally depends on libpng12.
In my opinion this problem will probably fix itself in a couple of days. However if you can't wait, here's what you can do.
First, find out which version of libpng the package you want to install depends on.
$ apt-cache depends r-base
r-base
Depends: r-base-core
Depends: r-recommended
Recommends: r-base-html
Recommends: r-doc-html
Suggests: ess
|Suggests: r-doc-info
Suggests: r-doc-pdf
r-base itself does not depend on libpng but r-base-core probably does.
$ apt-cache depends r-base-core | grep png
Depends: libpng12-0
Now we want to know which specific version of libpng
$ apt-cache show r-base-core
... libpng12-0 (>= 1.2.13-4) ...
If you locate this package in Ubuntu's repositories, you can
download it and try to install it manually.
$ wget <url>
$ sudo dpkg -i <filename>
and then install r-base with apt-get install r-base. However if dpkg
refuses to install libpng you should not force it, because it means the
package is not installable and it would break other dependencies.

Unable to install libgtk2.0-dev on Raspberry Pi 2

I am trying to install libgtk2.0-dev on my Raspberry Pi 2 running on latest raspbian. When I use the command sudo apt-get install libgtk2.0-dev, I get the following dependency errors:
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:
libgtk2.0-dev : Depends: libpango1.0-dev (>= 1.20) but it is not going to be installed
Depends: libcairo2-dev (>= 1.6.4-6.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I tried fixing the broken packages using sudo apt-get install -f, sudo apt-get update, sudo apt-get upgrade and then sudo apt-get install libgtk2.0-dev. It still didn't work. I tried apt-get install on the dependencies and their dependencies, but the result is the same. The solutions in link1 and link2 did not help either.
My source.list contains:
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://archive.raspbian.org/raspbian jessie main contrib non-free rpi
Am I missing something in my source.list? How can I resolve this?
apt-cache policy libgtk2.0-dev libpango1.0-dev libcairo2-dev showed that the problem was with /etc/apt/sources.list.d/raspi.list.
raspi.list contained deb http://archive.raspberrypi.org/debian/ wheezy main. Changed wheezy to jessie, ran apt-get update and then running apt-get install libgtk2.0-dev worked.
Use aptitude instead:
sudo aptitude install libglib2.0-dev

404 error while trying to install nodejs in ubunutu

I am getting the following error message while trying to install nodejs:
Err http://in.archive.ubuntu.com/ubuntu/ quantal/main libc-ares2 amd64 1.9.1-3 404 Not Found [IP: 91.189.91.13 80]
Err http://in.archive.ubuntu.com/ubuntu/ quantal/universe nodejs amd64 0.6.19~dfsg1-5ubuntu1 404 Not Found [IP: 91.189.91.13 80]
Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/c/c-ares/libc-ares2_1.9.1-3_amd64.deb 404 Not Found [IP: 91.189.91.13 80]
Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/universe/n/nodejs/nodejs_0.6.19~dfsg1-5ubuntu1_amd64.deb 404 Not Found [IP: 91.189.91.13 80]
I had used the command:
sudo apt-get install nodejs
Has anybody faced this problem before ?
You should use this PPA to keep node up-to-date with the latest stable version. The Ubuntu/Debian repositories have node also, but they are not regularly updated and sometimes contain very outdated versions.
As #MarcB pointed out, the particular mirror you are currently using does not support quantal.
curl -sL https://deb.nodesource.com/setup | sudo bash
from their documentation https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#debian-and-ubuntu-based-linux-distributions
try out the following commands with the given key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 68576280
sudo apt-add-repository "deb https://deb.nodesource.com/node_7.x $(lsb_release -sc) main"
sudo apt-get update
sudo apt-get install nodejs
The above mention code is for getting NodeJs version 7
for different versions you can check out the github page of nodesource (who maintains PPAs of nodejs) https://github.com/nodesource/distributions#debinstall

Resources