Useful content

   open cv
https://stackoverflow.com/questions/40128751/how-to-install-opencv-2-4-13-for-python-2-7-on-ubuntu-16-04
Note:


pip install pygame numpy matplotlib h5py scipy




  To remove pip
sudo apt-get --purge autoremove python3-pip

  Resolved error
https://github.com/ankush-me/SynthText/pull/118/files


  Install pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

pip install pygame numpy matplotlib h5py scipy
pip install opencv-python
pip install pillow
pip install wget



...................................................
    whereis python3.5

It will give you this directory

    /usr/local/bin/python3.5

Then remove this directory

    rm -Rf /usr/local/bin/python3.5



..................................................
   If wifi is not coming

sudo nano resolv.conf

....................................................

Error
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
Solution
sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
$ sudo apt update
OR
$ sudo apt-get update
...................................................................................................................................
Well dpkg (Debian package management system ) package provides the low-level infrastructure for handling the installation and removal of Debian software packages.So removing it was not a good idea, and you can can it back by-


sudo mkdir /var/lib/dpkg/updates
sudo apt-get update
sudo apt-get upgrade
 
 
..............................................................................................
You removed 5 directories, the status file, etc. So, lets try to fix the stuff. First, create the directory:
sudo mkdir -p /var/lib/dpkg/{alternatives,info,parts,triggers,updates} Recover some backups:
sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status Now, let's see if your dpkg is working (start praying):
apt-get download dpkg sudo dpkg -i dpkg*.deb If everything is "ok" then repair your base files too:
apt-get download base-files sudo dpkg -i base-files*.deb Now try to update your package list, etc.:
dpkg --audit sudo apt-get update sudo apt-get check 
.....................................................................
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status.bad
 
 
.................................................................................

It seems you have done something terrible to the directory /var/lib/dpkg refer to this posts here to know more about dpkg This and This
Back to your problem, to solve the problem, you should try doing the following,
First Option
Return the dir status only if it was the one messed up.
sudo mkdir /var/lib/dpkg/updates
Then do
sudo apt-get update
sudo apt-get upgrade
Then install the packages as normal
Second Option(This solution assume you have completely messed up with /var/lib/dpkg
Restore a backup of /dpkg/status/ from /var/backups/ or /var/lib/dpkg/ since status holds the database of dpkg,you will probably be able to restore the database and everything will turn back to normal.
In the dir /var/backups/ you will be having a folder like dpkg.status.0 ,and compressed file dpkg.status.1 ,dpkg.status.2 etc,this are the backups we are targeting,we are going to use backup dpkg.status.0 to restore,do the following:
Since you already have dir /var/lib/dpkg
Copy the backup to that dir
sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/
NOTE:The latest backup is dpkg.status.0 file,but If you want to backup from the archive file i.e. dpkg.status.#.gz do
sudo cp /var/backups/dpkg.status.#.gz /var/lib/dpkg/

gunzip -d /var/lib/dpkg/dpkg.status.#.gz
Then rename dpkg.status.# to status i.e. dpkg.status.0
sudo mv /var/lib/dpkg/dpkg.status.0 /var/lib/dpkg/status
Then create the folder update
sudo mkdir /var/lib/dpkg/update
Then sudo apt-get update and sudo apt-get upgrade
After that you can install the softwares as normal
 
 
  

Comments

Popular posts from this blog

dynamic programming important question