Score:0

Two versions of a package installed

ck flag

I have two versions of polybar installed. Running polybar -v I get 3.5.0-12. which polybar gives /usr/local/bin/polybar. I am guessing I installed this outside of apt maybe (its been over a year since I used this PC).

But another version through apt is installed too, version 3.5.5 at /usr/bin/polybar


How do I go about removing the older version and make sure the one from apt repo is used? I honestly can't tell which version is running now (possibly the older one since it is getting invoked when calling polybar).

PS: Could I just delete the one in /usr/local/bin and reinstall one from apt? I've seen this recommended in some deb packages like go although it feels asking for trouble.

Score:2
zw flag

You have to administrate your system more carefully. Inspection of /usr/local is recommended as a first step.

To fix the current situation just run single command to remove locally installed Polybar:

sudo rm /usr/local/bin/polybar

and then use polybar from official deb-package, you can reinstall it at any time by
sudo apt-get install --reinstall polybar .

BharathYes avatar
ck flag
Yup, the newer version took over once the manually installed file was renamed. BTW what do you mean by better administrate? Be aware of what and where I install? I am trying to learn and understand what I have in my PC. For now though I mostly install from the terminal and use Synaptic manager to look into whats installed. Looking forward to learning the proper functions.
Score:2
cn flag

The version in /usr/local/bin/polybar has most definitely not been installed via apt. /usr/local/bin is the location for software which is not part of your distribution, notably self-compiled software. Software installed via apt will normally go to /bin or /usr/bin.

Just removing the manually installed version is indeed the recommended way of resolving this. That may however comprise more than just the file /usr/local/bin/polybar, for example libraries under /usr/local/lib, a man page under /usr/local/man or additional files under /usr/local/share. You may want to look around in your download folder(s) whether you can find the installation archive for that version. Its filename will probably start with polybar, possibly contain the version number 3.5.0-12, and end in an archive extension like .tar.gz, .tgz or similar. Inspect it to find out which files it may have installed and where.

To avoid breaking anything irrevocably you may start by renaming /usr/local/bin/polybar instead of removing it, for example:

sudo mv /usr/local/bin/polybar /usr/local/bin/polybar.DELETEME

But again, check what other files belong to the program, and rename them, too. Then check if the polybar command now runs the correct version successfully. If it does, you can actually delete the bad version with:

sudo rm /usr/local/bin/polybar.DELETEME

and so on for the other renamed files.

BharathYes avatar
ck flag
Moved `polybar` and `polybar-msg` under /usr/local/bin and the latest from apt started working. I'll reinstall it if there is any other issue. As for removing the files I have the git repo cloned but not sure I ever built and installed from source. I'll look into how to properly uninstall it.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.