Category Archives: Linux

Fixed: LXDE-core startlxde gives Gtk-WARNING **: cannot open display: error message

I’d be tasked with installing a GUI on a server for someone else to use. I opted for LXDE as it’s so lightweight and I just wanted the core, no extra gumph. I ran into an issue launching lxde once I’d installed it. Here’s how I fixed it:

Installed LXDE Core
sudo apt-get install lxde-core

I then went to try startx, how I’d normally start a shell if I’d installed gnome or such, startx didn’t exist, so I tired startlxde. It came back with the error “Gtk-WARNING **: cannot open display:
After a bit of searching online I found some people were saying about .xinitrc, but I didn’t have an xinit…. neither did it seem that I had xinit. So I tried the following with instant success

The Fix

Install xinit
sudo apt-get install xinit

Start X

How to clean up after removing a package via apt-get

Say you install a package via apt-get like lubuntu-desktop. There’s a ton of dependencies and apps that get installed because of one simple meta-package install.
If you remove lubuntu-desktop only a small amount of that gets removed. I wanted to dejunk a server and so used the following commands to check what else was installed and to remove them all.

Look at the dependencies to make sure those are what you want to remove
sudo apt-cache depends lubuntu-desktop
Remove these dependencies
sudo apt-cache depends lubuntu-desktop | awk 'NF && /Depends:/ {print "sudo apt-get -y remove "$2}' | sh
Clean up the related dependencies
sudo apt-get autoremove

Fixed: phpMyAdmin is throwing a #2002 cannot log in to the mysql server phpmyadmin

This one had me going round the houses a bit until I the wrong permissions confirmed something to me.
Firstly the /etc/phpmyadmin/ file is crud. For some reason this file doesn’t resemble the actual config file that you should use.
The file /usr/share/phpmyadmin/ is the format that you need for a correct phpMyAdmin configuration, so copy it to /etc/phpmyadmin/

Next you need to edit this config file. This isn’t the hardest of the things in the world to do if you just want the basics. You just need to edit the value for $cfg['Servers'][$i]['host']

Once you’ve done that you can then login to phpMyAdmin using your mySQL credentials and get started.
It will bitch about not having the advanced features enabled. To do this follow the blog post I did at INSTALLING PHPMYADMIN ADVANCED FEATURES ON UBUNTU

Make sure you log out and back in to pick up the changes.


FIXED: Ubuntu Not Seeing More Than 2TB of a Disk

WARNING! Backup your data before proceeding!

For me this process didn’t destroy the data. I completely expected it to, but it didn’t. Make sure you backup in case you’re not as fortunate.

Move into Single Users Mode
sudo init 1

Unmount partition in question
sudo umount /mnt/disk1

Launch PartEd pointing at the disk in question
sudo parted /dev/sdb

Make the Partition Table GPT
mklabel gpt

Accept the warning and quit PartEd
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes

Check the disk (resize2fs required this before it would resize the partition)
sudo e2fsck -f /dev/sdb1

Resize the partition to fill the total available disk space
sudo resize2fs /dev/sdb1

Mount the disk again
sudo mount /mnt/disk1

And hey presto!