Hacking LMDE

Archived topics about LMDE 1 and LMDE 2
HTD

Hacking LMDE

Post by HTD »

Here's some hacks I had to apply before LMDE became usable. Most found around here, but let's gather them in one post.

First thing to do after installing is:

Code: Select all

sudo apt-get update && sudo apt-get dist-upgrade
Prepare for lots of very annoying questions and wasting an hour at least. Is there a faster way?

Wait, something's wrong with the clock. If you use another OS like Windows or Ubuntu, setting hardware clock to UTC is not a good idea, so:

Code: Select all

sed -r 's/^UTC=yes/UTC=no/ig' /etc/default/rcS | sudo tee /etc/default/rcS
sudo apt-get install ntp
This will disable UTC time and enable synchronizing with ntp servers. Set the time from panel. Reboot... WAIT, not yet!

Reboot is pretty broken now, it just reloads the kernel, skipping GRUB, so...

Code: Select all

sudo apt-get remove kexec-tools
...should fix the problem. Now we can

Code: Select all

sudo reboot
Now we can fix the broken Synaptic with:

Code: Select all

sudo apt-get install apt-xapian-index
sudo apt-get install apt aptitude synaptic --reinstall
This will enable quick search in it.

Now's the part for ATI Radeon users:

The FGLRX driver:

Code: Select all

sudo apt-get remove --purge fglrx*
sudo apt-get update && sudo apt-get install fglrx-driver fglrx-control
sudo apt-get install libgl1-mesa-dri-experimental compiz-fusion-* fusion-icon
sudo /usr/bin/aticonfig --initial
sudo reboot
After reboot, time to set up ATI and Compiz options.
The most important ATI option is "Tear Free Desktop".
There are plenty of Compiz options to configure, but almost every config will work ok.

I've found I have to use fusion-icon (make it load on startup) to use compiz as window manager. "compiz --replace" method gives us Compiz just once.

If you like Emerald, here's the way for it:

Code: Select all

sudo apt-get install build-essential libxcomposite-dev libpng12-dev libsm-dev libxrandr-dev libxdamage-dev libxinerama-dev libstartup-notification0-dev libgconf2-dev libgl1-mesa-dev libglu1-mesa-dev libmetacity-dev librsvg2-dev libdbus-1-dev libdbus-glib-1-dev libgnome-desktop-dev libgnome-window-settings-dev gitweb curl autoconf automake automake1.9 libtool intltool libxslt1-dev xsltproc libwnck-dev python-dev python-pyrex libprotobuf-dev protobuf-compiler python-sexy wget

wget http://releases.compiz.org/0.8.8/emerald-0.8.8.tar.gz
tar xvzf emerald-0.8.8.tar.gz
cd emerald-0.8.8
./configure --prefix=/usr LIBS=-ldl
make
sudo make install
Now get some themes and test it. Mine works as charm. Not a single crash since 2 weeks. BTW, enable blur to all decorations and enable blur effect in Compiz. Use gaussian blur with at least radius 8. This looks awesome.

Now the font problem. Yes - there IS a font problem. You can see it in Mozilla and other web browsers, also in Komodo and other Mozilla based application. Subpixel rendering behaves wrong, producing colored artifacts around fonts. This looks really ugly. But there's a cool workaround for it:

Code: Select all

sudo rm /etc/fonts/conf.d/10-hinting-slight.conf
sudo rm /etc/fonts/conf.d/10-no-sub-pixel.conf
sudo ln -s /etc/fonts/conf.available/10-hinting-medium.conf /etc/fonts/conf.d/.
sudo ln -s /etc/fonts/conf.available/10-sub-pixel-rgb.conf /etc/fonts/conf.d/.
sudo dpkg-reconfigure fontconfig
Now set full hinting in font setup. Restart browsers and other applications. See? I told you.

The system is almost perfects, but it can get even better. Don't you like this loud beep on start? Or maybe those super nice beeps in terminal? Let's disable pc-speaker!

Code: Select all

echo "blacklist pcspkr" | sudo tee -a  /etc/modprobe.d/blacklist.conf
sudo rmmod pcspkr
Now's better.

