Did you know that you can block package updates under Ubuntu and Debian? Let’s say you have a lot of packages installed on your Ubuntu / Debian system and (for whatever reason) you want that specific packages aren’t getting updated whenever you do a system upgrade. This short article is going to show you how to prevent this packages from being updated.
APT or Aptitude: Both can block package updates
Debian / Ubuntu basically has two ways to manage packages. To be more specific there are two package managers which can be used on the console for updating, installing and removing packages / software under your Ubuntu / Debian systems. These two solutions are APT and Aptitude. This article describes how to prevent packages from being updated with both solutions. If you don’t know which of those two you should go with: Simply go with the APT tools (apt-get, apt-mark, apt-cache, …).
How to prevent packages from being updated.
You can always prevent packages from being updated with the help of APT. APT comes with every Ubuntu / Debian installation, so the following command should definitely work on any Debian / Ubuntu based system:
user@system:~$ sudo apt-mark hold <name of the package>
You have to change <name of the package> with the package you want to hold of course. So for e.g. if you want to prevent vlc from getting updated, the command would look like this:
user@system:~$ sudo apt-mark hold vlc
If you’re and Aptitude user instead, the command (with the exact same result) looks like this:
user@system:~$ sudo aptitude hold vlc
If you now update your system with the classical apt-get upgrade command for e.g., the package vlc isn’t going to be upgraded. APT, as well as Aptitude, will echo a notice which is saying that the package has been prevented from being updated.
How to unhold the package?
So, to hold a package is rather easy. But what to do when you want to unhold this package in order to get it updated again? If we use our vlc package from the example above again, the command to unhold and make a package available for an update with APT looks like this:
user@system:~$ sudo apt-mark unhold vlc
Again, the same command with the exact same result in Aptitude does look like this:
user@system:~$ sudo aptitude unhold vlc
But why to hold a package anyway?
You may ask yourself why you should hold a package anyway. Well, there are several reasons to do this. For e.g. sometimes you update a package and after this update the software doesn’t work as expected. So if you encounter a problem after an update on a test system, you could hold / block the specific package which causes you trouble on a production system before updating that system. Another example would be that you might have to check the configuration files first before updating a specific software. However, you want to install the latest security updates for the other installed packages. With holding the package you can update the other packages without touching the once you block. Of course there are many other reasons why holding a package is a useful and a needed feature. You can also do this with a graphical solution like Synaptics. However, the console way of block package updates is much more easier and faster (IMHO) 😉
Personally I’m using Arch Linux with Xfce a lot in the last time. A friend of mine also started to switching over from Windows 10 to Linux. She asked me for help and wanted some tips where to start. At this time I thought that for e.g. openSUSE is a very beginner friendly distribution. While this is true, there are other distributions which are even way more beginner friendly. So I tried 3 Linux „beginner“ distributions and made some conclusions:
1. Ubuntu Linux
When I started working with Linux (if I remember correctly this was round about 13 years ago) Ubuntu released their first version which was called „Warty Warthog“, Version 4.10. I’ve never used this one. At this time I played around a lot with SuSE Linux Personal Edition 9.x. My first Ubuntu version was 6.06, called „Dapper Drake“. This one really got me into Linux. This was the first Linux version were almost everything worked with a exception of WLAN. But WLAN was a nightmare under Linux anyway until mid 2000s. A lot of people complaining that Ubuntu didn’t contributed that much to the whole Linux economy. For me that’s not right. Ubuntu started to take care of the user and they tried to make a more end user friendly Linux. After more than 13 years later I would say that they reached their goal. Even if I think that there are a lot of other, way more user friendly distributions out there as of today. Ubuntus Unity desktop is something you love or you hate. I personally like the idea of a bar on the left screen. With the newer versions of Unity you can also always modify the behavior of the left bar. For e.g. let them automatically slide in and out or change the size of the bar itself. The hardware compatibility is very good. Almost every driver gets shipped with the installation. If there is a driver missing, Ubuntu provides a „Additional drivers“ wizard, which installs you the driver you need within minutes. The software repositories are really big. You almost find a piece of software for every single kind of use. In addition to that, you can always check out PPAs for even more software packages. Also, a lot of software like Steam or even Guitar Pro distributing their software as a downloadable .deb package file for easy installing under Debian and / or Ubuntu based distributions. For me as a more advanced user, Ubuntu has two major downsides. The first one is, that they are really bad when it comes to develop for upstream projects. For example, Fedora and openSUSE are giving a lot of things back to upstream projects. Both are paying developers for just doing their normal daily development on the Linux Kernel, the audio subsystem and so on. In 2008 Ubuntu was criticized that they’re under 1% in contribution to upstream prjects. The other major downside is the stability. A lot of people are using the LTS (= Long Term Support) version of the latest Ubuntu release. While this is a wise decision, even with the LTS I’m experienced a lot of stability problems. Anyways, the good mix of stability and „new software versions“ is fine in Ubuntu. You could go of course with Debian stable as a rock solid base, but the software in this repositories are very old. However, Ubuntu is still a very good starting point for beginners and users who just want to „get their work done“. I’m really excited with their next LTS release (18.04). Mark Shuttleworth (the initiator and founder of Ubuntu) decided to drop the Unity desktop and Mir display server and goes instead with the GNOME Shell and Wayland display server as a standard. For me this is a big huge and good step.
2. Linux Mint
Linux Mint started in August 2006 and was released based on Ubuntu 6.06. After more than 10 years later, Linux Mint is one of the most used Linux distributions on the desktop. Linux Mint is for a lot of people what Ubuntu should have been by the beginning. More stable and more polished. For me Linux Mint is a derivative of the latest Ubuntu LTS version with a lot of multimedia codec support and a really great Desktop solution called „Cinnamon“. Cinnamon is with no doubt the heart of Linux Mint. The Linux Mint developers really had a lot of good ideas. With their concept they also trying to speak directly to people who want to switch over from Windows to Linux. Cinnamon is a classical desktop concept with a single bar at the bottom of the screen and a classic desktop which can be used to store applications shortcuts. The central system settings GUI comes with a lot of possibilities. With that being said, it’s somewhat like the Windows system control center. Besides Cinnamon, Linux Mint offers a lot of other desktops to their users. One of them is MATE (a GNOME 2 fork), as well as Xfce and KDE. So, everybody will find a desktop solution for their needs here. Linux Mint also offers a „Linux Mint Debian“ (LMDE) release. This version is based on Debian testing instead of Ubuntu and is something like a rolling release version. I’ve used this Linux Mint version on my own for a longer period. Due to the fact that Linux Mint is literally Ubuntu, there are also the same benefits like extending the existing repositories with the Ubuntu PPAs and the usage of the „Additioinal drivers“ wizard to install yourself the latest proprietary drivers you need. If you’re new to Linux and you want to use a stable Linux distribution with a traditional desktop layout, then Linux Mint with Cinnamon is definitely a Linux distribution which you have to try.
Manjaro is developed mainly in Germany, Austria and France. It’s based on Arch Linux and was initially released in July 2011. Their main goals are to provide a stable, rock solid Linux distribution on a already running rolling release based Linux. Because of this, Manjaro decided to go with Arch Linux as their base system. Manjaro offers a lot of desktops and window managers. Even though, they have one major desktop environment which is Xfce right now. At a lot of interviews and statements they said that they think that Xfce is exactly how a desktop environment should be: flexible, fast and solid and that this would come hand in hand with the UNIX concept. Being a Xfce user myself, I have to confirm this. Xfce is really rock solid and offers a lot of customization options. Xfce is a traditional way of how a Linux desktop. With that being said, if you’re searching for a more fresh and intuitive way of working with your upcoming Linux desktop, then maybe Xfce isn’t the right choice for you. However, Manjaro also offers images with KDE, i3, GNOME, Cinnamon and so on. So there is a desktop environment for every single kind of user out there. As already said, Manjaro is based on Arch Linux, a Linux distribution which states itself to „keep it simple“. Arch Linux (as well as Manjaro) is a rolling release distribution. This means you install your Linux once and you just have to update. No big version jumps like in Ubuntu, no LTS / non-LTS versions, you will always be on top with the newest version of the software available. Manjaro tries to cut down the complex initial setup process you have with an Arch Linux installation and wants to offer something like a „Ubuntu Arch Linux“ – Easy to install, easy to use, but a rock solid and optimized Arch Linux base with the benefits of it’s „keep it simple“ principle. One of the major upsides of Arch Linux and Manjaro is the Linux AUR (Arch Linux user repository). This extends the already big Arch Linux / Manjaro repository with another thousands of packages including proprietary software like Guitar Pro, TeamSpeak and so on. This is simply amazing. If you ask me, Manjaros balancing act between being simple and optimized as Arch Linux while also being easy as Ubuntu is working here 100%. It just makes fun to work with a Linux distribution where so many packages are available and where the setup process is so easy and self explaining. Manjaro is definitely another good option if you just want to get your work done. I highly recommend it.
I can recommend all of the 3 Linux versions to beginners. If you’re a little bit more of a advanced user and want to try out something new, you should give Manjaro a try. I’m really amazed how much the desktop Linux have evolved within the last years. Today almost every machine will be able to run a desktop Linux without having any kind of issue. So, if you tried Linux some years ago and you ran into a lot of troubles, maybe it’s the time now to try it out once more 😉
Image source: wikipedia.org Some annoying problem has been occured on one of the client machines I work with. Every time when I tried to login, the MDM has thrown an error which says that it was unable to login due to undefined commands and variables. The client runs Linux Mint 17, but the problem happens with 18 as well.
If I tried to login MDM failed to load Cinnamon, Gnome, MATE or whatever I tried to use. If I expanded the error login message, it reported, that it was unable to use the additional scripts for the profiles, which were stored in /etc/profile.d/. This scripts, which are made by myself for a longer time now, are using a lot of specific bash stuff (variables, built-in commands, and so on). Sadly, the MDM XSession file comes with a /bin/sh shebang which does not have the same spectrum of commands as bash.
The solution is rather simple. If MDM yells, that it is unable to load the Desktop because of a script error due to a file which is located in /etc/profile.d you simply have to modify the XSession script which comes with MDM. The XSession Script for MDM is located at /etc/mdm/XSession. A simple change of the shebang does solve the problem. Just change the first line of the XSession file from
and you should be able to successfully login again. You should always keep an eye of possible MDM updates. If the MDM Login Manager is updated on your system, it’s very likely, that the XSession file is getting overwritten and you will have the do this change again.