How To Downgrade Packages In Debian And Arch Linux

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today i want to make a quick video showing you guys how you can downgrade packages on linux should the need arise it's not something you're going to have to do very often but sometimes the need does arise and you need to downgrade a package to a previous version because the new version for whatever reason is broken or buggy so and the reason i want to make this video today is because package management is quite a bit different on linux than it is on windows and right now we have a lot of windows users actually trying out linux for the first time then in windows you install something and it's not working right well you just uninstall it and then go find the previous version on the internet a previous dot exe file you know the windows executable and just install that previous version in linux it's a little trickier because we have package managers that manage all of our packages the versions of those packages the dependencies needed for those packages so typically when you install a package say you install firefox the web browser on version whatever it is right now and then next week firefox releases a new updated firefox well when you update your system you'll upgrade to that new version of firefox but say that new version of firefox is broken or buggy it's not working for you and you want to downgrade to the previous version because you know that was working for you how do you do that well today i'm going to show you how to do this using the app package manager which is the package manager for debian ubuntu linux mint all the various debian and ubuntu based distributions which covers most of desktop linux and i'll also show you guys how to do this on arch linux based distributions as well so let me switch over to my desktop here and this is a virtual machine of ubuntu 2110 and to downgrade a package what you need to do is you're going to need a terminal so i'm going to hit ctrl alt t in ubuntu to open a terminal and then let me go ahead and make it full screen and i'll zoom in the text so you guys can see the commands but typically how you downgrade a package is you sudo apt install package name which is just the standard command line way to install anything but you want to do package name equals version so you want to specify a specific version that way if it's just sudo apt install package name that's always going to be the absolute latest version but you want to specify a previous version usually if i can spell version correctly there you go so how do you know what version of a package you're on right now how do you know what previous versions are available to you well in linux and this is for all distributions if you're wondering what version of a program you have typically they'll have a flag called dash dash version so if i run firefox space dash dash version instead of launching firefox it'll actually print out what version of firefox i'm on right now it's 94.0 you could also with apt get the version of firefox that is currently installed on your system you could do apt list dash a and then name of program in this case firefox and it will list all the available versions of firefox we could install and you see one of them this one here 94.0 and then in brackets it has installed so that's letting us know that is the version currently installed there is 93.0 you know the previous version when released back is still available in the repositories if we wanted to install that so how do we do that well remember it's sudo apt install package equals version so in this case firefox equals and then what we want is this middle part here you know no spaces so we didn't need impish we didn't need amd 64. we just needed this string here and what i'm going to do is i'm going to do a ctrl shift c to copy ctrl shift v to paste in the terminal here and if we did this correctly and give our sudo password it should warn us that this package is now going to be downgraded because this is kind of unusual downgrading a package very rarely are you going to want to ever go to a previous version this is typically when a program is broken and you absolutely have to have it for whatever it is you do on your computer that's the only time you really need to downgrade a program and i'm going to be honest as somebody that's used desktop linux primarily for the last 13 14 years i have downgraded my programs like six times i probably had six programs that i've ever had to downgrade for whatever reason and really most of that has happened in the last four years doing this youtube channel because some of the programs that i rely on to create video content were the packages that were broken and those of course i had to downgrade to to the previous versions that i knew worked because again this is my job and i needed those programs to do what i needed to do but if i hit yes to this answered yes for this yes or no question it will now downgrade firefox from 94.0 to 93.0 so let me clear the screen there one neat tool is apt dash show dash versions if you want to get a list of all the programs installed in their current versions you could use this program here that's typically not installed by default at least not here in ubuntu so i could sudo apt install app dash show dash versions let me just quickly show you what this little program is it's kind of neat now that that's installed i'm going to do apt dash show dash versions and if i did dash a dash p and then firefox we'll get some information about versions of firefox that are available and again it will tell us which one we have installed the very first one installed okay installed so that's currently what we have installed 93.0 but of course 94.0 is the latest one and that's available in the repositories if you run sudo apt dash show dash version space dash i that will update a a cache the apt cache now that you've done that if you just do apt dash show dash versions with no other arguments i believe it will just give you a list yeah it gives you a list of everything that's currently installed what their version number is and whether they're up to date or not now app dash show dash versions it's not something you're really going to need it's an interesting program that's available because it gives you a nice clean list of everything that's installed what their versions are and whether they're up to date or not up to date and that makes it very easy to use regex and things like grip said and awk you know if you needed to find specific packages maybe that are not currently up to date now let me show you how to downgrade packages on arch linux and arch based distributions so let me switch to a vm i have here of manjaro manager of course is an arch based linux distribution now with archbase systems there are several ways you could downgrade a package but there's several ways i could have downgraded a package in that ubuntu vm as well i just showed you one way the most common way which is sudo apt install package equals version in archbase distributions typically people use a program called downgrade downgrade is a bash script and it is available for installation from the aur the arch user repository i don't think downgrade is actually installed by default in manjaro if i did aware is downgrade nothing is returned so let's install it we can use yay or paru depending on if what a ur helper you happen to have installed on your system i think uh manjaro kde has paru installed so i'm gonna install downgrade using paru and it installs very quickly again it's just a bash script that interacts with pacman and to use the downgrade script it's very easy you're going to need sudo privileges anytime you install or uninstall software so use sudo downgrade name of program i'm going to use vim i know i've got vm installed and it looks like manjaro has a safety in place it looks like downgrading from ala is disabled on the stable branch to override this behavior set downgrade underscore from underscore ala to 1. so i think what they're wanting here is sudo and then downgrade from ala i'm just going to do a ctrl shift c ctrl shift v to copy and paste that equals one so since it told us to set that to one and then downgrade them and we get a whole bunch of versions of vm available to us so many more versions available than in ubuntu or you know debian based systems in general typically if you're going to downgrade many times you're only going to get one other option to downgrade to the previous version but on archbase systems we have a lot of versions available to us we can go back several versions previous if we want to so right now the version of vm that is installed has this plus sign here eight two dot three four four one actually let me bring up another terminal because we should actually take a look at the man page for downgrade and you guys should take a look at the man page for downgrade so we've got a nice little example of what the output from downgrade looks like and this is just an example on a program called terraform and you got the pluses and minuses and the minuses indicates versions that were previously installed the plus indicates the version that right now is installed so that is actually very important information uh because you always want to go back if you're downgrading probably to a version you had previously installed because you know that was working right you don't want to just guess at some other version because it may have problems as well so let's downgrade to 50 in the list which is version 8.2.28.91 because that was the previous version of them we had installed and let's see if this works correctly warning cannot resolve vm run time it's a dependency of them the following packages cannot be upgraded due to unreasonable dependencies do you want to do you want to skip the above package for this upgrade and by default it is no and it's going to complain that well we can't resolve this dependency then so i actually wasn't aware that we wouldn't be able to downgrade vm but i'm glad we got that on camera because i did actually want to talk about this at some point is that downgrading packages is something you don't want to be doing this is kind of like a last resort you know situation where if you really need something to work and the current version is not working you downgrade to a previous version because you're going to run into this situation where the dependencies for that previous version of vim they've already moved on to newer versions right and then what are you going to do you're going to have to downgrade those dependencies to previous versions and you may end up in a situation where you've got to downgrade you know 20 50 100 different packages just to downgrade that one program that you need because all the dependencies also have to be downgraded and that's what's happening here now let me try to downgrade something else so maybe something like h-top for example because h-type i know doesn't have any real dependencies so that one would probably be an easy one to demonstrate yeah right now we have version 3.1.0 and there's no previous version that we've ever had installed because there's no minus symbols anywhere so i'm just going to pick one from the list i'll pick number nine and let's see if it will downgrade that for us it looks like it will downgrade h-top to the previous version just fine for us the cool thing about this downgrade script is it adds this here add h-top to ignore packages you want to answer yes to that what this does is it adds h-top to an ignore package list where in any time you update your system going forward you won't automatically get upgraded to that new version of h-top otherwise anytime you do a sudo pacman syu you're just going to be bumped up to that new version of h-type so you want to make sure you add it to that ignore package so that was just a very quick tutorial on how to downgrade packages on debian based distributions and arch based distributions it's not very hard to downgrade packages but once again it's something you don't really want to be doing this is kind of a last resort kind of thing and again you you're going to get into these weird situations for example what i did trying to downgrade them i didn't actually know that was going to happen but i'm glad it did where i couldn't downgrade vim without first going and downgrading a dependency and then that dependency i bet it has other dependencies to it where it's those dependencies have to get downgraded and then you go down this weird rabbit hole where you're downgrading a million packages just to get vim downgraded it's not worth it at that point and what i suggest if you run into a situation like that is try to find a snap flat pack or app image of that program because people often ask me what's the advantages of snap flap pack and app image why do they exist well one of the reasons they exist is it can be any version of a program right if you for example firefox has app images if for whatever reason the current version of firefox on your distribution is buggy or broken and you can't downgrade and it's just not possible for you you can go find an app image of a previous version of firefox very easily so that is why those package formats are great and i know some people are just against snaps flatbacks app images i don't want that on my system well sometimes you have to use what you have to use do you actually want the program or not anyway i hope this quick tutorial video helped you guys out before i go i want to thank a few special people i want to thank the producers of the show devon gabe james matt mitchell paul scott west so call me allen chuck commander angry kurt dowel guide david dilling gregory heiko lee maxim michael mike nitrix ariane alexander peace archan fedor polytechner red prophet stephen and willie these guys they're my highest tiered patrons over on patreon without these guys this little tutorial about how to downgrade a package it wouldn't have been possible the show is also brought to you by each and every one of these ladies and gentlemen as well all these names you're seeing on the screen right now these are all my supporters over on patreon because i don't have any corporate sponsors i'm sponsored by you guys the community if you like my work and want to support me please subscribe to distrotube over on patreon alright guys peace and definitely don't downgrade the kernel unless you have a reason
Info
Channel: DistroTube
Views: 16,846
Rating: undefined out of 5
Keywords: arch linux, manjaro linux, linux tutorial, debian linux, linux distro, package manager, debian gnu/linux, debian os, ubuntu, ubuntu downgrade, debian downgrade, arch linux downgrade, manjaro downgrade, downgrade aur, apt package manager, pacman package manager, linux, gnu linux, linux packages, installing linux software, removing linux software, uninstalling linux software, learn linux, package management, package dependencies linux, distrotube
Id: RGWKj4jYq4o
Channel Id: undefined
Length: 14min 15sec (855 seconds)
Published: Fri Nov 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.