Cleaning Up Ubuntu

May 16, 2022 - Reading time: ~1 minute

Here are some ways to clean up an Ubuntu installation

  1. Clean APT cache
    sudo apt clean
  2. Remove old, unused packages
    sudo apt autoremove [--purge]
  3. Use baobab to find large files

Ubuntu Package Holding

April 24, 2022 - Reading time: ~1 minute

Sometimes you make some changes to your system and you just know that something will break if a certain package gets updated. You want to keep that certain package from updating until you're ready for it.

In Ubuntu, or any apt/dpkg based system, you can tell apt to just hold the current package version using apt-mark hold. For example, let's say that if the xxd package gets updated, it will break something for some reason. Tell apt not to update it.

$ sudo apt-mark hold xxd

When you're ready to start updating it again, tell apt that it can update it:

$ sudo apt-mark unhold xxd

It's that simple. If you ever want to check what packages are currently in hold status, there are two ways to do it.

$ dpkg --get-selections | grep "hold"
xxd                                             hold
$ apt-mark showhold
xxd

Categories