I want to install a non-Ubuntu package manager like Portage (Gentoo) or Pacman (Arch) on Ubuntu 12.04 LTS.
How do I do that?
47 Answers
You don't. A package manager is central to a specific distribution. Gentoo, Arch, Redhat -- they all use different packaging systems. Gentoo's portage packages usually compile from source, Arch uses its own binary package format, Redhat uses RPM as packaging system -- and Debian as well as Ubuntu and Linux Mint use Debian Packages (.deb). Managing your local installation takes place using graphical frontends like Synaptic and Adept, or command-line tools like apt-get, aptitude and dpkg.
Though it is possible to install other package managers on Ubuntu (else they wouldn't be in the repositories), this is not to be recommended for the unexperienced user. One should be quite familiar with packages and package managers, how they work, etc. before even thinking about using them alongside. Otherwise it is very likely to end up with a very broken system -- as one package manager is not aware of the others, they would e.g. overwrite each others files/configurations, uninstalling a package with one package manager could break dependencies with the other, and more.
So for now I'd strongly suggest you stay with the package managers native to your system (see above).
2You cannot should not
Package managers are usually very tightly integrated with a particular Linux distribution, and you cannot usually install a native manager for one distro onto another and expect it to just work. (but see note at the end)
You can install the resulting packages, however, using tools to convert e.g. RPM to DEB, etc. This may be possible for Pacman packages. Portage, as you may be aware, builds everything from source, and you can do this on any distro, not just Gentoo.
2Note: While some like
yumare available in the Ubuntu Universe repositories, and even Pacman, Portage etc. could be installed in theory, it's a bad idea in practice because the packages themselves may not be suited (directory structure, etc.) for Ubuntu.
Due to the different packaging systems, the package managers are not interchangeable without a lot of blood, sweat and tears. Even then, there are a lot of dependency issues, and bugs, and errors, and rabbit holes that you cannot find your way out of. No, it's not it's not impossible, but, it's not recommended. PacApt is your best bet to use Pacman AND Portage commands in Ubuntu without destroying your computer. I believe that it supports commands from all of the major package managers. This is probably your safest bet for installation of Pacman/Portage-likeness in Ubuntu. Check it out.
If it isn't what you are looking for, your best bet (and recommended course of action) may be to install the distribution of the package manager that you want to use.
Source: LifeHacker 2 Here people decribe how to install portage on other linux distibutions than gentoo:
Here a man describe how to install whole gento on other partition from Ubuntu
2I can think of a good reason to want to install Portage on a Debian system. Dependency Hell. Not just for quagmires that people encounter when there are conflicts, but to get-RID of applications that are listed as dependencies that some users may not want.
Example?
What if I am paranoid and do not want "security enhanced Linux" or anything NSA produced on my system? I am not claiming that it is inherently a security flaw, though some exploits have been found in it. What if I am just biased and want it OFF of my system, for no other reason than because the idea of it irritates me? Why should it have to remove every other important application on my system to do it?....I am not saying not to include it in your default system if you want it, but why make it such an arbitrary dependency when it clearly is NOT one?
Netmask? It is not a true dependency for your network manager. I can see how it might be useful on servers, but why do desktop users need it? In fact, it can be a liability to users who want more anonymity by using virtual systems. It also has a bug that lets you do a really easy DDOS-attack, or did back when everyone was mad about it.
Avahi server? Again, could be useful, but why do I need my desktop advertising all its services and daemons? If I wanted more anonymity I would not want such a program advertising my computers services to any hacker or government stooge that wanted it. The printer should be the one saying "I am a printer"....My computer does not need to be the one saying "I am a computer listening on all these ports, are you a printer...are you a printer...are you a printer..". When I try to remove it, it takes too much with it.
Net-bios? Dont need it. Don't want it.
What is the standard reply? Don't remove it. Its an easy answer, but it sucks.
Something like Portage, which CAN install binaries, or even Slackwares style of file management, could do some good for a Debian/Ubuntu based operating system....but then users would just have too much control over their own computers, and we can have that in the open source world now can we?
Today there is a lot of solutions:
- zpkg: you can install any package from alpine, centos, debian, fedora, gentoo, archlinux, ubuntu.
With zpkg you can install programs from other distributions into your system
zpkg will install programs to your home directory. Global installations are also supported (via -g).
- Nix: this have a big repository.
Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Nix runs on Linux, macOS and other systems. Nixpkgs, the Nix Packages collection, contains thousands of packages, many pre-compiled.
- Another one:
JuNest (Jailed User NEST) is a lightweight Arch Linux based distribution that allows to have an isolated GNU/Linux environment inside any generic host GNU/Linux OS and without the need to have root privileges for installing packages.
Contrary to the scaremongering by the people above, of course you can install anything anywhere. You’re just not getting support from your OS for the manually installed things. And you will need to decide the way the two package managers get along yourself, and tell both package managers about it.
Generally, the idea is that you write a package for the foreign package manager in the format of the native packages, then install that, next, add a hook to the native package manager to tell the foreign one that a package is already installed/provided, and do the same for having the foreign tell the native one.
This will work, as long as the package of the foreign’s repository is actually drop-in compatible to the native one. In its binary interface, expected library locations, install locations, config locations, and dependencies. Luckily, all those things are configurable in Portage, and if something is not, it could be automated with a few small smart scripts.
(Of course it’s easier if you can just set a directory prefix for everything installed by the foreign package manager, and hardlink things in if necessary. This plus a better chroot equivalent was essentially what vServers were, before paravirtualization and improved security. And the abomination known as “containers” do the same. But those miss the entire point of Linux/Unix, are actively harming its ecosystem, and only popular with people who can’t think in another mode than “Windows” and those with pointy hair and an iPad that used to print out the Internet. ;) So be careful to avoid losing most of the advantages of using Linux if you do this.)