Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Thursday, September 10, 2015

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 installing gnureadline

I was getting the following error gen trying to install gnureadline via pip:

collect2: error: ld returned 1 exit status

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/gnureadline/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1_fHxP-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/gnureadline
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/dist-packages/pip/__main__.py", line 5, in <module>
    exit = run()
  File "/usr/lib/python2.7/dist-packages/pip/runner.py", line 12, in run
    return pip.main()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 235, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 66: ordinal not in range(128)

Turns out that is an issue generated by the use of older versions of pip: https://github.com/pypa/pip/issues/2667

The the version of pip in my server was 1.5.4 so I updated it:

sudo python -m pip install --upgrade pip
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-7.1.2-py2.py3-none-any.whl#md5=5ff9fec0be479e4e36df467556deed4d
  Downloading pip-7.1.2-py2.py3-none-any.whl (1.1MB): 1.1MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.4
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed pip
Cleaning up...

Mine was a new server so I installed some needed common libs: http://stackoverflow.com/questions/31508762/exception-using-pip-install

sudo apt-get install libffi-dev libssl-dev libxml2-dev libxslt1-dev libncurses5-dev

Then I tried to install gnureadline again and everything worked fine :)

Wednesday, October 10, 2012

Ubuntu11.04 : cp: cannot create symbolic link: Operation not permitted


The problem is because your destination device doesn't support the symbolic link creation, mainly because of it's format. In my case, the destination device format was Fat-32. Then there are 2 options:

1. Format your destination device with a format that support the symbolic link creation like NTFS format. And try again the cp command

2. Copy the entire file instead of the symbolic link, using -L option in the cp command:

cp -rL source_dir dest_dir

Resource:
http://diogomelo.net/node/46

Wednesday, May 11, 2011

Ubuntu: installing java

- Install java JDK and JRE
apt-get install sun-java6-jdk sun-java6-jre

Do you want to continue [Y/n]? y
Get:1 http://my.archive.ubuntu.com hardy/main java-common 0.28ubuntu3 [78.2kB]
Get:2 http://my.archive.ubuntu.com hardy/multiverse sun-java6-jre 6-06-0ubuntu1 [6334kB]
Get:3 http://my.archive.ubuntu.com hardy/main odbcinst1debian1 2.2.11-16build1 [66.2kB]
Get:4 http://my.archive.ubuntu.com hardy/main unixodbc 2.2.11-16build1 [289kB]
Get:5 http://my.archive.ubuntu.com hardy/multiverse sun-java6-bin 6-06-0ubuntu1 [27.3MB]
Get:6 http://my.archive.ubuntu.com hardy/multiverse sun-java6-jdk 6-06-0ubuntu1 [9625kB]
85% [6 sun-java6-jdk 3208002/9625kB 33%]

- The final instalation directory is  /usr/lib/jvm/java-6-sun-1.6.0.06
- Ubuntu help to create a java symbolic link and put in /usr/bin for shortcut access
- type java -version to verify.

Post-Installation Setup

Set JAVA_HOME into environment variable

Copy following statement and append to the end of /etc/profile or .bashrc file, make system set JAVA_HOME into system environment variable:

export JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.06"

Source:
http://www.mkyong.com/java/how-to-install-java-jdk-on-ubuntu-linux/

Monday, May 9, 2011

Useful guide to install python 2.5 on Ubuntu 10.04


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


cd Downloads
wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
tar -xvzf Python-2.5.6.tgz
cd Python-2.5.6
./configure --prefix=/usr/local/python2.5
make
make test
sudo make install
sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5 


Reference:
http://welcometoubuntu.blogspot.com/2010/05/howto-install-python-255-on-ubuntu-1004.html

Ubuntu 11.04: finding the "Connect to server" option

Open the file browser, and when it's opened, go to the top where it says "home folder" and go to file -> Connect to server

Source:
http://ubuntuforums.org/showthread.php?t=1750656

Ubuntu 11.04 64bits : install adobe flash player

Wednesday, May 4, 2011

Ubuntu 11.04 And Windows 7 Installation Steps

Total Disc Capacity 298,09GB

This is the desired distribution :
 - 100GB (Windows 7)
 - 100GB (SharedDisc)
 - 98,09 (Ubuntu11.04)

1. Resize you Windows (C:) partition to 100gb using ComputerManagement > Storage > DiscManagement
2. Run the ubuntu liveCD on the option "Run Ubuntu" and using "gparted":
    2.1 Create an 198,09GB extended partition
    2.2 Inside the recently created extended partition: create another 100GB NTFS logical partition called SharedPartition.

3. Run the ubuntu liveCD on the option "Install Ubuntu" and follow the instructions:
    3.1 On the "allocate drive space"screen select "Something else".
    3.2 Create the swap partition i.e. 4096MB
    3.3 Create the ext4 partition with the free space left with "/" mount point
    3.4 Click on "install now"

References:
http://www.datanoia.com/tutorial-como-instalar-ubuntu-9-04-sin-formatear-windows.html
http://www.killertechtips.com/2009/05/05/how-to-resize-partitions-in-windows-7/ 

Thursday, February 17, 2011

Copy Paste Ubuntu terminal server client

I found Copy Paste is not working between my local Ubuntu 9.1 and remote Windows Server 2003. Ubuntu Forum is telling that Copy Paste wont work with RDP, we need to choose RDPv5 as communication protocol!

Source:  http://foxbrush.wordpress.com/2010/01/12/copy-paste-with-terminal-server-client-ubuntu-9-10/

Monday, January 3, 2011

Ubuntu boot error : no init found, Try passing init=bootarg

I got this error:

mount: mounting /dev/mapper/ubuntu-root on /root failed: Invalid argument
mount: mounting /dev on /root/dev failed: No such file or directory
mount: mounting /sys on /root/sys failed: No such file or directory
mount: mounting /proc on /root/proc failed: No such file or directory
Target filesystem doesn't have /sbin/init.
No init found. Try passing init= bootrag


I searched a lot on the web, and I finally found the solution :D

I just had to boot a live cd, load gparted  - partition editor ,  and use the "check" option on the partition labeled as "boot". That's all.