Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Clay Terry
PLUS
Clay Terry
Courses Plus Student 5,350 Points

MySQL server installs on chromebook/ubuntu, but throws an error when I try to connect to it from the command line.

So, my set up is bit different than either version in this tutorial. I use a chromebook with crouton and run ubuntu 14.04. I installed the mysql-server with sudo apt-get install and it appeared to install ok. I did get the following error message saying that the runit package returned an error during the install. The error is as follows:

Errors were encountered while processing: runit E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried several commands to connect to the server. I have typed mysql into the command line, then mysql -u root -p , then my password after the prompt and both times it throws the same error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I have completely removed it twice and done a fresh install to no avail. I gather that this is a fairly common problem with chromebooks and some sites have posted some solutions, but I still can't figure it out without some guidance. It included downloading iptables and adding something to my rc.local. Before I do that though I'm hoping someone can help me out here.

Any other chromebook users on Treehouse? Any help is greatly appreciated!!

2 Answers

Ok so that error tells us there is something messed up with your packaged, to be more specific those that are .deb, I would clear the dependencies first

sudo apt-get clean sudo apt-get autoclean sudo apt-get -f install

and after that configuring the packaged that are installed.

sudo dpkg --configure -a

Also, have you tried running a sudo apt-get update and after that a sudo apt-get upgrade? If you have any error code please let me know.

The second error code appears when there is a problem with the sockets mysql client uses, so... to have those sockets configure first you must have mysql-server installed and running, have you checked the my.cnf file?

Clay Terry
Clay Terry
Courses Plus Student 5,350 Points

Ok, when I ran sudo apt get -f install the following error was printed:

Reading package lists... Done Building dependency tree
Reading state information... 
Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. 
After this operation, 0 B of additional disk space will be used. 
Setting up runit (2.1.1-6.2ubuntu3) ... 
start: Unknown job: runsvdir dpkg: error processing package runit (--configure): subprocess installed post-installation script returned error exit status 
1 Errors were encountered while processing: 
runit 
E: Sub-process /usr/bin/dpkg returned an error code (1)

The update and upgrade commands returns this:

Errors were encountered while processing:
 runit
E: Sub-process /usr/bin/dpkg returned an error code (1)

Clay Terry so, it seems you have a problem with your runit, try running this cmds

sudo apt-get purge runit
sudo apt-get purge git-all
sudo apt-get purge git
sudo apt-get autoremove
sudo apt update
sudo apt install git
Clay Terry
PLUS
Clay Terry
Courses Plus Student 5,350 Points

ran your commands and got the following message after sudo apt install git:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  git-man liberror-perl
Suggested packages:
  git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk
  gitweb git-arch git-bzr git-cvs git-mediawiki git-svn
The following packages will be REMOVED:
  git-daemon-sysvinit
The following NEW packages will be installed:
  git git-man liberror-perl
0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 3306 kB of archives.
After this operation, 21.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main liberror-perl all 0.17-1.1 [21.1 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main git-man all 1:1.9.1-1ubuntu0.3 [699 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty-updates/main git amd64 1:1.9.1-1ubuntu0.3 [2586 kB]
Fetched 3306 kB in 1s (1654 kB/s)
(Reading database ... 136219 files and directories currently installed.)
Removing git-daemon-sysvinit (1:1.9.1-1ubuntu0.3) ...
update-rc.d: /etc/init.d/git-daemon exists during rc.d purge (use -f to force)
dpkg: error processing package git-daemon-sysvinit (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 git-daemon-sysvinit
E: Sub-process /usr/bin/dpkg returned an error code (1)

Hey man sorry, I had tons of work so I couldn't reply. Well the problem persists I believe the problem its either dpkg which is messed up or there are several packages that are fucked up in the configuration. If its the dpkg its as easy as re installing it if its the packages probably you will have to go one by one fixing them. Also as I could check ChromeOS takes its packages from Lubuntu repos maybe that is the problem. If I were you Ill probably try to fix the packages and shit, but If you are in a hurry make a virtual machine put ubuntu and work there until you can fix the problem.