Thursday, October 25, 2012

PyPI mirror error


Copying /packages/source/Q/Quotient/Quotient-0.3.0.tar.gz
Traceback (most recent call last):
  File "/usr/local/bin/pep381run", line 30, in <module>
    state.synchronize()
  File "/usr/local/lib/python2.7/dist-packages/pep381client/__init__.py", line 119, in synchronize
    self._synchronize()
  File "/usr/local/lib/python2.7/dist-packages/pep381client/__init__.py", line 159, in _synchronize
    self.maybe_copy_file(project, file)
  File "/usr/local/lib/python2.7/dist-packages/pep381client/__init__.py", line 247, in maybe_copy_file
    data = r.read()
  File "/usr/lib/python2.7/httplib.py", line 548, in read
    s = self._safe_read(self.length)
  File "/usr/lib/python2.7/httplib.py", line 647, in _safe_read
    chunk = self.fp.read(min(amt, MAXAMOUNT))
  File "/usr/lib/python2.7/socket.py", line 380, in read
    data = self._sock.recv(left)
socket.error: [Errno 104] Connection reset by peer

Tuesday, October 23, 2012

latex bibtex installation and usage under ubuntu


#install latex under ubuntu
sudo apt-get install texlive
sudo apt-get install texlive-ful
sudo apt-get install gedit-latex-plugin # need to activate the plugin in the gedit->edit->preferences->plugins

#other packages recommended

sudo apt-get install texlive-fonts-recommended latex-beamer texpower texlive-pictures texlive-latex-extra texpower-examples imagemagick


#using in the bash console
latex filename.tex
bibtex filename.aux
latex filename.tex
latex filename.tex

#view the file
xdvi filename
dvips filename # change into .ps file
gv filename.ps # view the .ps file with gv
ps2pdf filename.ps # change into .pdf file from .ps file

Reference:
 http://linuxandfriends.com/2009/10/06/install-latex-in-ubuntu-linux/
 https://help.ubuntu.com/community/LaTeX
 http://www.ccrnp.ncifcrf.gov/~toms/latexforbeginners.html

Monday, October 22, 2012

ubuntu dpkg no lock and status file

Problem:

Upgrade Ubuntu from 12.04 to 12.10 needs a long time, so I just keep the laptop to upgrade unplugged, when getting up, found the dpkg locked for the unusual shutdown, the stupid thing I did is:

Delete the lock, and the dpkg folder

The errors I got is:
       1) Could not open lock file /var/lib/dpkg/lock - open (2: No such file or directory)
       2) Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Solution:

1) sudo mkdir /var/lib/dpkg/
    error 1) and 2) would disappear, however when apt-get update, a new error comes out:

    Could not open file /var/lib/dpkg/status - open (2: No such file or directory)
2) sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status

Now it works fine. 

Thanks the following references: