bookmark_borderPrevent / Block package updates under Ubuntu / Debian

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) 😉

Further links

bookmark_borderHow to watch Twitch, YouTube and others with VLC

If you’re a person like me, you may have also a problem with Flash based streams. Flash is and always has been a resource hungry monster with a lot of security issues. The problem is that a lot of streaming platforms still requiring Flash in order to let you watch their streamers, shows or programs. One of this streaming portals for e.g. is Twitch. But luckily there is a solution for a problem like this. The software Streamlink.

About Streamlink

Streamlink is a fork from Livestreamer. The fork happened because the main developer of Livestreamer decided to drop the development for it. Since then, a lot of work has been made in Streamlink, including additional plugins for a lot of video on demand services or streaming platforms. Streamlink is written in Python and uses different libraries to allow users to watch video streams like Twitch with their favorite video viewers (like VLC, MPlayer and so on).

How to install Streamlink on Ubuntu

Steamlink can be easily installed under almost every Linux distrubution. On Ubuntu the latest and greatest Streamlink version can be downloaded through a so called PPA. A PPA is an addition to the already existing package repositories. This PPA is maintained by the official Streamlink developers and can be added to your system like this:

user@machine:~$ sudo add-apt-repository ppa:nilarimogard/webupd

The following two commands are installing Streamlink:

user@machine:~$ sudo apt-get update
user@machine:~$ sudo apt-get install streamlink

That’s it. With these three simple commands you’ve installed Streamlink under your Ubuntu box. There are several other Linux distrubtions supported and there are also Windows and OS X binaries which can be used. You see the full list of supported operating system on the official download page of Streamlink here: Streamlink installation.

How to use Streamlink?

Now that you’ve installed Streamlink, we can start using it. Just simply open a terminal window and enter streamlink, followed by the URL to the stream / video you want to open with your personal video player of your choice (the stream will be shown with the best possible quality, due to the option best):

user@machine:~$ streamlink https://www.twitch.tv/rocketbeanstv best

Platforms like Twitch and YouTube are already supported of course. But there are plenty of other TV stations and Video-on-demand platforms, which are supported and can be used with streamlink, including the Itlian TV station RAI or the german ARD channel. A complete list of built-in plugins can be found here: Streamlink built-in plugins

Tune your Streamlink

Streamlink has a configuration file which is located in your home directory as a hidden file under Linux machines. This file is called .streamlinkrc. You can basically set every option you can also pass to Streamlink through command line in the configuration file. A full set of available options is listed here: Streamlink options.
An important option here however is to set the desired player you want to use with Streamlink. For e.g. if you set the following line in your .streamlinkrc, you are using VLC as the default player whenever you open a stream with Streamlink:

player=vlc

You can change vlc with mplayer any other video play of course. You can also add options which should be passed to the video player. For e.g. starting a stream in full screen with VLC:

player=vlc --fullscreen

Conclusion

Streamlink (or the former livestreamer) is a very needed and loved piece of software. It literally brings back the fun in watching live streams on Twitch or similar platforms. You don’t need to use flash in order to watch your favorite streams. Besides this, streamlink in combination with your video player of choice is way lesser resource hungry than the old flash technology. Give it a try. You will not regret it 😉
However, one downside: There will be no ads shown. While this sounds like a good thing in the first place, please keep in mind that the streamer you’re watching doesn’t get any money. So please, if you enjoy the stream you’re watching, consider subscribing to them for a few bucks per month. The incoming helps the streamer to go on with his / her work and helps Twitch to let the servers running in the future.