20150528-1 选题

This commit is contained in:
DeadFire 2015-05-28 15:59:04 +08:00
parent fc017032f7
commit abeb7ba464
3 changed files with 507 additions and 0 deletions

View File

@ -0,0 +1,106 @@
11 pointless but awesome Linux terminal tricks
================================================================================
Here are some great Linux terminal tips and tricks, each one as pointless as it is awesome.
![](http://images.techhive.com/images/article/2015/05/slide_01-100587352-orig.png)
### All work and no play... ###
Linux is one of the most astoundingly functional and utilitarian Operating Systems around when it comes to working from the command line. Need to perform a particular task? Odds are there is an application or script you can use to get it done. Right from the terminal. But, as they say in the good book, "All work and no play make Jack really bored or something." So here is a collection of my favorite pointless, stupid, annoying or amusing things that you can do right in your Linux Terminal.
![](http://images.techhive.com/images/article/2015/05/slide_02-100587353-orig.png)
### Give the terminal an attitude ###
Step 1) Type "sudo visudo".
Step 2) At the bottom of the "Defaults" (near the top of the file) add, on a new line, "Defaults insults".
Step 3) Save the file.
"What did I just do to my computer?" you may be asking yourself. Something wonderful. Now, whenever you issue a sudo command and misstype your password, your computer will call you names. My favorite: "Listen, burrito brains, I don't have time to listen to this trash."
![](http://images.techhive.com/images/article/2015/05/slide_03-100587354-orig.png)
### apt-get moo ###
That screenshot you see? That's what typing "apt-get moo" (on a Debian-based system) does. That's it. Don't go looking for this to do something fancy. It won't. That, I kid you not, is it. But it's one of the most commonly known little Easter eggs on Linux. So I include it here, right near the beginning, so I won't get 5,000 emails telling me I missed it in this list.
![](http://images.techhive.com/images/article/2015/05/slide_04-100587355-orig.png)
### aptitude moo ###
A bit more entertaining is aptitude's take on "moo." Type "aptitude moo" (on Ubuntu and the like) and you'll be corrected about thinking "moo" would do anything. But you know better. Try the same command again, this time with an optional "-v" attribute. Don't stop there. Add v's, one at a time, until aptitude gives you what you want.
![](http://images.techhive.com/images/article/2015/05/slide_05-100587356-orig.png)
### Arch: Put Pac-Man in pacman ###
This is one just for the Arch-lovers out there. The de facto package manager, pacman, is pretty fantastic already. Let's make it even better.
Step 1) Open "/etc/pacman.conf".
Step 2) In the "# Misc options", remove the "#" from in front of "Color".
Step 3) Add "ILoveCandy".
Now the progress for installing new packages, in pacman, will include a little tiny Pac-Man. Which should really just be the default anyway.
![](http://images.techhive.com/images/article/2015/05/slide_06-100587358-orig.png)
### Cowsay! ###
Making aptitude moo is neat, I guess, but you really can't use it for much. Enter "cowsay." It does what you think. You make a cow say things. Anything you like. And it's not even limited to cows. Calvin, Beavis, and the Ghostbusters logo are all available in full ASCII art glory type "cowsay -l" for a full list of what's available in this, Linux's most powerful tool. Remember that, like most great terminal applications, you can pipe the output from other applications straight into cowsay (ala "fortune | cowsay").
![](http://images.techhive.com/images/article/2015/05/slide_07-100587359-orig.png)
### Become an 3l33t h@x0r ###
Typing "nmap" isn't something one typically needs to do on a day-to-day basis. But when one does need to "whip out the nmap," one wants to look as l33t as humanly possible. Add a "-oS" to any nmap command (such as "nmap -oS - google.com"). Bam. You're now in what is officially known as "[Script Kiddie Mode][1]." Angelina Jolie and Keanu Reeves would be proud.
![](http://images.techhive.com/images/article/2015/05/slide_08-100587360-orig.png)
### Getting all Discordian ddate ###
If you've ever been sitting around thinking, "Hey! I want today's date to be written in an essentially useless, but whimsical, way"…try typing "ddate". Results like "Today is Setting Orange, the 72nd day of Discord in the YOLD 3181," can really spice up your server logs.
Note: Technically, this is a real thing called the [Discordian Calendar][2], used (in theory) by the followers of [Discordianism][3]. Which means I probably offended somebody. Or maybe not. I'm not really sure. Either way, ddate is a handy tool in any office.
![](http://images.techhive.com/images/article/2015/05/slide_09-100587361-orig.png)
### I See Colors Everywhere! ###
Tired of boring old text? Looking to spruce things up and show the world your true style? lolcat. Install it. Use it. Everywhere. It takes any text input and turns it into a rainbow of wonder and enchantment. Piping text into lolcat (ala "fortune | lolcat") is sure to liven up any party.
![](http://images.techhive.com/images/article/2015/05/slide_10-100587362-orig.png)
### The Steam Locomotive ###
Animated ASCII art steam locomotive in your terminal. You want this. You need this. Install and run "sl". Use "sl -l" for a tiny version. Or, if you want to really spend some time on this, "sl-h". This is the full train, including passenger cars.
![](http://images.techhive.com/images/article/2015/05/slide_11-100587364-orig.png)
### Reverse any text ###
Pipe the output of any text into "rev" and it will reverse the text. "fortune | rev" gives you a fortune. In reverse. Which is, as odd as it may seem, not a misfortune.
![](http://images.techhive.com/images/article/2015/05/slide_12-100587366-orig.png)
### The Matrix is still cool, right? ###
Want your terminal to do that scrolling text, l33t, Matrix-y thing? "cmatrix" is your friend. You can even have it output different colors, which is snazzy. Learn how by typing "man cmatrix". Or, better yet, "man cmatrix | lolcat". Which, really, is the most pointless (but wonderful) thing you can do in the Linux Terminal. So that's where I leave you.
--------------------------------------------------------------------------------
via: http://www.networkworld.com/article/2926630/linux/11-pointless-but-awesome-linux-terminal-tricks.html
作者:[Bryan Lunduke][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.networkworld.com/author/Bryan-Lunduke/
[1]:http://nmap.org/book/output-formats-script-kiddie.html
[2]:http://en.wikipedia.org/wiki/Discordian_calendar
[3]:http://en.wikipedia.org/wiki/Discordianism

View File

@ -0,0 +1,287 @@
27 DNF (Fork of Yum) Commands for RPM Package Management in Linux
================================================================================
DNF aka Dandified YUM is a next generation Package Manager for RPM based Distribution. It was first introduced in Fedora 18 and it is replaced [YUM utility][1] in recent release of Fedora 22.
![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg)
DNF aims at improving the bottlenecks of YUM viz., Performance, Memory Usages, Dependency Resolution, Speed and lots of other factors. DNF does Package Management using RPM, libsolv and hawkey library. Though it does not come per-installed in CentOS and RHEL 7 you can yum, dnf and use it alongside the yum.
You may like to read more about DNF here:
- [Reasons Behind Replacing Yum with DNF][2]
The latest stable release of DNF is 1.0 (at the time of writing of post) which was released on May 11, 2015. It (and all previous version of DNF) is mostly written in Python and is released under GPL v2 License.
### Installation of DNF ###
DNF in not available in the default repository of RHEL/CentOS 7. However Fedora 22 ships with DNF implemented officially.
To install DNF on RHEL/CentOS systems, you need to first install and enable epel-release repository.
# yum install epel-release
OR
# yum install epel-release -y
Though it is not ethical to use -y with yum as it is recommended to see what is being installed in your system. However if this does not matter you much you may use -y with yum to install everything automatically without users intervention.
Next, install DNS package using yum command from epel-release repository.
# yum install dnf
After dnf installed successfully, its time to show you 27 practical usage of dnf commands with examples that will help you to manage packages in RPM based distribution easily and effectively.
### 1. Check DNF Version ###
Check the version of DNF installed on your System.
# dnf --version
![Check DNF Version](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif)
### 2. List Enabled DNF Repositories ###
The option repolist with dnf command, will display all enabled repositories under your system.
# dnf repolist
![Check All Enabled Repositories](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif)
### 3. List all Enabled and Disabled DNF Repositories ###
The option repolist all will print all the enabled/disabled repositories under your system.
# dnf repolist all
![List All Enabled/Disabled Repositories](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif)
### 4. List all Available and Installed Packages using DNF ###
The command “dnf list” will list all the available packages from all the repositories and installed packages on your Linux system.
# dnf list
![List All Packages using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png)
### 5. List all Installed Packages using DNF ###
While the “dnf list” command shows all the available/installed packages from all the repositories. However, you have the option to list only the installed packages using option “list installed” as shown below.
# dnf list installed
![List All Installed Packages](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png)
### 6. List all Available Packages using DNF ###
Similarly, the “list available” option, will list all the packages available to be installed from all the enabled repositories.
# dnf list available
![List Available Packages using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png)
### 7. Search for a Package using DNF ###
If incase, youve no idea about the package that you want install, in such situation you may use search option with dnf command to search for the package that matches the word or string (say nano).
# dnf search nano
![Search Package by Word](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif)
### 8. See what Provides a file/sub-package? ###
The dnf option “provides” find the name of the package that provides specific file/sub-package. For example, if you would like to find what provides /bin/bash on your system?
# dnf provides /bin/bash
![Find File Sub Package](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif)
### 9. Get Details of a Package using DNF ###
Lets assume you want to know the information of a package before installing it on the system, you may use “info” switch to get a detailed information about a package (say nano) as below.
# dnf info nano
![Check Package Information with DNF](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif)
### 10. Install a Package with DNF ###
To install a package called nano, just run the below command it will automatically resolve and install all required dependencies for package nano.
# dnf install nano
![Install Package using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif)
### 11. Updating a Package using DNF ###
You may update only a specific package (say systemd) and leave everything on the system untouched.
# dnf update systemd
![Update a Specific Package](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif)
### 12. Check for System Updates using DNF ###
Check updates for all the system packages installed into the system simply as.
# dnf check-update
![Check For System Update](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif)
### 13. Update All System Packages using DNF ###
You may update the whole system including all the installed packages with following commands.
# dnf update
OR
# dnf upgrade
![Update System](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif)
### 14. Remove/Erase a Package using DNF ###
To remove or erase any unwanted package (say nano), you may use “remove” or “erase” switch with dnf command to remove it.
# dnf remove nano
OR
# dnf erase nano
![Remove Package in Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif)
### 15. Remove Orphan Packages using DNF ###
Those packages that were installed to satisfy dependency may be useless if not being used by other applications. To remove those orphan packages execute the below command.
# dnf autoremove
![Remove Orphan Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif)
### 16. Remove Cached Packages using DNF ###
A lot of time we encounter out-of-date headers and unfinished transactions which results into error while executing dnf. We may clean all the cached packages and headers containing remote package information simply by executing.
# dnf clean all
![Remove DNF Cache](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif)
### 17. Get Help on Specific DNF Command ###
You may get help of any specific dnf command (say clean) just by executing the below command.
# dnf help clean
![Get DNF Command Help](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif)
### 18. List all DNF Commands and Options ###
To list help on all available dnf commands and option simply type.
# dnf help
![Get Help on DNF Options](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif)
### 19. View History of DNF ###
You may call dnf history to look at the list of already executed dnf commands. This way you can be aware of what was installed/removed with time stamp.
# dnf history
![Check DNF History](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif)
### 20. List all Group Packages ###
The command “dnf grouplist” will print all available or installed packages, if nothing is mentioned, it will list all known groups.
# dnf grouplist
![List All Group Packages](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif)
### 21. Install a Group Package using DNF ###
To install a Group of packages bundled together as group package (say Educational Software) simply as.
# dnf groupinstall 'Educational Software'
![Install Group Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif)
### 22. Update a Group Package ###
Lets update a Group Package (say Educational Software) by executing the below command.
# dnf groupupdate 'Educational Software'
![Update Group Package](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif)
### 23. Remove a Group Package ###
We can remove the group Package (say Educational Software) as.
# dnf groupremove 'Educational Software'
![Remove Group Package](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif)
### 24. Install a Package from Specific Repository ###
DNF makes it possible to install any specific package (say phpmyadmin) from a repo (epel) as simply as,
# dnf --enablerepo=epel install phpmyadmin
![Install Package From Specific Repo](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif)
### 25. Synchronize Installed Packages to Stable Release ###
The command “dnf distro-sync” will provides necessary options to synchronize all installed packages to most recent stable version available from any enabled repository. If no package is selected, all installed packages are synchronized.
# dnf distro-sync
![Synchronize Packages to Stable Version](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif)
### 26. Reinstall a Package ###
The command “dnf reinstall nano” will reinstall an already installed package (say nano).
# dnf reinstall nano
![ReInstall Package](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif)
### 27. Downgrade a Package ###
The option “downgrade” will downgrades the named package (say acpid) to lower version if possible.
# dnf downgrade acpid
Sample Output
Using metadata from Wed May 20 12:44:59 2015
No match for available package: acpid-2.0.19-5.el7.x86_64
Error: Nothing to do.
**My observation**: DNF does not downgraded the package as it is supposed to. It has also been reported as bug.
### Conclusion ###
DNF is the upper state of the end of the art Package Manager YUM. It tends to do a lot of processing automatically which is not going to be praised by many experienced Linux System Administrator, as I believe. As a matter of example:
- `--skip-broken` is not recognized by DNF and there is no alternative.
- There is nothing like resolvedep command however you may run dnf provides.
- There is no deplist command to find package dependency.
- You exclude a repo, means the exclusion apply on all operations, unlike yum which excludes those repos only at the time of install and updates, etc.
Several Linux users are not happy the way Linux Ecosystem is moving. First [Systemd removed init system][3] v and now DNF will be replacing YUM sooner in Fedora 22 and later in RHEL and CentOS.
What do you think? are distributions and the whole Linux ecosystem is not valuing its users and moving against their will. Also it is often said in IT industry “Why fix, If not broken?”, and neither init System V is broken nor YUM.
Thats all for now. Please let me know your valuable thoughts in the comments below. Like and share us and help us get spread.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/
作者:[Avishek Kumar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/
[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/
[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/

View File

@ -0,0 +1,114 @@
Things To Do After Installing Fedora 22
================================================================================
Fedora 22 the latest entrant in the community developed line of Red hat operating systems is released on the 26th of May 2015. A lot of speculation and anticipation has been associated with this release of the venerable fedora. Well there are some major changes that are being proposed for Fedora 22.
Systemd is the new kid in the block when it comes to initialization daemons, it is poised to replace the venerable sysvinit module that has long been a part of the Linux ecosystem. Another major change that users will come across in the base python version. Its just that python in available in two different flavors the 2.x and 3.x lines. Each has its fair share of quirks and benefits. So users who might prefer the 2.x flavor might want to install their favorite python. The dandified Yum installer that has been around since Fedora 18 is all set to replace the age old YUM installer. Fedora has finally decided that it is time that DNF replace YUM.
### 1) Install VLC media player ###
Fedora 22 comes with a default media player viz. gnome videos (previously known as totem). If that is fine by you we can skip this step and move ahead. However if you like me prefer the most widely used VLC you can go ahead and install it from the RPMFusion repos. You can do that with :
sudo dnf install vlc -y
### 2) Configure RPMFusion Repos ###
As I already mentioned Fedora is very strict with its ideologies, it does not ship with any non-free components with it. The official repositories does not provide some essential software containing non-free components like multimedia codes. So it is necessary to install some 3rd party repositories which will provide us some essential software. Luckily RPMFusion repositories come to the rescue.
$ sudo dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm
### 3) Install Multimedia Codecs ###
As is said some multimedia codecs and plugins don't ship with fedora. Now who would like to miss out on their favorite shows and movies just because the codes are proprietary. Try this:
$ sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1
### 4) Update your system ###
Fedora is a bleeding edge distribution and hence it releases updates which will fix bugs and loopholes present in your system continuously. Hence it is a good practice to keep your system up to date.
$ sudo dnf update -y
### 5) Uninstall software you may not need ###
Fedora comes with a set of pre-chosen packages that most users can utilize, however for more advanced users, you may recognize that you do not need all of it. It's easy enough to remove any packages you don't need using the following command - I chose to uninstall rhythmbox because I know I won't use it:
$ sudo dnf remove rhythmbox
### 6) Install Adobe Flash ###
We all wish Adobe Flash didn't exist anymore since it is not always know for being the most secure or resource efficient, but for awhile it's here to stay. The only way to install Adobe Flash for Fedora 22 is to install the official RPM from Adobe, as shown below.
You can download the RPM [here][1]. After downloading the file, you can right click and open it like this:
![Install Adobe Flash](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.50.42-PM.png)
Right click and select "Open With Software Install"
Then, simply click install on the window that pops up:
![Install Adobe](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.51.07-PM.png)
Click on "Install" to complete the process of installing the custom RPM from Adobe
Once the process completes, the "Install" button will change to "Remove" and the installation should have finished. If your browser is open during the process, it may ask you to close it first or restart it after the install for the changes to take effect.
### 7) Spin Up a VM with Gnome Boxes ###
So you just installed Fedora and you're loving it, but maybe you need Windows still for something proprietary, or maybe you just want to play with another Linux distro. In any situation, you can use Gnome Boxes, provided with Fedora 22, to easily create a VM or use a live distribution. Follow the steps below to get started using an ISO of your choice! Who knows, maybe you can even check out a [Fedora Spin][2].
First open Gnome Boxes and select "New" in the top left:
![Add a new virtual machine (box)](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.24.46-PM.png)
Click "New" to start the process of adding a new virtual machine.
Next, click to open a file and choose an ISO:
![Choose ISO](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.28.44-PM.png)
After choosing to select a file or ISO, select your ISO. In this case, I had a Debian ISO I installed
Finally, customize the VM settings or use the defaults and click "Create." The VM will start by default and the available VMs will be available in Gnome Boxes as little thumbnails.
![Create VM](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.31.11-PM.png)
Customize the settings to whatever you choose, or keep the defaults. Click "Create" when you are done and the VM will be ready to go.
### 8) Install Google Chrome ###
Firefox is included with Fedora 22, but as with most software, everyone has their browser of choice. If yours happens to be Google Chrome, you can follow the instructions above for Adobe Flash player, however, obviously use the RPM from Google for whichever version of Chrome you download. The latest version can usually be found [here][3].
### 9) Add Social Media and Other Online Accounts ###
Gnome has some nice built in functionality to accommodate accounts for things like Facebook, Google, and other online accounts. You can access the Online Accounts settings through the main Gnome Settings application. You can access the settings by right clicking on the desktop or by finding it in the applications. Then, simply click on Online Accounts and add the accounts of your choosing. If you add an account like Google, for example, you can use it as the default for things like sending email, calendar appointments, interacting with photos and documents, and more.
### 10) Install KDE or another Desktop Environment ###
Some of us just don't like Gnome, and that's okay. Run the following command in Terminal to install everything necessary to use KDE instead. The same instructions can be applied to xfce, lxde, or other desktop environments as well.
$ sudo dnf install @kde-desktop
After the install finishes, log out. When you click on your username, notice the little gear wheel that indicates settings. Click it and select "Plasma." When you log in again, you will be greeted by a fresh KDE desktop.
![Plasma on Fedora 22](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-11.32.27-PM.png)
The Plasma environment after just installing it on Fedora 22
### Conclusion ###
Thats it you are all set to go. Use the system and try out things. If you don't find something according to your liking, linux gives you the freedom to change them. Fedora comes with the latest Gnome shell as its desktop environment, too heavy for you and don't like it. Try KDE or some light weight DE like cinnamon, xfce etc. Wish you a very happy and hassle free Fedora experience. !!
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-how-to/things-do-after-installing-fedora-22/
作者:[Jonathan DeMasi][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://linoxide.com/author/jonathande/
[1]:https://get.adobe.com/flashplayer/
[2]:http://spins.fedoraproject.org/
[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html