-1

Taking a simple example:

run the following commands in a gentoo machine with htop installed:

emerge -av htop

The system will start compilling htop package regardless whether htop has been installed or not.

What I wish to achieve is to give a parameter to emerge so that if htop is installed with the same flag, it wouldn't reinstall it.

I am on the processe of installing a software package, which gives me a huge list of packages for emerging. however, some of them have already installed. I hope this method is able to neglect the packages installed in my pc.

Thanks.

Chenming Zhang
  • 2,446
  • 2
  • 26
  • 34
  • you can write a bash script something like `for i in htop firefox chromium; do if ! equery l "$i" > /dev/null; then emerge -av "$i"; fi; done` – ymonad Oct 28 '14 at 05:13
  • 1
    Yes, but I feel there may be one flag in emerge that directly does that. Yum and apt-get enable that by default. – Chenming Zhang Oct 28 '14 at 05:16
  • Emerge will always rebuild the package you give it even if the use flags did not change. Since you are using '-a' you can say no. If other dependencies are being rebuilt it is probably because the use flags have change. There are a number of places use flags can be changed. http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=2#doc_chap2_sect4 Your profile use flags can be changed with a emerge --sync. This may be what happened in your case. – John Mercier Oct 28 '14 at 12:05

1 Answers1

0

Use emerge option:

--noreplace, -n 

Skips the packages specified on the command-line that have already been installed. Without this option, any package atoms or package sets you specify on the command-line will cause Portage to remerge the package, even if it is already installed. Note that Portage will not remerge dependencies by default. This option can be used to update the world file without re‐building the packages.

--selective

This is identical to the --noreplace option. Some options, such as --update (-u), --changed-use (-U), --newuse(-N), --noreplace, already imply --selective. Use --selective=n if you want to forcefully disable --selective, regardless of other options and always merge all packages

bes
  • 71
  • 1
  • 8