Since the applications are sandboxed, it’s easier to manage the dependencies for different versions. In fact, Snap and Flatpak also allow you to choose and install from available versions. If that’s not possible, check if you can get it in some other packaging formats like Snap, Flatpak, AppImage, etc. It helps get rid of the dependencies hell issues. To install an older version, remove the source of the newer version from your system (if possible). Then it complains about not finding the specified version. Looks good? But the problem comes when you have to update the system. So the command below will install VLC 3.16 along with all the dependencies: sudo apt install -t "o=ubuntu" vlc In my original example, I want to install VLC from Ubuntu’s repository (to get 3.16) instead of the PPA (which gives me 4). You can specify the o,l,a, etc parameters. Release v=22.04,o=Ubuntu,a=jammy-security,n=jammy,l=Ubuntu,c=multiverse,b=i386 Use the command below and search for the repository: apt-cache policy | lessįocus on the lines that come after the repository name: 500 jammy-security/multiverse i386 Packages You have added multiple sources, so you should have some idea about the sources the package comes from. Alternatively, specify the repository source It gets messy.Īn alternative is to specify the source while installing. Even the mentioned dependencies have dependencies on other packages. But I have chosen a complicated example of VLC, which has lots of dependencies. In case you are wondering, the trailing \ at the end of each line is just a way to write a single command over multiple lines.ĭoes it work? In many cases, it will. So that command becomes something like this: sudo apt install vlc=3.0.16-1build7 \ To fix this, you have to provide specific versions of all the dependent packages it complains about. However, Ubuntu tries to install the available higher versions for them, and thus, you get the classic ‘ you have held broken packages‘ error. The vlc package has several dependencies and those dependencies also need specific versions. sudo apt install vlc=3.0.16-1build7īut here’s the thing. But I want to install the older version 3.0.16 for the sake of this tutorial. Since the higher version takes priority, using ‘apt install vlc’ will result in the installation of VLC 4.0. I added the daily build PPA and that gives me the release candidate of VLC version 4.0.Īs you can see, I have two VLC versions available in the system right now: Multiple versions of the same package apt list -a vlc VLC version 3.0.16 is available in Ubuntu’s repositories. I am taking the example of VLC in this tutorial. Now that you know a few potential issues let’s see how to tackle them. If the package has dependencies, you’ll have to install the required version of the dependent packages as well. You have to hold the package and stop it from upgrading. Even if you install the older version of a package, it gets upgraded to the newer version (if available). The older version gets upgraded to the available newer version In the previous example, if I install VLC, it will install version 4.x, not 3.x. If you have the same package available from more than one source, by default, Ubuntu will install the highest available version. The higher version always gets the priority Similarly, you can download a DEB file with a different version and install it. Adding the VLC daily build PPA will give the (unstable) version 4.x. To get multiple versions of the same package, you’ll have to add multiple sources. Use multiple sources for different versions But as soon as the package is upgraded to the new version, the older version is removed from the cache as well as the repositories. You may see two versions for the same package in the apt cache. For example, you run the apt update (but not upgrade), and a new version is available. You may see more than one version in specific cases, temporarily. Ubuntu doesn’t keep older versions of packages in the repository. You need to know a few things about how APT and repositories work in Ubuntu and Debian-based distributions. Things to know about installing a specific version of a program This tutorial will cover all the important aspects of installing a specific program version using apt or apt-get commands. There are several ifs and buts involved here. Sounds like a simple task, right? But things are not as simple as they look. In the screenshot below, you can see that I have two versions of VLC available and I use the command to install the older version: Install specific versions with Ubuntu How do you know which versions are available for a certain package? Use this command: apt list -all-versions package_name Want to install a specific version of a package in Ubuntu? You can do that ‘easily’ in the following manner: sudo apt install package_name=package_version
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |