mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-06 23:50:16 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
4272d1223e
@ -0,0 +1,56 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (mayunmeiyouming)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11703-1.html)
|
||||
[#]: subject: (What GNOME 2 fans love about the Mate Linux desktop)
|
||||
[#]: via: (https://opensource.com/article/19/12/mate-linux-desktop)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
GNOME 2 粉丝喜欢 Mate Linux 桌面的什么?
|
||||
======
|
||||
|
||||
> 本文是 24 天 Linux 桌面特别系列的一部分。如果你还在怀念 GNOME 2,那么 Mate Linux 桌面将满足你的怀旧情怀。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/201912/22/073751ugrt47kye0begk3k.jpg)
|
||||
|
||||
如果你以前听过这个传闻:当 GNOME3 第一次发布时,很多 GNOME 用户还没有准备好放弃 GNOME 2。[Mate][2](以<ruby>马黛茶<rt>yerba mate</rt></ruby>植物命名)项目的开始是为了延续 GNOME 2 桌面,刚开始时它使用 GTK 2(GNOME 2 所基于的工具包),然后又合并了 GTK 3。由于 Linux Mint 的简单易用,使得该桌面变得非常流行,并且从那时起,它已经普遍用于 Fedora、Ubuntu、Slackware、Arch 和许多其他 Linux 发行版上。今天,Mate 继续提供一个传统的桌面环境,它的外观和感觉与 GNOME 2 完全一样,使用 GTK 3 工具包。
|
||||
|
||||
你可以在你的 Linux 发行版的软件仓库中找到 Mate,也可以下载并[安装][3]一个把 Mate 作为默认桌面的发行版。不过,在你这样做之前,请注意为了提供完整的桌面体验,所以许多 Mate 应用程序都是随该桌面一起安装的。如果你运行的是不同的桌面,你可能会发现自己有多余的应用程序(两个 PDF 阅读器、两个媒体播放器、两个文件管理器,等等)。所以如果你只想尝试 Mate 桌面,可以在虚拟机(例如 [GNOME box][4])中安装基于 Mate 的发行版。
|
||||
|
||||
### Mate 桌面之旅
|
||||
|
||||
Mate 项目不仅仅可以让你想起来 GNOME 2;它就是 GNOME 2。如果你是 00 年代中期 Linux 桌面的粉丝,至少,你会从中感受到 Mate 的怀旧情怀。我不是 GNOME 2 的粉丝,我更倾向于使用 KDE,但是有一个地方我无法想象没有 GNOME 2:[OpenSolaris][5]。OpenSolaris 项目并没有持续太久,在 Sun Microsystems 被并入 Oracle 之前,Ian Murdock 加入 Sun 时它就显得非常突出,我当时是一个初级的 Solaris 管理员,使用 OpenSolaris 来让自己更多学会那种 Unix 风格。这是我使用过 GNOME 2 的唯一平台(因为我一开始不知道如何更改桌面,后来习惯了它),而今天的 [OpenIndiana project][6] 是 OpenSolaris 的社区延续,它通过 Mate 桌面使用 GNOME 2。
|
||||
|
||||
![Mate on OpenIndiana][7]
|
||||
|
||||
Mate 的布局由左上角的三个菜单组成:应用程序、位置和系统。应用程序菜单提供对系统上安装的所有的应用程序启动器的快速访问。位置菜单提供对常用位置(如家目录、网络文件夹等)的快速访问。系统菜单包含全局选项,如关机和睡眠。右上角是一个系统托盘,屏幕底部有一个任务栏和一个虚拟桌面切换栏。
|
||||
|
||||
就桌面设计而言,这是一种稍微有点奇怪的配置。它从早期的 Linux 桌面、MacFinder 和 Windows 中借用了一些相同的部分,但是又创建了一个独特的配置,这种配置很直观而有些熟悉。Mate 执意保持这个模型,而这正是它的用户喜欢的地方。
|
||||
|
||||
### Mate 和开源
|
||||
|
||||
Mate 是一个最直接的例子,展示了开源如何使开发人员能够对抗项目生命的终结。从理论上讲,GNOME 2 会被 GNOME 3 所取代,但它依然存在,因为一个开发人员建立了该代码的一个分支并继续发展了下去。它的发展势头越来越庞大,更多的开发人员加入进来,并且这个让用户喜爱的桌面比以往任何时候都要更好。并不是所有的软件都有第二次机会,但是开源永远是一个机会,否则就永远没有机会。
|
||||
|
||||
使用和支持开源意味着支持用户和开发人员的自由。而且 Mate 桌面是他们的努力的有力证明。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/12/mate-linux-desktop
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[mayunmeiyouming](https://github.com/mayunmeiyouming)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer)
|
||||
[2]: https://mate-desktop.org/
|
||||
[3]: https://mate-desktop.org/install/
|
||||
[4]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization
|
||||
[5]: https://en.wikipedia.org/wiki/OpenSolaris
|
||||
[6]: https://www.openindiana.org/documentation/faq/#what-is-openindiana
|
||||
[7]: https://opensource.com/sites/default/files/uploads/advent-mate-openindiana_675px.jpg (Mate on OpenIndiana)
|
@ -0,0 +1,76 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Eliminating gender bias in open source software development, a database of microbes, and more open source news)
|
||||
[#]: via: (https://opensource.com/article/19/12/news-december-21)
|
||||
[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt)
|
||||
|
||||
Eliminating gender bias in open source software development, a database of microbes, and more open source news
|
||||
======
|
||||
Catch up on the biggest open source headlines from the past two weeks.
|
||||
![Weekly news roundup with TV][1]
|
||||
|
||||
In this edition of our open source news roundup, we take a look at eliminating gender bias in open source software development, an open source database of microbes, an open source index for cooperatives, and more!
|
||||
|
||||
### Eliminating gender bias from open source development
|
||||
|
||||
It's a sad fact that certain groups, among them women, are woefully underrepresented in open source projects. It's like a bug in the open source development process. Fortunately, there are initiatives to make that under representation a thing of the past. A study out of Oregon State University (OSU) intends to resolve the issue of the lack of women in open source development by "[finding these bugs and proposing redesigns around them][2], leading to more gender-inclusive tools used by software developers."
|
||||
|
||||
The study will look at tools commonly used in open source development — including Eclipse, GitHub, and Hudson — to determine if they "significantly discourage newcomers, especially women, from joining OSS projects." According to Igor Steinmacher, one of the principal investigators of the study, the study will examine "how people use tools because the 'bugs' may be embedded in how the tool was designed, which may place people with different cognitive styles at a disadvantage."
|
||||
|
||||
The developers of the tools being studied will walk through their software and answer questions based on specific personas. The researchers at OSU will suggest ways to redesign the software to eliminate gender bias and will "create a list of best practices for fixing gender-bias bugs in both products and processes."
|
||||
|
||||
### Canadian university compiles open source microbial database
|
||||
|
||||
What do you do when you have a vast amount of data but no way to effectively search and build upon it? You turn it into a database, of course. That's what researchers at Simon Fraser University in British Columbia, along with collaborators from around the globe, did with [information about chemical compounds created by bacteria and fungi][3]. Called the Natural Products Atlas, the database "holds information on nearly 25,000 natural compounds and serves as a knowledge base and repository for the global scientific community."
|
||||
|
||||
Licensed under a Creative Commons Attribution 4.0 International License, the Natural Products Atlas "holds information on nearly 25,000 natural compounds and serves as a knowledge base and repository for the global scientific community." The [website for the Natural Products Atlas][4] hosts the database also includes a number of visualization tools and is fully searchable.
|
||||
|
||||
Roger Linington, an associate professor at SFU who spearheaded the creation of the database, said that having "all the available data in one place and in a standardized format means we can now index natural compounds for anyone to freely access and learn more about."
|
||||
|
||||
### Open source index for cooperatives
|
||||
|
||||
Europe has long been a hotbed of both open source development and open source adoption. While European governments strongly advocate open source, non profits have been following suit. One of those is Cooperatives Europe, which is developing "[open source software to allow users to index co-op information and resources in a standardised way][5]."
|
||||
|
||||
The idea behind the software, called Coop Starter, reinforces the [essential freedoms of free software][6]: it's intended to provide "education, training and information. The software may be used and repurposed by the public for their own needs and on their own infrastructure." Anyone can use it "to reference existing material on co-operative entrepreneurship" and can contribute "by sharing resources and information."
|
||||
|
||||
The [code for Coop Starter][7], along with a related WordPress plugin, is available from Cooperative Europe's GitLab repository.
|
||||
|
||||
#### In other news
|
||||
|
||||
* [Nancy recognised as France’s top digital free and collaborative public service][8]
|
||||
* [Open Source and AI: Ready for primetime in government?][9]
|
||||
* [Open Software Means Kinder Science][10]
|
||||
* [New Open-Source CoE to be launched by Wipro and Oman’s Ministry of Tech & Communication][11]
|
||||
|
||||
|
||||
|
||||
_Thanks, as always, to Opensource.com staff members and [Correspondents][12] for their help this week._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/12/news-december-21
|
||||
|
||||
作者:[Scott Nesbitt][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/scottnesbitt
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i (Weekly news roundup with TV)
|
||||
[2]: https://techxplore.com/news/2019-12-professors-gender-biased-bugs-open-source-software.html
|
||||
[3]: https://www.sfu.ca/sfunews/stories/2019/12/sfu-global-collaboration-creates-world-s-first-open-source-datab.html
|
||||
[4]: https://www.npatlas.org/joomla/
|
||||
[5]: https://www.thenews.coop/144412/sector/regional-organisations/cooperatives-europe-builds-open-source-index-for-the-co-op-movement/
|
||||
[6]: https://www.gnu.org/philosophy/free-sw.en.html
|
||||
[7]: https://git.happy-dev.fr/startinblox/applications/coop-starter
|
||||
[8]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/territoire-numerique-libre
|
||||
[9]: https://federalnewsnetwork.com/commentary/2019/12/open-source-and-ai-ready-for-primetime-in-government/
|
||||
[10]: https://blogs.scientificamerican.com/observations/open-software-means-kinder-science/
|
||||
[11]: https://www.indianweb2.com/2019/12/11/new-open-source-coe-to-be-launched-by-wipro-and-omans-ministry-of-tech-communication/
|
||||
[12]: https://opensource.com/correspondent-program
|
@ -0,0 +1,59 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why We Need Interoperable Service Identity?)
|
||||
[#]: via: (https://www.linux.com/articles/why-we-need-interoperable-identity/)
|
||||
[#]: author: (TC CURRIE https://www.linux.com/author/tc_currie/)
|
||||
|
||||
Why We Need Interoperable Service Identity?
|
||||
======
|
||||
|
||||
[![][1]][2]
|
||||
|
||||
[![][1]][2]
|
||||
|
||||
Interoperable service identity is necessary to secure communication between different cloud providers and different platforms. This presents a challenge with multi-cloud and hybrid deployments. How do you secure service to service communication across those boundaries?
|
||||
|
||||
Evan Gilman, Staff Engineer at [Scytale.io][3] and co-author of _Zero Trust Networks_, illustrates this issue: when you’re in AWS, you’ll use an AWS IAM role in order to identify which instance a certain role should or should not have access to. But in today’s multi-platform world, you can be communicating from AWS to GCP to your on-prem infrastructure. Those systems do not understand what IAM role is because it is AWS-specific.
|
||||
|
||||
This is what Scytale is trying to address. *“*We are bringing a platform-agnostic identity, meaning, an identity that is not specific to a cloud provider or a platform, or any specific kind of technology,” he said.
|
||||
|
||||
**What’s SPIFFE?**
|
||||
|
||||
[Secure Production Identity Framework for Everyone (SPIFFE)][4] is a set of specifications that define interoperability across all tech platforms, such as how to format the name, the shape of the document, how you validate documents, etc. “This SPIFFE level is like a secure dial tone,” Gilman explains. “You pick up the phone, it rings the other side, doesn’t really matter what platform it is or where it’s running or anything like that. The SPIFFE authentication occurs and you get a nice little layer of encryption and some authenticity insurances as well.”
|
||||
|
||||
But at the end of the day, SPIFFE is just a set of documents. SPIRE is the software implementation of the SPIFFE specifications.
|
||||
|
||||
“Think about the way the passports work,” he said. “If you look at passports from different countries, they may be slightly different, but they have similar characteristics like SPIFFE specifications. They’re all the same size. They all have a picture in the same spot. They have the same funny-looking barcode at the bottom, and so on. So, when you show your passport at a country border, they know how to read your passport, no matter what country that passport is from. SPIRE is the passport agency in this analogy. Where does this passport come from? Who gives it to you? How do you get it and how do you do that in an automated fashion?”
|
||||
|
||||
SPIRE implements these SPIFFE specifications and enables workloads and services to get these passports as soon as they boot in a way that is very reliable, scalable, and very highly automated.
|
||||
|
||||
**Zero Trust**
|
||||
|
||||
Gilman is taking the philosophy of Zero Trust — don’t trust anybody whatsoever — and applying it to network infrastructure and service-to-service communication. “We do this by removing all the security functions from the network and making no assumptions about what should or should not be allowed based on IP address,” he said.
|
||||
|
||||
“Instead, we build systems in such a way that they don’t rely on that network to deliver trustworthy information. We use protocols for strong authentication and authorization to try to mitigate any kind of funny business that might happen on the wire.”
|
||||
|
||||
**Into the New Decade**
|
||||
|
||||
For Scytale, Gilman’s biggest push for 2020 is to provide documentation with detailed examples of how to solve different use cases, and how to configure the software to solve those use cases. “Very clear-cut guidance,” he states. “We have a lot of flexibility and features built into the software, but we don’t have conceptual guidelines that can teach people how the internals are working and stuff like that. We button everything up and make the experience really easy to pick up for folks who might not necessarily want to get in the weeds with it. They just want it to work.”
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linux.com/articles/why-we-need-interoperable-identity/
|
||||
|
||||
作者:[TC CURRIE][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.linux.com/author/tc_currie/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.linux.com/wp-content/uploads/2019/12/computer-2930704_1280-696x413.jpg (computer-2930704_1280)
|
||||
[2]: https://www.linux.com/wp-content/uploads/2019/12/computer-2930704_1280.jpg
|
||||
[3]: http://scytale.io/
|
||||
[4]: https://spiffe.io/
|
@ -1,3 +1,4 @@
|
||||
Translating by robsean
|
||||
How to create an e-book chapter template in LibreOffice Writer
|
||||
======
|
||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_colorbooks.png?itok=vNhsYYyC)
|
||||
|
@ -0,0 +1,72 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Customize your Linux desktop with KDE Plasma)
|
||||
[#]: via: (https://opensource.com/article/19/12/linux-kde-plasma)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Customize your Linux desktop with KDE Plasma
|
||||
======
|
||||
This article is part of a special series of 24 days of Linux desktops.
|
||||
If you think there's no such thing as too much opportunity to customize
|
||||
your desktop, KDE Plasma may be for you.
|
||||
![5 pengiuns floating on iceburg][1]
|
||||
|
||||
The Plasma desktop by the KDE community is a pinnacle among open source desktops. KDE got into the Linux desktop market early, but since its foundational Qt toolkit did not have a fully open license at the time, the [GNOME][2] desktop was created. Since then, Qt has become open source, and KDE (and its derivatives, like the [Trinity desktop][3]) has thrived.
|
||||
|
||||
You may find the KDE desktop in your distribution's software repository, or you can download and install a distribution that ships KDE as its default. Before you install, be aware that KDE provides a full, integrated, and robust desktop experience, so several KDE applications are installed along with it. If you're already running a different desktop, you will find yourself with redundant applications (two PDF readers, several media players, two or more file managers, and so on). If you just want to try the KDE desktop without committing to it, you can install a KDE-based distribution in a virtual machine, such as [GNOME Boxes][4], or you can try a bootable OS like [Porteus][5].
|
||||
|
||||
### KDE desktop tour
|
||||
|
||||
The [KDE Plasma][6] desktop is relatively boring at first glance—but in a comforting way. It's got the industry-standard layout: pop-up application menu in the bottom-left corner, taskbar in the middle, system tray on the right. It's exactly what you'd expect from a standard household or business computer.
|
||||
|
||||
![KDE Plasma desktop][7]
|
||||
|
||||
What sets KDE apart, though, is that you can change nearly anything you want. The Qt toolkit can be taken apart and rearranged in some surprising ways, meaning you can essentially design your own desktop using KDE's parts as your foundation. The settings available for how your desktop behaves are vast, too. KDE can act as a standard desktop, a tiling window manager, and anything in between. You can create your own window rules by window class, role, type, title, or any combination thereof, so if you want specific applications to behave differently than everything else, you can create an exception to global settings.
|
||||
|
||||
Furthermore, there's a rich collection of widgets to enable you to customize the way you interface with your desktop. There's a GNOME-like full-screen application launcher, a Unity-like dock launcher and icons-only taskbar, and a traditional taskbar. You can create and place panels on any edge of the screen you want.
|
||||
|
||||
![A slightly customized KDE desktop][8]
|
||||
|
||||
There's so much customization, in fact, that one of the most common critiques of KDE is that it's _too customizable_, so keep in mind that customization is optional. You can use the Plasma desktop in its default configuration, and change things gradually and only as you feel necessary. What matters most about Plasma desktop configuration options isn't their number, but that they're discoverable and intuitive, either in the System Settings application or with a right-click.
|
||||
|
||||
The fact is, on KDE, there's almost never just one way to accomplish any given task, and its users see that as its greatest strength. There's no implied workflow in KDE, only a default. And all defaults can be changed, until everything you need to do with your desktop is second-nature.
|
||||
|
||||
### Consistency and integration
|
||||
|
||||
The KDE community prides itself on consistency and integration, made possible through great developer and community management and the KDE libraries. The developers of KDE aren't just developers of a desktop. They provide a [stunning collection of applications][9], each of them created with KDE libs that extend and standardize common Qt widgets. It's no accident that after using KDE for a few months, whether you open [DigiKam][10] for photo management or Kmail to check email or KTorrent to grab the latest ISO or Dolphin to manage files, your muscle memory takes you where you need to go in the UI before you consciously think about it.
|
||||
|
||||
![KDE on Porteus][11]
|
||||
|
||||
### Try KDE
|
||||
|
||||
KDE has something for everyone. Use its default settings for a smooth, plain-vanilla desktop experience, or customize it to make it your own. It's a stable, attractive, and robust desktop environment that probably has everything you need for whatever you want to do on Linux.
|
||||
|
||||
KDE originally stood for Kool Desktop Environment, but is now known by many as the K Desktop...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/12/linux-kde-plasma
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux31x_cc.png?itok=Pvim4U-B (5 pengiuns floating on iceburg)
|
||||
[2]: https://opensource.com/article/19/12/gnome-linux-desktop
|
||||
[3]: https://opensource.com/article/19/12/linux-trinity-desktop-environment-tde
|
||||
[4]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization
|
||||
[5]: https://opensource.com/article/19/6/linux-distros-to-try
|
||||
[6]: https://kde.org/plasma-desktop
|
||||
[7]: https://opensource.com/sites/default/files/uploads/advent-kde-presskit.jpg (KDE Plasma desktop)
|
||||
[8]: https://opensource.com/sites/default/files/uploads/advent-kde-dock.jpg (A slightly customized KDE desktop)
|
||||
[9]: https://kde.org/applications/
|
||||
[10]: https://opensource.com/life/16/5/how-use-digikam-photo-management
|
||||
[11]: https://opensource.com/sites/default/files/uploads/advent-kde.jpg (KDE on Porteus)
|
288
sources/tech/20191221 Testing your Bash script.md
Normal file
288
sources/tech/20191221 Testing your Bash script.md
Normal file
@ -0,0 +1,288 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Testing your Bash script)
|
||||
[#]: via: (https://opensource.com/article/19/12/testing-bash-script)
|
||||
[#]: author: (David Both https://opensource.com/users/dboth)
|
||||
|
||||
Testing your Bash script
|
||||
======
|
||||
In the fourth and final article in this series on automation with shell
|
||||
scripts, learn about initializing variables and ensuring your program
|
||||
runs correctly.
|
||||
![Team checklist and to dos][1]
|
||||
|
||||
In the [first article][2] in this series, you created your first, very small, one-line Bash script and explored the reasons for creating shell scripts. In the [second article][3], you began creating a fairly simple template that can be a starting point for other Bash programs and began testing it. In the [third article][4], you created and used a simple Help function and learned about using functions and how to handle command-line options such as **-h**.
|
||||
|
||||
This fourth and final article in the series gets into variables and initializing them as well as how to do a bit of sanity testing to help ensure the program runs under the proper conditions. Remember, the objective of this series is to build working code that will be used for a template for future Bash programming projects. The idea is to make getting started on new programming projects easy by having common elements already available in the template.
|
||||
|
||||
### Variables
|
||||
|
||||
The Bash shell, like all programming languages, can deal with variables. A variable is a symbolic name that refers to a specific location in memory that contains a value of some sort. The value of a variable is changeable, i.e., it is variable. If you are not familiar with using variables, read my article [_How to program with Bash: Syntax and tools_][5] before you go further.
|
||||
|
||||
Done? Great! Let's now look at some good practices when using variables.
|
||||
|
||||
I always set initial values for every variable used in my scripts. You can find this in your template script immediately after the procedures as the first part of the main program body, before it processes the options. Initializing each variable with an appropriate value can prevent errors that might occur with uninitialized variables in comparison or math operations. Placing this list of variables in one place allows you to see all of the variables that are supposed to be in the script and their initial values.
|
||||
|
||||
Your little script has only a single variable, **$option**, so far. Set it by inserting the following lines as shown:
|
||||
|
||||
|
||||
```
|
||||
################################################################################
|
||||
################################################################################
|
||||
# Main program #
|
||||
################################################################################
|
||||
################################################################################
|
||||
# Initialize variables
|
||||
option=""
|
||||
################################################################################
|
||||
# Process the input options. Add options as needed. #
|
||||
################################################################################
|
||||
```
|
||||
|
||||
Test this to ensure that everything works as it should and that nothing has broken as the result of this change.
|
||||
|
||||
### Constants
|
||||
|
||||
Constants are variables, too—at least they should be. Use variables wherever possible in command-line interface (CLI) programs instead of hard-coded values. Even if you think you will use a particular value (such as a directory name, a file name, or a text string) just once, create a variable and use it where you would have placed the hard-coded name.
|
||||
|
||||
For example, the message printed as part of the main body of the program is a string literal, **echo "Hello world!"**. Change that to a variable. First, add the following statement to the variable initialization section:
|
||||
|
||||
|
||||
```
|
||||
`Msg="Hello world!"`
|
||||
```
|
||||
|
||||
And now change the last line of the program from:
|
||||
|
||||
|
||||
```
|
||||
`echo "Hello world!"`
|
||||
```
|
||||
|
||||
to:
|
||||
|
||||
|
||||
```
|
||||
`echo "$Msg"`
|
||||
```
|
||||
|
||||
Test the results.
|
||||
|
||||
### Sanity checks
|
||||
|
||||
Sanity checks are simply tests for conditions that need to be true in order for the program to work correctly, such as: the program must be run as the root user, or it must run on a particular distribution and release of that distro. Add a check for _root_ as the running user in your simple program template.
|
||||
|
||||
Testing that the root user is running the program is easy because a program runs as the user that launches it.
|
||||
|
||||
The **id** command can be used to determine the numeric user ID (UID) the program is running under. It provides several bits of information when it is used without any options:
|
||||
|
||||
|
||||
```
|
||||
[student@testvm1 ~]$ id
|
||||
uid=1001(student) gid=1001(student) groups=1001(student),5000(dev)
|
||||
```
|
||||
|
||||
Using the **-u** option returns just the user's UID, which is easily usable in your Bash program:
|
||||
|
||||
|
||||
```
|
||||
[student@testvm1 ~]$ id -u
|
||||
1001
|
||||
[student@testvm1 ~]$
|
||||
```
|
||||
|
||||
Add the following function to the program. I added it after the Help procedure, but you can place it anywhere in the procedures section. The logic is that if the UID is not zero, which is always the root user's UID, the program exits:
|
||||
|
||||
|
||||
```
|
||||
################################################################################
|
||||
# Check for root. #
|
||||
################################################################################
|
||||
CheckRoot()
|
||||
{
|
||||
if [ `id -u` != 0 ]
|
||||
then
|
||||
echo "ERROR: You must be root user to run this program"
|
||||
exit
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
Now, add a call to the **CheckRoot** procedure just before the variable's initialization. Test this, first running the program as the student user:
|
||||
|
||||
|
||||
```
|
||||
[student@testvm1 ~]$ ./hello
|
||||
ERROR: You must be root user to run this program
|
||||
[student@testvm1 ~]$
|
||||
```
|
||||
|
||||
then as the root user:
|
||||
|
||||
|
||||
```
|
||||
[root@testvm1 student]# ./hello
|
||||
Hello world!
|
||||
[root@testvm1 student]#
|
||||
```
|
||||
|
||||
You may not always need this particular sanity test, so comment out the call to **CheckRoot** but leave all the code in place in the template. This way, all you need to do to use that code in a future program is to uncomment the call.
|
||||
|
||||
### The code
|
||||
|
||||
After making the changes outlined above, your code should look like this:
|
||||
|
||||
|
||||
```
|
||||
#!/usr/bin/bash
|
||||
################################################################################
|
||||
# scriptTemplate #
|
||||
# #
|
||||
# Use this template as the beginning of a new program. Place a short #
|
||||
# description of the script here. #
|
||||
# #
|
||||
# Change History #
|
||||
# 11/11/2019 David Both Original code. This is a template for creating #
|
||||
# new Bash shell scripts. #
|
||||
# Add new history entries as needed. #
|
||||
# #
|
||||
# #
|
||||
################################################################################
|
||||
################################################################################
|
||||
################################################################################
|
||||
# #
|
||||
# Copyright (C) 2007, 2019 David Both #
|
||||
# [LinuxGeek46@both.org][6] #
|
||||
# #
|
||||
# This program is free software; you can redistribute it and/or modify #
|
||||
# it under the terms of the GNU General Public License as published by #
|
||||
# the Free Software Foundation; either version 2 of the License, or #
|
||||
# (at your option) any later version. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, #
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
|
||||
# GNU General Public License for more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License #
|
||||
# along with this program; if not, write to the Free Software #
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
# #
|
||||
################################################################################
|
||||
################################################################################
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# Help #
|
||||
################################################################################
|
||||
Help()
|
||||
{
|
||||
# Display Help
|
||||
echo "Add description of the script functions here."
|
||||
echo
|
||||
echo "Syntax: scriptTemplate [-g|h|v|V]"
|
||||
echo "options:"
|
||||
echo "g Print the GPL license notification."
|
||||
echo "h Print this Help."
|
||||
echo "v Verbose mode."
|
||||
echo "V Print software version and exit."
|
||||
echo
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# Check for root. #
|
||||
################################################################################
|
||||
CheckRoot()
|
||||
{
|
||||
# If we are not running as root we exit the program
|
||||
if [ `id -u` != 0 ]
|
||||
then
|
||||
echo "ERROR: You must be root user to run this program"
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
################################################################################
|
||||
# Main program #
|
||||
################################################################################
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# Sanity checks #
|
||||
################################################################################
|
||||
# Are we rnning as root?
|
||||
# CheckRoot
|
||||
|
||||
# Initialize variables
|
||||
option=""
|
||||
Msg="Hello world!"
|
||||
################################################################################
|
||||
# Process the input options. Add options as needed. #
|
||||
################################################################################
|
||||
# Get the options
|
||||
while getopts ":h" option; do
|
||||
case $option in
|
||||
h) # display Help
|
||||
Help
|
||||
exit;;
|
||||
\?) # incorrect option
|
||||
echo "Error: Invalid option"
|
||||
exit;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "$Msg"
|
||||
```
|
||||
|
||||
### A final exercise
|
||||
|
||||
You probably noticed that the Help function in your code refers to features that are not in the code. As a final exercise, figure out how to add those functions to the code template you created.
|
||||
|
||||
### Summary
|
||||
|
||||
In this article, you created a couple of functions to perform a sanity test for whether your program is running as root. Your program is getting a little more complex, so testing is becoming more important and requires more test paths to be complete.
|
||||
|
||||
This series looked at a very minimal Bash program and how to build a script up a bit at a time. The result is a simple template that can be the starting point for other, more useful Bash scripts and that contains useful elements that make it easy to start new scripts.
|
||||
|
||||
By now, you get the idea: Compiled programs are necessary and fill a very important need. But for sysadmins, there is always a better way. Always use shell scripts to meet your job's automation needs. Shell scripts are open; their content and purpose are knowable. They can be readily modified to meet different requirements. I have never found anything that I need to do in my sysadmin role that cannot be accomplished with a shell script.
|
||||
|
||||
What you have created so far in this series is just the beginning. As you write more Bash programs, you will find more bits of code that you use frequently and should be included in your program template.
|
||||
|
||||
### Resources
|
||||
|
||||
* [How to program with Bash: Syntax and tools][5]
|
||||
* [How to program with Bash: Logical operators and shell expansions][7]
|
||||
* [How to program with Bash: Loops][8]
|
||||
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
_This series of articles is partially based on Volume 2, Chapter 10 of David Both's three-part Linux self-study course, [Using and Administering Linux—Zero to SysAdmin][9]._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/12/testing-bash-script
|
||||
|
||||
作者:[David Both][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/dboth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos)
|
||||
[2]: https://opensource.com/article/19/12/introduction-automation-bash-scripts
|
||||
[3]: https://opensource.com/article/19/12/creating-bash-script-template
|
||||
[4]: https://opensource.com/article/19/12/give-your-bash-program-some-help
|
||||
[5]: https://opensource.com/article/19/10/programming-bash-syntax-tools
|
||||
[6]: mailto:LinuxGeek46@both.org
|
||||
[7]: https://opensource.com/article/19/10/programming-bash-logical-operators-shell-expansions
|
||||
[8]: https://opensource.com/article/19/10/programming-bash-loops
|
||||
[9]: http://www.both.org/?page_id=1183
|
@ -0,0 +1,127 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Update Grub on Ubuntu and Other Linux Distributions)
|
||||
[#]: via: (https://itsfoss.com/update-grub/)
|
||||
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
|
||||
|
||||
How to Update Grub on Ubuntu and Other Linux Distributions
|
||||
======
|
||||
|
||||
In this tutorial, you’ll learn to update grub on Ubuntu or any other Linux distribution. You’ll also learn a thing or two about how this grub update process works.
|
||||
|
||||
### How to update grub
|
||||
|
||||
Ubuntu and many other Linux distributions provide a handy command line utility called update-grub.
|
||||
|
||||
To update grub, all you have to do is to run this command in the terminal with sudo.
|
||||
|
||||
```
|
||||
sudo update-grub
|
||||
```
|
||||
|
||||
You should see an output like this:
|
||||
|
||||
```
|
||||
[email protected]:~$ sudo update-grub
|
||||
[sudo] password for abhishek:
|
||||
Sourcing file `/etc/default/grub'
|
||||
Generating grub configuration file ...
|
||||
Found linux image: /boot/vmlinuz-5.0.0-37-generic
|
||||
Found initrd image: /boot/initrd.img-5.0.0-37-generic
|
||||
Found linux image: /boot/vmlinuz-5.0.0-36-generic
|
||||
Found initrd image: /boot/initrd.img-5.0.0-36-generic
|
||||
Found linux image: /boot/vmlinuz-5.0.0-31-generic
|
||||
Found initrd image: /boot/initrd.img-5.0.0-31-generic
|
||||
Found Ubuntu 19.10 (19.10) on /dev/sda4
|
||||
Found MX 19 patito feo (19) on /dev/sdb1
|
||||
Adding boot menu entry for EFI firmware configuration
|
||||
done
|
||||
```
|
||||
|
||||
You may see a similar command called update-grub2. No need to be alarmed or confused between update-grub and update-grub2. Both of these commands do the same action.
|
||||
|
||||
Around ten years ago, when grub2 was just introduced, update-grub2 command was also introduced. Today, update-grub2 is just a symbolic link to update-grub and both update grub2 configuration (because grub2 is the default).
|
||||
|
||||
#### Can’t find update-grub command? Here’s what to do in that case
|
||||
|
||||
It’s possible that your Linux distribution might not have update-grub command available.
|
||||
|
||||
What do you do in that case? How do you update grub on such a Linux distribution?
|
||||
|
||||
There is no need to panic. The update-grub command is simply a stub for running ‘grub-mkconfig -o /boot/grub/grub.cfg’ to generate grub2 config file.
|
||||
|
||||
Which means that you can update grub with the following command on any Linux distribution:
|
||||
|
||||
```
|
||||
sudo grub-mkconfig -o /boot/grub/grub.cfg
|
||||
```
|
||||
|
||||
Of course, remembering update-grub command is a lot easier than the above command and this is the reason why it was created in the first place.
|
||||
|
||||
### How does update-grub work?
|
||||
|
||||
When you install a Linux distribution, it (usually) asks you to install the [grub boot loader][1].
|
||||
|
||||
Part of grub is installed on the MBR/ESP partition. Rest of the grub lies in /boo/grub directory of the Linux distributions.
|
||||
|
||||
As per its [man page][2], update-grub works by looking into the /boot directory. All the files starting with [vmlinuz-][3] will be treated as kernels and they will get a grub menu entry. It will also add initrd lines for [ramdisk][4] images found with the same version as kernels found.
|
||||
|
||||
It also looks into all disk partitions for other operating systems with [os-prober][5]. If it finds other operating systems, it adds them to the grub menu.
|
||||
|
||||
![Representational image of Grub Menu][6]
|
||||
|
||||
### Why would you need to update grub?
|
||||
|
||||
There could be a number of scenarios when you need to update grub.
|
||||
|
||||
Suppose you changed the grub config file (/etc/default/grub) to [change the default boot order][7] or reduce the default boot time. Your changes won’t take into effect unless you update the grub.
|
||||
|
||||
Another scenario is when you have multiple Linux distributions installed on the same system.
|
||||
|
||||
For example, on my Intel NUC, I have two disks. The first disk had Ubuntu 19.10 and then I installed Ubuntu 18.04 on it. The second OS (Ubuntu 18.04) also installed its own grub and now the grub screen is controlled by Ubuntu 18.04 grub.
|
||||
|
||||
On the second disk, I installed MX Linux but I didn’t install grub this time. I want the existing grub (controlled by Ubuntu 18.04) to handle all the OS entries.
|
||||
|
||||
Now, in this scenario, the grub on Ubuntu 18.04 needs to be updated so that it can see [MX Linux][8].
|
||||
|
||||
![][9]
|
||||
|
||||
As you can see in the image above, when I update the grub, it finds various Linux kernels installed on 18.04 along with Ubuntu 19.10 and MX Linux on different partition.
|
||||
|
||||
If I want MX Linux to control the grub, I can install grub on MX Linux with [grub-install][10] command and then the grub on MX Linux will start controlling the grub screen. You get the gist, right?
|
||||
|
||||
Using a GUI tool like [Grub Customizer][11] is a simpler way to make changes in grub.
|
||||
|
||||
**In the end…**
|
||||
|
||||
Initially, I had intended to keep it a short article as a quick tip. But then I thought of explaining a few things associated with it so that (relatively) new Linux users could learn more than just a simple command.
|
||||
|
||||
Did you like it? Do you have some questions or suggestions? Please feel free to leave a comment.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/update-grub/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://en.wikipedia.org/wiki/GNU_GRUB
|
||||
[2]: https://manpages.debian.org/testing/grub-legacy/update-grub.8.en.html
|
||||
[3]: https://www.ibm.com/developerworks/community/blogs/mhhaque/entry/anatomy_of_the_initrd_and_vmlinuz?lang=en
|
||||
[4]: https://en.wikipedia.org/wiki/Initial_ramdisk
|
||||
[5]: https://packages.debian.org/sid/utils/os-prober
|
||||
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/grub_screen.png?ssl=1
|
||||
[7]: https://itsfoss.com/grub-customizer-ubuntu/
|
||||
[8]: https://mxlinux.org/
|
||||
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/update_grub.png?ssl=1
|
||||
[10]: https://www.gnu.org/software/grub/manual/grub/html_node/Installing-GRUB-using-grub_002dinstall.html
|
||||
[11]: https://itsfoss.com/customize-grub-linux/
|
@ -7,144 +7,144 @@
|
||||
[#]: via: (https://fosspost.org/tutorials/install-android-8-1-oreo-on-linux)
|
||||
[#]: author: (Python Programmer;Open Source Software Enthusiast. Worked On Developing A Lot Of Free Software. The Founder Of Foss Post;Foss Project. Computer Science Major. )
|
||||
|
||||
Install Android 8.1 Oreo on Linux To Run Apps & Games
|
||||
在 Linux 上安装 Android 8.1 Oreo 来运行应用程序和游戏
|
||||
======
|
||||
|
||||
![](https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/android-8.1-oreo-x86-on-linux.png?resize=1237%2C527&ssl=1)
|
||||
|
||||
[android x86][1] is a free and an open source project to port the android system made by Google from the ARM architecture to the x86 architecture, which allow users to run the android system on their desktop machines to enjoy all android functionalities + Apps & games.
|
||||
[android x86][1] 是一个自由开放源码的项目,将谷歌制作的android系统从 ARM 架构移植到 x86 架构, 运行用户在他们的桌面机器上运行 android 系统来享受所有的 android 功能和应用程序及游戏。
|
||||
|
||||
The android x86 project finished porting the android 8.1 Oreo system to the x86 architecture few weeks ago. In this post, we’ll explain how to install it on your Linux system so that you can use your android apps and games any time you want.
|
||||
几周前,android x86 项目完成 android 8.1 Oreo 系统到 x86 架构的移植。在这篇文章中,我们将解释如何在你的 Linux 系统上安装它,以便你能够随时使用你的 android 应用程序和游戏。
|
||||
|
||||
### Installing Android x86 8.1 Oreo on Linux
|
||||
### 在 Linux 上安装 Android x86 8.1 Oreo
|
||||
|
||||
#### Preparing the Environment
|
||||
#### 准备环境
|
||||
|
||||
First, let’s download the android x86 8.1 Oreo system image. You can download it from [this page][2], just click on the “View” button under the android-x86_64-8.1-r1.iso file.
|
||||
首先,让我们下载 android x86 8.1 Oreo 系统镜像。你可以从[这个页面][2]下载它,只需单击 android-x86_64-8.1-r1.iso 文件下 “View” 按钮。
|
||||
|
||||
We are going to use QEMU to run android x86 on our Linux system. QEMU is a very good emulator software, which is also free and open source, and is available in all the major Linux distributions repositories.
|
||||
我们将在我们的 Linux 系统上使用 QEMU 来运行 android x86 。QEMU 是一个非常好的模拟器软件,它也是自由和开放源码的,并且在所有主要的 Linux 发行版存储库中都是可用的。
|
||||
|
||||
To install QEMU on Ubuntu/Linux Mint/Debian:
|
||||
在 Ubuntu/Linux Mint/Debian 上安装 QEMU:
|
||||
|
||||
```
|
||||
sudo apt-get install qemu qemu-kvm libvirt-bin
|
||||
```
|
||||
|
||||
To install QEMU on Fedora:
|
||||
在 Fedora 上安装 QEMU:
|
||||
|
||||
```
|
||||
sudo dnf install qemu qemu-kvm
|
||||
```
|
||||
|
||||
For other distributions, just search for the qemu and qemu-kvm packages and install them.
|
||||
对于其它发行版,只需要搜索 qemu 和 qemu-kvm 软件包,并安装它们。
|
||||
|
||||
After you have installed QEMU, we’ll need to run the following command to create the android.img file, which will be like some sort of an allocated disk space just for the android system. All android files and system will be inside that image file:
|
||||
在你安装 QEMU 后,我们将需要运行下面的命令来创建 android.img 文件,它就像某种分配给 android 系统的磁盘空间。所有 android 文件和系统都将位于该镜像文件中:
|
||||
|
||||
```
|
||||
qemu-img create -f qcow2 android.img 15G
|
||||
```
|
||||
|
||||
Here we are saying that we want to allocate a maximum of 15GB for android, but you can change it to any size you want (make sure it’s at least bigger than 5GB).
|
||||
我们在这里说,我们想为 android 分配一个最大 15GB 的磁盘空间,但是,你可以更改它到你想要的任意大小(确保它至少大于5GB)。
|
||||
|
||||
Now, to start running the android system for the first time, run:
|
||||
现在,首次启动运行 android 系统,运行:
|
||||
|
||||
```
|
||||
sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img -cdrom /home/mhsabbagh/android-x86_64-8.1-r1.iso
|
||||
```
|
||||
|
||||
Replace /home/mhsabbagh/android-x86_64-8.1-r1.iso with the path of the file that you downloaded from the android x86 website. For explaination of other options we are using here, you may refer to [this article][3].
|
||||
将 /home/mhsabbagh/android-x86_64-8.1-r1.iso 替换为你从 android x86 网站下载的文件的路径。我们在这里正在使用的其它选项的解释,你可以参考[这篇文章][3]。
|
||||
|
||||
After you run the above command, the android system will start:
|
||||
在你运行上面的命令后,android 系统将启动:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 39 android 8.1 oreo on linux][4]
|
||||
|
||||
#### Installing the System
|
||||
#### 安装系统
|
||||
|
||||
From this window, choose “Advanced options”, which should lead to the following menu, from which you should choose “Auto_installation” as follows:
|
||||
从这个窗口中,选择 “Advanced options”, 它将引导到下面的菜单,你应如下在其中选择 “Auto_installation” :
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 41 android 8.1 oreo on linux][5]
|
||||
|
||||
After that, the installer will just tell you about whether you want to continue or not, choose Yes:
|
||||
在这以后,安装器将告知你是否想要继续,选择 Yes :
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 43 android 8.1 oreo on linux][6]
|
||||
|
||||
And the installation will carry on without any further instructions from you:
|
||||
接下来,安装器将无需你的指示而继续进行:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 45 android 8.1 oreo on linux][7]
|
||||
|
||||
Finally you’ll receive this message, which indicates that you have successfully installed android 8.1:
|
||||
最后,你将收到这个信息,它表示你已经成功安装 android 8.1 :
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 47 android 8.1 oreo on linux][8]
|
||||
|
||||
For now, just close the QEMU window completely.
|
||||
现在,完全关闭 QEMU 窗口。
|
||||
|
||||
#### Booting and Using Android 8.1 Oreo
|
||||
#### 启动和使用 Android 8.1 Oreo
|
||||
|
||||
Now that the android system is fully installed in your android.img file, you should use the following QEMU command to start it instead of the previous one:
|
||||
现在,android 系统已经完全安装在你的 android.img 文件中,你应该使用下面的 QEMU 命令来启动它,而不是前面的命令:
|
||||
|
||||
```
|
||||
sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img
|
||||
```
|
||||
|
||||
Notice that all we did was that we just removed the -cdrom option and its argument. This is to tell QEMU that we no longer want to boot from the ISO file that we downloaded, but from the installed android system.
|
||||
注意,我们所做的只是移除 -cdrom 选项和它的参数。这是告诉 QEMU ,我们不再想从我们下载的 ISO 文件启动,相反,从安装的 android 系统启动。
|
||||
|
||||
You should see the android booting menu now:
|
||||
你现在能够看到 android 启动菜单:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 49 android 8.1 oreo on linux][9]
|
||||
|
||||
Then you’ll be taken to the first preparation wizard, choose your language and continue:
|
||||
然后,你将带去第一个准备向导,选择你的语言并继续:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 51 android 8.1 oreo on linux][10]
|
||||
|
||||
From here, choose the “Set up as new” option:
|
||||
从这里,选择 “Set up as new” 选项:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 53 android 8.1 oreo on linux][11]
|
||||
|
||||
Then android will ask you about if you want to login to your current Google account. This step is optional, but important so that you can use the Play Store later:
|
||||
然后,android 将询问你是否想登陆到你当前的谷歌账号。这步骤是可选的,但是这很重要,以便你随后可以使用 Play Store :
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 55 android 8.1 oreo on linux][12]
|
||||
|
||||
Then you’ll need to accept the terms and conditions:
|
||||
然后,你将需要接受条款:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 57 android 8.1 oreo on linux][13]
|
||||
|
||||
Now you can choose your current timezone:
|
||||
现在,你可以选择你当前的时区:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 59 android 8.1 oreo on linux][14]
|
||||
|
||||
The system will ask you now if you want to enable any data collection features. If I were you, I’d simply turn them all off like that:
|
||||
系统将询问你是否想启动一些数据收集功能。如果我是你的话,我将简单地关闭它们,像这样:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 61 android 8.1 oreo on linux][15]
|
||||
|
||||
Finally, you’ll have 2 launcher types to choose from, I recommend that you choose the Launcher3 option and make it the default:
|
||||
最后,你将有两种启动类型可供选择,我建议你选择 Launcher3 选项,并使其成为默认项:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 63 android 8.1 oreo on linux][16]
|
||||
|
||||
Then you’ll see your fully-working android system home screen:
|
||||
然后,你将看到完整工作的 android 系统主屏幕:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 65 android 8.1 oreo on linux][17]
|
||||
|
||||
From here now, you can do all the tasks you want; You can use the built-in android apps, or you may browse the settings of your system to adjust it however you like. You may change look and feeling of your system, or you can run Chrome for example:
|
||||
从现在起,你可以做你想做的任何事情;你可以使用内置的 android 应用程序,或者你可以浏览你是系统设置来根据你的喜好进行调整。你可以更改你的系统的外观和体验,或者你可以像示例一样运行 Chrome :
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 67 android 8.1 oreo on linux][18]
|
||||
|
||||
You may start installing some apps like WhatsApp and others from the Google Play store for your own use:
|
||||
你可以从 Google Play store 开始安装一些应用程序程序,像 WhatsApp 和其它的应用程序,以供你自己使用:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 69 android 8.1 oreo on linux][19]
|
||||
|
||||
You can now do whatever you want with your system. Congratulations!
|
||||
你现在可以用你的系统做任何你想做的事。恭喜!
|
||||
|
||||
### How to Easily Run Android 8.1 Oreo Later
|
||||
### 以后如何轻松地运行 Android 8.1 Oreo
|
||||
|
||||
We don’t want to always have to open the terminal window and write that long QEMU command to run the android system, but we want to run it in just 1 click whenever we need that.
|
||||
我们不想总是不得不打开终端窗口,并写那些长长的 QEMU 命令来运行 android 系统,相反,我们想在我们需要时一次单击就运行它。
|
||||
|
||||
To do this, we’ll create a new file under /usr/share/applications called android.desktop with the following command:
|
||||
为此,我们将使用下面的命令在 /usr/share/applications 下创建一个名为 android.desktop 的新文件:
|
||||
|
||||
```
|
||||
sudo nano /usr/share/applications/android.desktop
|
||||
```
|
||||
|
||||
And paste the following contents inside it (Right click and then paste):
|
||||
并在其中粘贴下面的内容(右键单击然后粘贴):
|
||||
|
||||
```
|
||||
[Desktop Entry]
|
||||
@ -158,19 +158,19 @@ StartupNotify=true
|
||||
Categories=GTK;
|
||||
```
|
||||
|
||||
Again, you have to replace /home/mhsabbagh/android.img with the path to the local image on your system. Then save the file (Ctrl + X, then press Y, then Enter).
|
||||
再强调一次,你必需使用你系统上的本地镜像路径来替换 /home/mhsabbagh/android.img 。然后保存文件 (Ctrl + X ,然后按 Y ,然后按 Enter)。
|
||||
|
||||
Notice that we needed to use “pkexec” to run QEMU with root privileges because starting from newer versions, accessing to the KVM technology via libvirt is not allowed for normal users; That’s why it will ask you for the root password each time.
|
||||
注意,我们需要使用 “pkexec” 来使用 root 权限运行 QEMU ,因为从较新的版本开始,普通用户不允许通过 libvirt 访问 KVM 技术;这就是为什么它将每次要求你输入 root 密码的原因。
|
||||
|
||||
Now, you’ll see the android icon in the applications menu all the time, you can simply click it any time you want to use android and the QEMU program will start:
|
||||
现在,你将在应用程序菜单中看到 android 图标,你可以在你想使用 android 的任何时间来简单地单击图标,QEMU 程序将启动:
|
||||
|
||||
![Install Android 8.1 Oreo on Linux To Run Apps & Games 71 android 8.1 oreo on linux][20]
|
||||
|
||||
### Conclusion
|
||||
### 总结
|
||||
|
||||
We showed you how install and run android 8.1 Oreo on your Linux system. From now on, it should be much easier on you to do your android-based tasks without some other software like Blutsticks and similar methods. Here, you have a fully-working and functional android system that you can manipulate however you like, and if anything goes wrong, you can simply nuke the image file and run the installation all over again any time you want.
|
||||
我们向你展示如何你的 Linux 系统上安装和运行 android 8.1 Oreo 。从现在起,在没有其它一些软件的(像 Blutsticks 和类似的方法)的情况下,你应该更容易地完成基于 android 的任务。在这里,你有一个完整工作和功能的 android 系统,你可以随心所欲地操作它,如果一些东西出差,你可以简单地核弹攻击镜像文件,然后随时再一次重新运行安装程序。
|
||||
|
||||
Have you tried android x86 before? How was your experience with it?
|
||||
你之前尝试过 android x86 吗?你的经验如何?
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
@ -179,7 +179,7 @@ via: https://fosspost.org/tutorials/install-android-8-1-oreo-on-linux
|
||||
|
||||
作者:[Python Programmer;Open Source Software Enthusiast. Worked On Developing A Lot Of Free Software. The Founder Of Foss Post;Foss Project. Computer Science Major.][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
@ -1,56 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (mayunmeiyouming)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (What GNOME 2 fans love about the Mate Linux desktop)
|
||||
[#]: via: (https://opensource.com/article/19/12/mate-linux-desktop)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
GNOME 2粉丝喜欢Mate Linux桌面的什么
|
||||
======
|
||||
本文是24天Linux桌面特别系列的一部分。如果您还记得GNOME 2,那么Mate Linux桌面将满足您的怀旧的情怀。
|
||||
![Linux keys on the keyboard for a desktop computer][1]
|
||||
|
||||
如果你以前听过这个:当GNOME3第一次发布时,很多GNOME用户还没有准备好放弃GNOME2。[Mate] [2](以yerba mate_ plant命名)项目的开始是为了延续GNOME 2桌面,刚开始时使用GTK 2(GNOME 2所基于的工具包),然后又合并了GTK 3。由于Linux Mint的简单易用,使得桌面变得非常流行,并且从那时起,它已经普遍用于Fedora、Ubuntu、Slackware、Arch和许多其他Linux发行版上。今天,Mate继续提供一个传统的桌面环境,它的外观和感觉与GNOME 2完全一样,使用GTK 3工具包。
|
||||
|
||||
您可以在Linux发行版的软件仓库中找到Mate,也可以下载并[安装][3]把Mate作为默认桌面的发行版。不过,在你这样做之前,请注意它是为了提供完整的桌面体验,所以许多Mate应用程序都是随桌面一起安装的。如果您运行的是不同的桌面,您可能会发现自己有多余的应用程序(两个PDF阅读器、两个媒体播放器、两个文件管理器,等等)。如果您只想尝试Mate桌面,可以在虚拟机中安装基于Mate的发行版,例如[GNOME box][4]。
|
||||
|
||||
### Mate桌面之旅
|
||||
|
||||
Mate项目不仅仅唤起了GNOME 2;它是gnome2。如果你是00年代中期Linux桌面的粉丝,至少,你会发现Mate的怀旧情怀。我不是GNOME2的粉丝,我倾向于使用KDE,但是有一个地方我无法想象没有GNOME2:[OpenSolaris][5]。OpenSolaris项目并没有持续太久,当Ian Murdock在被Oracle并入Sun Microsystems之前加入Sun Microsystems时,它变得非常突出,但我当时是一个低级的Solaris管理员,并使用OpenSolaris来教自己更多关于Unix的那种风格。这是我使用GNOME2的唯一平台(因为我一开始不知道如何更改桌面,后来才习惯),而今天的[OpenIndiana project][6]是OpenSolaris的社区延续,它通过Mate桌面使用GNOME2。
|
||||
|
||||
![Mate on OpenIndiana][7]
|
||||
|
||||
Mate的布局由左上角的三个菜单组成:应用程序、位置和系统。应用程序菜单提供对系统上安装的所有的应用程序的启动程序的快速访问。Places菜单提供对常用位置(如主目录、网络文件夹等)的快速访问。系统菜单包含全局选项,如关级和睡眠。右上角是一个系统托盘,屏幕底部有一个任务栏和一个虚拟桌面切换栏。
|
||||
|
||||
就桌面设计而言,它是一种稍微有点奇怪的配置。它从早期的Linux桌面、MacFinder和Windows中借用了相同的部分,但是又创建了一个独特的配置,这种配置很直观,而且很熟悉。Mate故意抵制与这个模型的偏差,这正是它的用户喜欢的地方。
|
||||
|
||||
### Mate和开源
|
||||
|
||||
Mate是一个最直接的例子,展示了开源如何使开发人员能够对抗项目生命的终结。从理论上讲,GNOME2会被GNOME3所取代,但它依然存在,因为一个开发人员建立代码的一个分支并继续进行下去。势头越来越大,更多的开发人员加入进来,并且用户喜爱的桌面比以往任何时候都更好。并不是所有的软件都有第二次机会,但是开源永远是一个机会,否则就永远没有机会。
|
||||
|
||||
使用和支持开源意味着支持用户和开发人员的自由。而且Mate桌面是它们的努力的有力证明。
|
||||
|
||||
探索不同的桌面是一件好事。我最近将开始使用为GNOME 3
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/12/mate-linux-desktop
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[mayunmeiyouming](https://github.com/mayunmeiyouming)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer)
|
||||
[2]: https://mate-desktop.org/
|
||||
[3]: https://mate-desktop.org/install/
|
||||
[4]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization
|
||||
[5]: https://en.wikipedia.org/wiki/OpenSolaris
|
||||
[6]: https://www.openindiana.org/documentation/faq/#what-is-openindiana
|
||||
[7]: https://opensource.com/sites/default/files/uploads/advent-mate-openindiana_675px.jpg (Mate on OpenIndiana)
|
Loading…
Reference in New Issue
Block a user