Speaking of sound. Have you noticed any glitches in flash? Maybe distorted sound in Skype or Mplayer?
For the sound distortion - the magic recipe is:

Code: Select all

echo /usr/lib/x86_64-linux-gnu/libc/memcpy-preload.so | sudo tee /etc/ld.so.preload
Usable on x64 systems. (I don't know where to find it on non x64 machines, please google it).

Would you like to wake up your pc from sleep with keyboard or mouse? It's easy:

Code: Select all

((echo '#!/bin/sh' && sed -rn 's/^.*(USB[0-9E]+|EUSB).*$/echo \1 > \/proc\/acpi\/wakeup/pg' /proc/acpi/wakeup) | sudo tee /etc/pm/sleep.d/05_usb && sudo chmod +x /etc/pm/sleep.d/05_usb)
Yes, looks awful, but it works immediately. This hack is mine :)

And finally, if you want to make your LMDE really yours customized Linux, you can change the GRUB screen. Here's how:

Install Grub Customizer:

Code: Select all

sudo apt-get install bzr cmake libgtkmm-2.4-dev gettext
bzr branch lp:grub-customizer
cd grub-customizer/
cmake . && make
sudo apt-get install menu hwinfo
sudo make install
...and apply another hack of mine...

Code: Select all

sudo mkdir /etc/grub.d/.disabled
sudo mv /etc/grub.d/06_* /etc/grub.d/.disabled/
sed -r -e 's/\$\{2\}/\$\{GRUB_COLOR_NORMAL\}/g' -e 's/\$\{3\}/\$\{GRUB_COLOR_HIGHLIGHT\}/g' /etc/grub.d/05_debian_theme | sudo tee /etc/grub.d/05_debian_theme > /dev/null
...to enable it work as expected. Without it you would not see the changes. Remember to reapply this hack every time Grub Customizer would refuse to work. This will happen after /etc/grub.d/ files will be updated (grub or some of its components update).

That's all folks. I think all those hacks should be included in updated LMDE ISO. If you know how to do it better, with more automatics - please share your thoughts.

If it was a way to include it in updated ISO - even a complete beginner could install LMDE, which is IMHO way better than Ubuntu :)

PS: If you're not happy with Mint menu and Alt+F2 - don't bother to install Gnome Do. It's broken (conflicts with Compiz). Synapse is the answer. Works exactly the same as Gnome Do and it's not broken :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
lmdeman

Re: Hacking LMDE

Post by lmdeman »

If I can add one more tweak, I found that installing anacron would help preventing the indefinite growth of the system logs by doing periodic logrotate.

Code: Select all

sudo apt-get install anacron
I don't know why it wasn't installed by default, I tought it was a key component to allow cron jobs work right.
TBABill
Level 6
Level 6
Posts: 1355
Joined: Wed Dec 30, 2009 1:02 pm
Location: Leonardtown, MD

Re: Hacking LMDE

Post by TBABill »

SWEET!!! The font fix is EXACTLY what I needed from my post http://forums.linuxmint.com/viewtopic.p ... ts#p439063

Much appreciated!
DataMan

Re: Hacking LMDE

Post by DataMan »

Great Post!

Many thanks for the effort and attention to details.

My vote is to move it to a "stickie" The issues you have addressed are on-going lingering.

-DataMan
User avatar
Oscar799
Level 20
Level 20
Posts: 10398
Joined: Tue Aug 11, 2009 9:21 am
Location: United Kingdom

Re: Hacking LMDE

Post by Oscar799 »

Thread made sticky
Image
GeneC

Re: Hacking LMDE

Post by GeneC »

Would you like to wake up your pc from sleep with keyboard or mouse? It's easy:

Code: Select all

((echo '#!/bin/sh' && sed -rn 's/^.*(USB[0-9E]+|EUSB).*$/echo \1 > \/proc\/acpi\/wakeup/pg' /proc/acpi/wakeup) | sudo tee /etc/pm/sleep.d/05_usb && sudo chmod +x /etc/pm/sleep.d/05_usb)
Yes, looks awful, but it works immediately. This hack is mine
Thanks!
This works beautifully and was sorely missing with standard setup!
ghostdawg

