0

Installing stuff on Linux is really tricky for me because there's so many ways to do it, and then if I want to remove something I don't know how to do it. I have CMake in my /usr/local/bin folder. But it's missing the cmake-gui, so I want to install it, but I want to remove the existing one. When I do apt list --installed there's no CMake, so I can't remove it with that. And I'm pretty sure I didn't put cmake inside the bin folder. CMake has some other files, like in the usr/share, so if I did want to manually remove CMake I'd have to remove that folder, but I don't know if there are any others. The process should be simple like in Windows, you install something, there's a record of it, and you can uninstall it. I know that that's basically what apt is, and I like apt, but the problem is that every SINGLE ONE of the packages I was interested in were REALLY out of date using apt.

Anyway, let's say I remove /usr/local/bin/cmake and usr/share, and then download CMake again, it only comes as a zip or a tar file, which means you can only manually place the files somewhere. Am I supposed to place the files in the /user/local/bin and user/share again? Then in the future if I want to update it I have to manually redo those folders? There's no better way?

Zebrafish
  • 131

1 Answers1

3

Generic Release Methods

There are three flavors of Linux as general broad categories:

  1. Binary Distributions - Packages are chosen by maintainers, frozen at release time and uploaded to the repository for that release.
  2. Rolling Distributions - Most if not all of these are source based, meant to be installed once, with all packages updated forever
  3. Atomic Distributions - When updates are applied if one update fails, all updates fail.

The OP's Choice

The OP has chosen Ubuntu and unwittingly discovered the flaw with a binary distribution. That flaw is:

  • Once the maintainers of any binary distribution choose the release version for a package, that version is "frozen in time" in the distribution's repository until the next release cycle when a newer version is chosen and then again "frozen in time" for that release. This freezing and replacing happens in cycles for binary distributions. In Ubuntu's case, that release cycle is every 6 months (represented by the minor version numbers .04 and .10 respectively. The major version is the year of release. The minor version numbers are:
    • April
    • October

Knowing the above leaves the OP with three options:

  1. Compile Software Manually - NOT RECCOMENDED as it causes the issue the OP posted about.
    • Personal Tip Here: NEVER compile software on a binary distribution, unless there is no other alternative.
    • I've listed the alternative methods below this one. Compiling software on a system with a package manager leaves the package manager unaware that a newer version is installed. It also breaks the FHS (file hierarchy standard) put in place by the distribution and managed by the package manager. This is the OP's issue.
  2. For third-party software, such as CMake use a PPA or Personal Package Archive (See below)
  3. Enable and Check the backports repository. I know this sounds counter intuitive but the backports repository can contain newer versions of software that has been frozen in the main repository

Properly adding the PPA

  1. Read the blogpost: Ubuntu CMake Repository Now Available. Note the version numbers are incorrect.
  2. Verify the new version numbers by reading the PPA install document, and follow that document, making sure to either manually complete the process or by using the linked shell script.

See also: How do I install the latest version of cmake from the command line?.

I'm leaving this answer here as the above question is 11 years old, but I've flagged this as a duplicate.

Update Per Comments

Adding the link below to illustrate the difference in package managers as I think the OP may misunderstand what package managers are used for:

Fedora - Install CMake

Note that Fedora's version of CMake has been "frozen in time" also and may be older than the current version the OP is attempting to install/fix. Fedora also has methods for enabling third-party repositories. See: Fedora - Third-Party Repositories. See also: RPMFusion - The most well-known Third-Party Repository for RPM based distributions

No matter the distribution the third-party repositories are added so that the package manger can manage the dependencies etc. of the already installed packages plus the ones installed from the third-party repositories.

eyoung100
  • 975