I tried installing yum with following command
sudo apt-get install yum*
which took about more than 500 mb packages and a disk space of more than 1gb. What does this command does? and if it is wrong how to revert back these changes?
I tried installing yum with following command
sudo apt-get install yum*
which took about more than 500 mb packages and a disk space of more than 1gb. What does this command does? and if it is wrong how to revert back these changes?
The command
sudo apt-get install yum*
installs all packages with a name containing "yu" (assuming you don't have files matching yum* in the folder you run the command). Most likely you don't want that.
Technically yum* is interpreted as as regular expression meaning "yu followed by zero or more instances of m", and that is used to do substring matching.
To revert the changes see /var/log/apt/history.log which packages you with the command installed and remove them.
It's usually a very bad idea to run commands that you don't understand.
Florian Diesch already explained what happened when you ran the command - it installs all packages that match yum* regex. I'm going to explain how you can undo it.
apt has a log file /var/log/apt/history.log, where you have date and the packages that were installed. Take a look at a sample entry I have:
Start-Date: 2015-09-29 13:10:47
Commandline: apt-get install fail2ban
Install: python-pyinotify:amd64 (0.9.4-1build1, automatic), fail2ban:amd64 (0.8.11-1)
End-Date: 2015-09-29 13:10:54
It states when download began , when ended, in between it shows the exact command ran, and Install: shows all of the packages that were installed in the format package-name:architecture ( version ).
So in order to undo the effects of the command you ran, you need to select all of those packages listed, and run sudo apt-get remove on them.
Here is the small awk script that can give you a list of all those packages.
awk '/Commandline: apt-get install yum/,/End-Date/ { for (i=1;i<=NF;i++){ if($i~/amd64/){ sub(/amd64/,""); gsub(/\:/,""); print $i} } }' /var/log/apt/history.log
What it does it selects all text between Commandline: apt-get install yum and End-Date, finds all fields that have :amd64 string, and prints them out without that part. Remember to replace amd64 with your architecture, which you can find out with dpkg --print-architecture
For instance, here's a short output of my command ran for apt-get install yakuake
xieerqi:$ awk '/Commandline: apt-get install yakuake/,/End-Date/ { for (i=1;i<=NF;i++){ if($i~/amd64/){ sub(/amd64/,""); >
libkde3support4
ntrack-module-libnl-0
libkrosscore4
libqapt2
oxygen-icon-theme
libktexteditor4
kdelibs5-data
libnepomukcleaner4
libkdeui5
libkdeclarative5
libthreadweaver4
phonon-backend-gstreamer
konsole
apt-get is package manager for Ubuntu and other Debian distributives
yum is package manager for Red Hat, Oracle, Arch Linux and other Fedora distributives.
For example:
MacOS package managers are Homebrew and Mac app store
iOS Package manager is App Store
Android package managers are Google Play Store, 1Mobile Market, ApkPure, Mobogenie, ect.
When you run that command you just installed second package manager into your system. Now you can also install "rpm formated fedora apps" too, just run command:
yum-config-manager --add-repo [repository_url]
yum install [fedora_app_name]
and yes, it takes some memory. It’s large package.
As Florian already explained using a regex without proper understanding has negative consequences. Just because a star in one command once did what you expected doesn't mean it's always appropriate or safe syntax. Another user for example tried to install android development tools with android*, which left his system in an unbootable state. Lucky you.
The package manager did warn you. Here is an example from a trusty VM:
$ sudo apt-get install yum*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'yudit-common' for regex 'yum*'
Note, selecting 'libjs-yui3-min' for regex 'yum*'
Note, selecting 'libghc-tinyurl-prof-0.1.0-bf4c8' for regex 'yum*'
Note, selecting 'ibus-table-jyutping' for regex 'yum*'
Note, selecting 'zekr-quran-recitation-online-ayyub' for regex 'yum*'
Note, selecting 'python-yubico-tools' for regex 'yum*'
Note, selecting 'yhsm-yubikey-ksm' for regex 'yum*'
Note, selecting 'libghc-tinyurl-doc' for regex 'yum*'
Note, selecting 'libpam-yubico' for regex 'yum*'
Note, selecting 'yui-compressor' for regex 'yum*'
Note, selecting 'python-yubico' for regex 'yum*'
Note, selecting 'python3-pyudev' for regex 'yum*'
Note, selecting 'yubikey-ksm' for regex 'yum*'
Note, selecting 'fcitx-table-jyutping' for regex 'yum*'
Note, selecting 'yubikey-personalization-gui' for regex 'yum*'
Note, selecting 'compass-yui-plugin' for regex 'yum*'
Note, selecting 'yum-utils' for regex 'yum*'
Note, selecting 'yubiserver' for regex 'yum*'
Note, selecting 'yubikey-personalization' for regex 'yum*'
Note, selecting 'yum' for regex 'yum*'
Note, selecting 'fso-sounds-yue-base' for regex 'yum*'
Note, selecting 'librime-data-jyutping' for regex 'yum*'
Note, selecting 'iwyu' for regex 'yum*'
Note, selecting 'libjs-yui3-common' for regex 'yum*'
Note, selecting 'libjs-yui3-full' for regex 'yum*'
Note, selecting 'yubikey-server-c' for regex 'yum*'
Note, selecting 'libghc-tinyurl-prof' for regex 'yum*'
Note, selecting 'python-pyudev' for regex 'yum*'
Note, selecting 'libghc-tinyurl-dev-0.1.0-bf4c8' for regex 'yum*'
Note, selecting 'yorick-yutils' for regex 'yum*'
Note, selecting 'libkeyutils-dev' for regex 'yum*'
Note, selecting 'libkokyu-dev' for regex 'yum*'
Note, selecting 'quantum-plugin-ryu-agent' for regex 'yum*'
Note, selecting 'libyubikey-dev' for regex 'yum*'
Note, selecting 'keyutils' for regex 'yum*'
Note, selecting 'libjs-yui' for regex 'yum*'
Note, selecting 'keyutils-dbg' for regex 'yum*'
Note, selecting 'libjs-yui-doc' for regex 'yum*'
Note, selecting 'libjs-yui2' for regex 'yum*'
Note, selecting 'yubikey-val' for regex 'yum*'
Note, selecting 'quantum-plugin-ryu' for regex 'yum*'
Note, selecting 'python-myghtyutils' for regex 'yum*'
Note, selecting 'libauth-yubikey-decrypter-perl' for regex 'yum*'
Note, selecting 'neutron-plugin-ryu' for regex 'yum*'
Note, selecting 'xfonts-ayu' for regex 'yum*'
Note, selecting 'libapache2-mod-authn-yubikey' for regex 'yum*'
Note, selecting 'fso-sounds-yue-full' for regex 'yum*'
Note, selecting 'neutron-plugin-ryu-agent' for regex 'yum*'
Note, selecting 'yui-builder' for regex 'yum*'
Note, selecting 'yudit' for regex 'yum*'
Note, selecting 'libyubikey0' for regex 'yum*'
Note, selecting 'yudit-doc' for regex 'yum*'
Note, selecting 'python2.7-yubico' for regex 'yum*'
Note, selecting 'libkokyu-6.0.3' for regex 'yum*'
Note, selecting 'libjs-yui3-doc' for regex 'yum*'
Note, selecting 'libkeyutils1' for regex 'yum*'
Note, selecting 'libjs-yui3-debug' for regex 'yum*'
Note, selecting 'libghc-tinyurl-dev' for regex 'yum*'
Note, selecting 'libauth-yubikey-webclient-perl' for regex 'yum*'
Note, selecting 'fcitx-sayura' for regex 'yum*'
Note, selecting 'libghc-tinyurl-dev' instead of 'libghc-tinyurl-dev-0.1.0-bf4c8'
Note, selecting 'libghc-tinyurl-prof' instead of 'libghc-tinyurl-prof-0.1.0-bf4c8'
Note, selecting 'python-yubico' instead of 'python2.7-yubico'
Note, selecting 'zekr' instead of 'zekr-quran-recitation-online-ayyub'
libkeyutils1 is already the newest version.
libkeyutils1 set to manually installed.
The following extra packages will be installed:
alembic ant ant-contrib ant-optional apache2 apache2-bin apache2-data
binfmt-support ...
...
0 upgraded, 360 newly installed, 0 to remove and 0 not upgraded.
Need to get 291 MB of archives.
After this operation, 1.668 MB of additional disk space will be used.
Do you want to continue? [Y/n]
If you don't want to install +1GB of packages, then just say no at this point and always read carefully.
It's interesting to see that yum and rpm are in the repositories, but I don't remember any site recommending managing software on Debian-based distributions this way and of course there are no repositories configured after installing yum so it can't be used as a replacement for apt. On another note Fedora switched to another tool for package management and installing foreign packages may lead to an unstable system, so I don't see why one would want to install yum.
In simple words, * stands for all (zero or more). apt-get means you are in a debian environment and trying to install yum. That is you are trying to install the whole yum package, of course it will take a lot of memory.