Re: Hacking LMDE

Post by ghostdawg »

Reboot is pretty broken now, it just reloads the kernel, skipping GRUB, so...

sudo apt-get remove kexec-tools

...should fix the problem.
I've noticed it and will try this hack out.

Thnx.
Neck

Re: Hacking LMDE

Post by Neck »

After some bad first experience... and my disk blanking itself... I am back for another try at LMDE. So here is some of the tweak I've done to get what I wanted.


Before dist-upgrade
Telling apt to not install recommended packages
APT sometime install load of pretty unnecessary stuff so to save lot of disk space, download time and potential problems, you can tell APT to only install what you really need.

Code: Select all

echo -e 'APT::Install-Recommends "0";\nAPT::Install-Suggests "0";' | sudo tee /etc/apt/apt.conf.d/99synaptic
the file name is chosen because otherwise it gets created by synaptic and override our preferences


Purge unwanted packages
Before updating all packages you should remove the ones you don't want, saves you updating them. Also there is some you should remove anyway:

Code: Select all

sudo aptitude purge live-installer-slideshow gnome-core
These are a leftover from mint installer and a meta-package from gnome which will suddenly want to install evolution and epiphany...

After that you're all set, go and do dist-upgrade until everything is updated (might error several times, just keep going)


Right after dist-upgrade (32 bit only)
If you're using the 32bit flavour of LMDE, kernel update makes it use PAE, but it doesn't enable the corresponding headers resulting in borked os.

Code: Select all

sudo aptitude install linux-headers-2.6-686-pae
More info in the breakage thread, also if you're already in trouble, select the older kernel at boot time (2.6.32) and do this.


Random tip and tricks
Install nvidia drivers
(make sure you read the part above if you're using a 32bit system) Do the following and then reboot.

Code: Select all

sudo aptitude install nvidia-glx nvidia-xconfig
sudo nvidia-xconfig
Customise login screen look
Took me a while to figure how to do this but eventually managed to. You basically copy the config file to the correct location then edit it.

Code: Select all

sudo cp /etc/gdm3/greeter.gconf-defaults /usr/share/gdm/greeter-config/99_personal
gksudo gedit /usr/share/gdm/greeter-config/99_personal
Fix GRUB hidden timeout
Grub version in LMDE is bugged if you attempt to use hidden timeout. Use the following to fix it.

Code: Select all

sed -r -e 's/\s+set timeout=\$\{2\}/    set timeout=0/g' /etc/grub.d/00_header | sudo tee /etc/grub.d/00_header
Fix gtk3 (terminal) look
This is a DIRTY fix made by myself, but it does the trick for me. First you need to install the gtk3 default theme.

Code: Select all

sudo aptitude install gnome-theme-standard
Then duplicate mint theme's folder and copy the gtk3 part over.

Code: Select all

sudo cp -r /usr/share/themes/Mint-X /usr/share/themes/Mint-X2
sed -e 's/Mint-X/Mint-X2/g' /usr/share/themes/Mint-X2/index.theme | sudo tee /usr/share/themes/Mint-X2/index.theme
sudo cp -r /usr/share/themes/Adwaita/gtk-3.0/ /usr/share/themes/Mint-X2/
Select the "new" theme and tada terminal looks shiny again. Final touch: delete the Adwaita icons as they mess up login (not the most beautiful way to sort it, but gdm is about as customisation-friendly as a rock, so I got bored of looking for the solution).

Code: Select all

sudo rm -rf /usr/share/icons/Adwaita
Disable bluetooth
You may be like me and have a use for bluetooth now and then, so would like to keep it but don't want it up all the time. Easy manipulation to make it disabled by default:

Code: Select all

sudo aptitude install rfkill
sed -e '/exit 0/d' -e '/rfkill block bluetooth/d' /etc/rc.local | sudo tee /etc/rc.local; echo -e "rfkill block bluetooth\nexit 0" | sudo tee -a /etc/rc.local
Setup encrypted private folder
Quite simple but you need to enable the module too so thought I'll add it here.

Code: Select all

sudo aptitude install ecryptfs-utils
sudo modprobe ecryptfs
echo "ecryptfs" | sudo tee -a /etc/modules
ecryptfs-setup-private
Just follow the instructions, once done the encrypted folder is in your home directory.

Disable screen saver
If you don't want your screen to go black, remember you need to disable the screen saver (preferences -> screensaver) AND adjust the power management options (preferences -> power management).

Extra tweaks
You may want to use Ailurus for some extra tweaks (lock gnome panels, set brightness on battery, etc). To install it:

Code: Select all

wget http://ailurus.googlecode.com/files/ailurus_10.10.1-0maverick1_all.deb
gdebi-gtk ailurus_10.10.1-0maverick1_all.deb
rm ailurus_10.10.1-0maverick1_all.deb
When you launch it, it claims there is a new version, ignore that as it doesn't work on LMDE.


Hope this help someone :)
Chris M

