Announcement

Collapse
No announcement yet.

How To -- build a KDE-based Ubuntu by hand

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How To -- build a KDE-based Ubuntu by hand

    OK, I've been playing around with various approaches to this for a while, mostly on my HP Mini 2140. However, that thing's fan will get into a state where it kicks into jet-engine mode and won't stop unless I powercycle the thing. So instead I've switched to a different laptop for my experiments: an Acer Aspire 1420P tablet-with-keyboard, which Microsoft gave to all attendees at PDC 2009. It has a nifty touch screen that works very well in Windows 7 and I hope will work as well when Plasma Active is ready.

    Anyway...so here the procedure I followed. It's a bit lengthy, but that's because I wanted to craft my own setup. I hesitate to call this a distribution, though

    Prepare the base Ubuntu installer
    • Obtain boot.img.gz from http://archive.ubuntu.com/ubuntu/dist/edition/main/installer-arch/current/images/netboot (where dist is "oneric" or "precise" or other and arch is "amd64" or "i386")
    • Copy this file to a USB thumb drive
      • Insert the drive into a USB slot
      • Run sudo chmod 666 /dev/sdY (where sdY is the device assignment for your USB drive)
      • Run sudo zcat boot.img.gz > /dev/sdY


    Run the advanced command-line intstaller
    • Accept the defaults in most cases
    • You'll probably want to supply your own values for the computer name and your user name
    • For the archive mirror, choose something other than the default if you can. I use mirror.anl.gov, it's very fast
    • Partition as you wish
      • Add the noatime option
      • Don't forget to mark the boot partition as "bootable"; I use / whereas some like to use a separate /boot
    • For the booloader, choose GRUB
      • If GRUB wants to "help" by automatically installing to your MBR, don't do that
      • Instead, manually instruct GRUB to install to /dev/sdX (where sdX is the drive containing your boot partition)
      • The above might not be necessary; prior versions of GRUB would install the booloader on the USB! This has been fixed now

    It's time for your first boot
    • You'll see a text-mode Plymouth, and then a blank screen
    • Press [Ctrl]+[Alt]+[F1] to get to a console and log in


    Now let's customize GRUB and some kernel boot parameters
    • Run sudo nano /etc/default/grub and
      • Add # in front of the two GRUB_HIDDEN_ lines
      • Remove quiet splash from inside the quotes in the GRUB_CMDLINE_LINUX_DEFAULT line
      • In those quotes add acpi_osi=Linux pcie_aspm=force
      • If you have an SSD drive, also add noop
      • If you have no need for IPv6, also add ipv6.disable=1
      • remove # in front of GRUB_TERMINAL line
    • Save the file and exit the editor
    • Run sudo update-grub


    Next let's customize mounts
    • To move temporary files to RAM, run sudo nano /etc/fstab and add these at the bottom
      • tmpfs /tmp tmpfs noatime,mode=1777 0 0
    • Also modify your existing mount entries as necessary
      • On real disks, you should already see noatime which was added during the installation
      • For file systems created on SSDs, add ,discard (yes, include the comma) after noatime
      • For file systems created on rotating drives, add ,data=writeback to achieve a slight performance boost
    • Save the file and exit the editor
    • If you followed either (or both) of the bits just above, then you also need to set the mount options; for each volume, run the appropriate command from the list below
      • sudo tune2fs -o discard /dev/sdXn (on SSDs)
      • sudo tune2fs -o journal_data_writeback /dev/sdXn (on rotating disks)


    Avoid occasional sudo problems
    Regular *buntu installs take care of this automatically. You’ll need to do it yourself.
    • Run sudo addgroup --system admin to create the admin group that sudo permits
    • Run sudo adduser user admin to add your user account to the group


    Reboot!
    Then log in again. You'll still be in text-mode, but you won't have to switch TTYs this time.

    Clean up the software sources
    • Run sudo nano /etc/apt/sources.list and
      • Remove some extraneous comment lines at the top; not sure why these are appearing lately
      • If you wish, uncomment the partner and extras repositories
      • If you want to install proposed packages, find the two dist-backports lines, duplicate them, and change backports to proposed (occasionally some of these packages can cause troubles!)
    • Save the file and exit the editor
    • Run sudo apt-get update && sudo apt-get dist-upgrade to pull in upgrades from the changes you just made


    Remove some bloat
    • Apparmor, a mandatory access control system, seems a bit unnecessary for PCs at home. To remove, run:
      • sudo service apparmor teardown
      • sudo apt-get purge apparmor
      • sudo rm -rf /etc/apparmor /etc/apparmor.d
    • To remove Plymouth, see my post Plymouth is for Pilgrims, not PCs
      • But Plymouth finally seems to do something more in Precise -- when I tried this, I saw a lot of disk errors during boot
    • You can free up disk space used by foreign language support files with LocalePurge
      • Run sudo apt-get install localepurge
      • Choose your language's two-letter code (like "en") and also choose the ones for your country code (like the three for "en_US")
      • Run sudo dpkg-reconfigure localepurge to get to a few more settings
      • Answer the same language choices as before; accept the other defaults but choose "non-accurate free space calculation" (this improves the speed of package installation)
      • Finally run sudo localepurge to do the cleanup
      • This will run automatically after every subsequent package install
    • Xapian, a task that indexes packages, sometimes thrashes hard drives; fix this
      • Run sudo nano /etc/cron.weekly/apt-xapian-index
      • Add --update to the end of the each line containing nice
      • Save the file and exit the editor


    Get your sound working
    Alsa defaults to mute. Fix this before you install KDE.
    • Run sudo apt-get install alsa-utils to install Alsa
    • Run sudo alsamixer and ensure nothing's muted
    • Exit the mixer


    Some other utilities will be useful
    Read the man pages for details.
    • Wireless: sudo apt-get install rfkill wireless-tools
    • Package management: sudo apt-get install apt-rdepends deborphan ppa-purge python-software-properties && sudo apt-get install --no-install-recommends apt-file
    • System management: sudo apt-get install acpitool anacron cpufrequtils ethtool gpm laptop-mode-tools lm-sensors pm-utils powertop sdparm vbetool
      • Run sudo sensors-detect to enable appropriate kernel modules to monitor temperatures


    Now time for KDE!
    You could do it once with a single command and pull in the entire KDE SC. However, since I'm hand-crafting my installation, I wanted only a portion of the entire collection.

    First, let's get the base parts of Plasma and the DE. Since kde-baseapps includes Konqueor, which we don't want, we have to be more precise about which parts to install:
    • sudo apt-get install dolphin kde-baseapps-bin kde-workspace kdepasswd kdm kfind khelpcenter4 kompare konsole kate language-pack-kde-en libicu48 plasma-desktop plasma-netbook plasma-widget-folderview plasma-widget-networkmanagement ttf-dejavu


    We want some, but not all, of the items in kdeutils:
    • sudo apt-get install ark filelight kcalc kcharselect kdf ktimer kgpg kwalletmanager p7zip-full rar sweeper unrar unzip zip


    Similarly, we want some, but not all, of the items in kdenetwork, plus replacements for the omitted parts:
    • sudo apt-get install kget krdc plasma-widget-ktorrent quassel rekonq


    We want everything in kdeadmin, but since we're now going directly with packages rather than metapackages, let's continue that:
    • sudo apt-get install kde-config-cron ksystemlog kuser system-config-printer-kde


    And we want parts of kdegraphics:
    • sudo apt-get install gwenview kamera kcolorchooser kgamma kolourpaint4 kdegraphics-mobipocket kdegraphics-strigi-analyzer kdegraphics-thumbnailers kipi-plugins ksnapshot okular okular-extra-backends svgpart


    Also some of kdemultimedia plus replacements for items left out:
    • sudo apt-get install amarok bangarang kamoso kdemultimedia-kio-plugins ffmpegthumbs kmix qtgstreamer-plugins


    Media en- and decoders galore:
    • sudo apt-get install gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly


    Some more useful stuff:
    • sudo apt-get install acpi-support cups kde-config-qt-graphicssystem kde-config-touchpad kde-config-gtk gtk2-engines-oxygen kde-config-grub2 kde-thumbnailer-deb kde-service-menu-fuseiso kfilereplace kmenuedit mesa-utils muon partitionmanager policykit-desktop-privileges smb4k xinput yakuake


    And yes, even parts of kdepim! I really want to like this, and since my test PC is mostly just for browsing the web and reading email (but not other work), let's install only the bits that are mail-related (and the cool stickynote app):
    • sudo apt-get install akonadiconsole akonadi-kde-resource-googledata kaddressbook kmail knotes


    So that's the result of several days of building and rebuilding, installing and removing. I'm rather happy with the outcome; my Aspire (with the SSD) boots to the KDE desktop in under 15 seconds. I will probably fine-tune this over time; if I do, I'll update the thread with a changelog and incorporate the changes into the first post. Hope you find this useful. Feel free to add your comments and suggest changes or additions.

    (Edit 1: minor changes and formatting adjustments)
    (Edit 2: tmpfs and sudo fixes)
    (Edit 3: more refinement)
    (Edit 4: language file needed to make some errors go away)
    Last edited by SteveRiley; Apr 16, 2012, 01:06 AM.

    #2
    Re: How To -- build a KDE-based Ubuntu by hand

    Hi
    ummmmm I think you forgot to dot an i up around line 46!

    So....there IS a development going on to put Plasma on a tablet?

    woodsmoke
    sigpic
    Love Thy Neighbor Baby!

    Comment


      #3
      Re: How To -- build a KDE-based Ubuntu by hand

      Originally posted by woodsmoke
      ummmmm I think you forgot to dot an i up around line 46!
      File a bug!

      Originally posted by woodsmoke
      So....there IS a development going on to put Plasma on a tablet?
      Sure is. Can't wait for it to reach Kubuntu. You can see early builds on SUSE right now.

      Comment


        #4
        Re: How To -- build a KDE-based Ubuntu by hand

        Edit 1.
        • Mount section. Cleaned up text describing what to do for SSDs and rotating disks.
        • De-bloat section. Fixed dpkg-reconfigure command error.
        • Other utilities section. Regrouped sub-parts. Added apt-file, apt-rdepends, and ppa-purge.
        • KDE section, initial part. Added kde-baseapps-bin (contains important utilities). Added kde-workspace (to ensure installation if recommended packages are skipped).
        • KDE section, utilities. Added kgpg.
        • KDE section, graphics. Added kdegraphics-strigi-analyzer.
        • KDE section, multimedia. Replaced kffmpegthumbnailer with ffmpegthumbs to support additional formats.
        • KDE section, useful stuff. Added cups, kde-thumbnailer-deb, xinput. Removed mesa-utils-extra.
        • KDE section, window manager. Removed GLES version of KWin (GLES is a subset of the full OpenGL).

        Comment


          #5
          Re: How To -- build a KDE-based Ubuntu by hand

          Edit 2.
          • tmpfs section. Changed /var to /tmp in first line (oops!).
          • sudo section. Fixes occasional utilities that expect sudo/gksudo/kdesudo to read from the admin group.

          Comment


            #6
            Re: How To -- build a KDE-based Ubuntu by hand

            Edit 3.
            • Other utilities section. Moved apt-file into separate install to skip recommended packages (most users don't need a build system!).
            • KDE section, initial part. Added language-pack-kde-en (for parity with base Ubuntu's language-pack-en).
            • KDE section, graphics part. Added kgamma.
            • KDE section, useful stuff. Added policykit-desktop-privileges. Removed komparator.

            Comment


              #7
              Re: How To -- build a KDE-based Ubuntu by hand

              Edit 4.
              • KDE section, initial part. Added libicu48 to eliminate harmless errors because of a missing language file.

              Comment

              Working...
              X