1

I've been using Ubuntu 14.04 LTS for about a year and a half now and I've loved it. I hadn't yet done the upgrade to 16.04 because I didn't have the time. I made some time the other day and opened the terminal and ran sudo apt-get do-release-upgrade. Quite frankly, I'm extremely disappointed. After taking 5 and a half hours to upgrade, my computer took nearly 5 minutes to reboot. I thought it was just a one-time thing (setting things up after the upgrade, similar to the Win10 upgrade). But it takes that long every time. Below are some before/after comparisons (14.04 vs 16.04).

  • Boot time: Before - approx. 1 minute; After - approx. 5 minutes
  • Login time: Before - approx. 15 seconds; After - approx. 2 minutes
  • Shutdown time: Before - approx. 5 minutes; After - approx 7 minutes
  • Memory usage at idle: Before - approx. 60%; After - approx. 80%
  • CPU usage at idle: Before - approx. 20%; After - approx. 75%
  • CPU temp at idle: Before - approx. 40C; After - approx. 55C

I have no idea why its so slow at everything now but I think it may have something to do with some packages not being installed correctly, or perhaps some old ones hanging around sucking up processing power, however, I've run sudo apt update, sudo apt upgrade, and sudo apt auto-remove multiple times each. Is there a way to clean up my system and make it run better?

cheesits456
  • 1,282

2 Answers2

2

There's an excellent chance that your problem was caused by the upgrade from 14.04 to 16.04. An operating system is a complex beast, with thousands of components, and Ubuntu runs on a staggering variety of hardware configurations; it's impossible for the writers of the upgrade script to test the script against all the variations of hardware and software found in the field before releasing it. The upgrade script seems simple and convenient, but it causes lots of problems, and unfortunately many people don't seem to know how dangerous it can be. (Don't feel bad, I learned the hard way too.)

I'm sure that you'd prefer a targeted fix that neatly solves your problem, but if the root of the problem is a flawed OS installation, then you might be forced to use a blunter instrument: wiping the hard drive, and installing 16.04 from scratch (after backing up all your important files, of course).

Here's the outline of how to do it:

  1. In a terminal, do aptitude search '~i!~M' > ~/top-level-packages-before.txt. (You'll need the aptitude package, if it isn't installed.) This creates a file containing a list of all the installed packages, not including dependencies. (Kudos to this answer.)
  2. If you don't have /home in its own partition, back up the entire /home hierarchy. Also back up /etc/X11/xorg.conf, if it exists, and /var/www if you use your computer as a web server. Back up /usr/local/bin, if you have local scripts in there.
  3. If you dual-boot another OS, then boot to an Ubuntu install DVD or USB stick, choose "Try Ubuntu", run GParted, and use it to delete the Ubuntu partitions (except the partition that mounts /home, if /home has its own partition). If you're not dual-booting then skip this step, because the Ubuntu installer needs to see how the computer boots.
  4. Install Ubuntu. Use the installer to wipe out any partitions from the old Ubuntu installation that weren't wiped already, except the partition that mounts /home, if /home has its own partition.
  5. Copy your important files from the backup to the new installation. Unfortunately lots of programs pollute your home folder /home/<username> with junk (type Ctrl+H in Nautilus to see the hidden files and folders; that's where most of the junk is), and copying old config files blindly can cause problems, so you should probably just copy what you need, rather than restoring every last file.
  6. Install aptitude if it isn't installed, and do aptitude search '~i!~M' > ~/top-level-packages-after.txt. Restore ~/top-level-packages-before.txt that you created in the first step, if you haven't already. Do diff ~/top-level-packages-before.txt ~/top-level-packages-after.txt to compare the two files, or use diffuse (kudos to this answer) to discover which packages were installed previously that aren't now. Consider installing those packages.

By the way, many people choose to have /home mounted in its own partition, because it makes installing a new version of the OS from scratch easier. (The popularity of this approach with experienced users shows that many people have come to distrust the upgrade script.) If you're taking my advice and installing the new version of Ubuntu from scratch, you might choose to give /home its own partition while you're installing Ubuntu, just to make the process easier next time. If for some reason you want to move /home to its own partition before installing Ubuntu from scratch, then there is a procedure to do so, but it's a lot of work, and in my opinion it's easier to move /home to its own partition as part of the process of installing the new version of Ubuntu from scratch.

The gist of this answer is borrowed from this Ubuntu forums thread, which has more information. Good luck.

rclocher3
  • 779
  • 8
  • 19
  • @Christian97, thank you for the suggestion to back up /usr/local/scripts, which I have incorporated. Apparently more experienced users thought that the suggestion would have been better made as a comment, but no worries ;) – rclocher3 Dec 17 '16 at 18:53
  • This answer is very in-depth and very high quality. Thank you :) – cheesits456 Dec 17 '16 at 20:37
1

Have you run htop or top to look for heavy processes?

Also, are you running an SSD or HDD? A quick disk speed check could be worth it. I've hard computers that just crawl because of a bad, or even just old and slow disk. This should do the trick, replacing sda with your drive, of course.

sudo hdparm -Tt /dev/sda

and

sudo hdparm -v /dev/sda
George
  • 243