Re: Hacking LMDE

Post by Chris M »

Random tip and tricks
Install nvidia drivers
(make sure you read the part above if you're using a 32bit system) Do the following and then reboot.

Code: Select all

sudo aptitude install nvidia-glx nvidia-xconfig
sudo nvidia-xconfig
I'm using the 32-bit LMDE and upgraded successfully to the PAE version (installed linux-headers-2.6-686-pae). I thought my perfromance may have been degraded due to nvidia driver issues (perhaps not being recompiled?).

In any event, I did this and got a message saying something to the effect of there being no xconfig file, and that a new one was created (or something to that effect). When I rebooted, I could not GUI login. I got a command line login. Something got borked.

Any fix suggestions? I'd rather not start from scratch.
Neck

Re: Hacking LMDE

Post by Neck »

Chris M wrote:I'm using the 32-bit LMDE and upgraded successfully to the PAE version (installed linux-headers-2.6-686-pae). I thought my perfromance may have been degraded due to nvidia driver issues (perhaps not being recompiled?).

In any event, I did this and got a message saying something to the effect of there being no xconfig file, and that a new one was created (or something to that effect). When I rebooted, I could not GUI login. I got a command line login. Something got borked.

Any fix suggestions? I'd rather not start from scratch.
The creation of the xorg.conf is normal, LMDE use none by default. For the borkage, see the breakage thread, nvidia drivers are all messed up today :cry:

Anyway a quick fix is to remove xconfig so that you go back to the default (not using nvidia drivers, not optimal but at least you get gui). Login on command, then do:

Code: Select all

sudo rm /etc/X11/xorg.conf 
sudo reboot
Chris M

Re: Hacking LMDE

Post by Chris M »

Neck wrote:
Chris M wrote:I'm using the 32-bit LMDE and upgraded successfully to the PAE version (installed linux-headers-2.6-686-pae). I thought my perfromance may have been degraded due to nvidia driver issues (perhaps not being recompiled?).

In any event, I did this and got a message saying something to the effect of there being no xconfig file, and that a new one was created (or something to that effect). When I rebooted, I could not GUI login. I got a command line login. Something got borked.

Any fix suggestions? I'd rather not start from scratch.
The creation of the xorg.conf is normal, LMDE use none by default. For the borkage, see the breakage thread, nvidia drivers are all messed up today :cry:

Anyway a quick fix is to remove xconfig so that you go back to the default (not using nvidia drivers, not optimal but at least you get gui). Login on command, then do:

Code: Select all

sudo rm /etc/X11/xorg.conf 
sudo reboot
"Timing is everything"!

Thanks. That worked. I was at the root, and sudo rm /etc/X11/xorg.conf took me straight to GUI - no reboot option.

Do I have to reconfigure xconfig?

Did this get me back to the standard open source driver, or should I reinstall the drivers? I don't care about propriatary drivers. Are the basic open source drivers the ones that are messed up right now?

Thanks again.
Neck

Re: Hacking LMDE

Post by Neck »

Chris M wrote: "Timing is everything"!

Thanks. That worked. I was at the root, and sudo rm /etc/X11/xorg.conf took me straight to GUI - no reboot option.

Do I have to reconfigure xconfig?

Did this get me back to the standard open source driver, or should I reinstall the drivers? I don't care about propriatary drivers. Are the basic open source drivers the ones that are messed up right now?

Thanks again.
This got you back to the default drivers which are not optimised for any graphic card and wont support stuff like 3d acceleration. And the messed up drivers are the proprietary ones so you should check breakage thread if you want to install them, or wait like a week.
HTD

Re: Hacking LMDE

Post by HTD »

There are two more bugs to squish:

1. GNOME is started without Compiz. Fusion-icon starts Compiz. It works, but the gnome panel first appears, then disappears, then reappears again. This looks slow and anoying. How to make GNOME to start with Compiz (even without fusion-icon) ?

2. There's something wrong with /etc/init.d/alsa-utils. When I run it manually in terminal - it restores my alsamixer settings. Otherwise - it doesn't. The setting I need is default microphone input. I can change it to rear mic instead of front mic, then manually store it with

Code: Select all

sudo /etc/init.d/alsa-utils restart
, but it's not set properly after reboot. Again, I need manually run

Code: Select all

sudo /etc/init.d/alsa-utils start
. Hint: ALC888 (of which settings I change) is one of 3 available cards. Can it be ignored somehow?

Any clues?
ds2992

Re: Hacking LMDE

Post by ds2992 »

how do i undo this command?

Speaking of sound. Have you noticed any glitches in flash? Maybe distorted sound in Skype or Mplayer?
For the sound distortion - the magic recipe is:

CODE: SELECT ALL
echo /usr/lib/x86_64-linux-gnu/libc/memcpy-preload.so | sudo tee /etc/ld.so.preload
HTD

Re: Hacking LMDE

Post by HTD »

Code: Select all

sudo rm /etc/ld.so.preload
ds2992

Re: Hacking LMDE

Post by ds2992 »

thank you
Sonsum

Re: Hacking LMDE

Post by Sonsum »

This is such a useful thread (I've been running this install for a while, but the synaptic fix will be nice!)
kaizer

Re: Hacking LMDE

Post by kaizer »

Would you like to wake up your pc from sleep with keyboard or mouse? It's easy:

CODE: SELECT ALL
((echo '#!/bin/sh' && sed -rn 's/^.*(USB[0-9E]+|EUSB).*$/echo \1 > \/proc\/acpi\/wakeup/pg' /proc/acpi/wakeup) | sudo tee /etc/pm/sleep.d/05_usb && sudo chmod +x /etc/pm/sleep.d/05_usb)


Yes, looks awful, but it works immediately. This hack is mine
I think this may be the solution to the pb I post couple of weeks ago http://forums.linuxmint.com/viewtopic.php?f=141&t=75548. Indeed I realized that under LMDE my macbook does not resume from suspend. Does this hack fix also the resume from hibernate? I gonna try all this tonight and hope it will also gonna work on my laptop.
If anyone who undertand that command can let me know what is the general idea behind it I would appreciate ... I have been looking for a solution but when I see your hack I relized I was far off from finding anything.

Questions: Is there a downside to include this hack directly in the installer? I mean could this be a fix directly included in the default install? Lambda users would appreciate no to have to fix this kind of issues manually.

Anyway, thanks a lot for sharing this !
leonidas79

Re: Hacking LMDE

Post by leonidas79 »

Great HTD, you are the man 8)

And one question for all, when I install this drivers (fglrx-driver and libgl1-mesa-dri-experimental compiz-fusion) will gnome shell work well (I have Radeon HD 5470 and plan to install gnome shell)?
trenthawkins

Re: Hacking LMDE

Post by trenthawkins »

Brilliant stuff htd.

I followed your suggestions and now have a perfectly working LMDE OS.

Had a hiccup in the middle where i the first update ended with an error and on reboot my computer wouldn't boot into X. I simply just logged into command prompt and used sudo apt-get install -f which rescued the updated process. Needed to re-run the commands sudo apt-get update && sudo apt-get dist-upgrade after reboot, but this worked smoothly and finished the install.

Only problem i know have is that my ethernet connection isn't working. Wireless is though. Any idea?
Network controller : Atheros Communications Inc. AR9285 Wireless Network Adapter
Ethernet controller : Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
Locked

Return to “LMDE Archive”