小梵蒂 發表於 2020-4-16 23:44:00

Fedora软件安装

<h1 id="fedora安装软件">Fedora安装软件</h1>
<h2 id="一搭建编程环境">一、搭建编程环境</h2>
<p><em>以下,仅为个人习惯:</em></p>
<h3 id="一vim-终端快速编辑文件">(一)Vim (终端快速编辑文件)</h3>
<pre><code>sudo dnf install vim
</code></pre>
<pre><code>cat &gt;~.vimrc&lt;&lt;EOF
filetype on
set ts=4
set number
set autoindent
map &lt;F5&gt; :w&lt;cr&gt;:r!python3 %&lt;cr&gt;
map &lt;C-j&gt; &lt;C-W&gt;j
map &lt;C-k&gt; &lt;C-W&gt;k
map &lt;C-h&gt; &lt;C-W&gt;h
map &lt;C-l&gt; &lt;C-W&gt;l
EOF
</code></pre>
<p><em>说明一下:</em></p>
<pre><code>:vs竖向分屏
:sp横向分屏
Ctrl+j,k,h,l跟vim使用习惯一样,切换屏幕
</code></pre>
<h3 id="二qt-c界面开发">(二)Qt (C++界面开发)</h3>
<ol>
<li>科学前往https://download.qt.io/official_releases/online_installers/,下载.run文件。</li>
<li>安装时,选择5.15版本就好了。</li>
<li>生成图标。</li>
</ol>
<pre><code>if [ ! -f ~/.local/share/applications/QtCreator.desktop ] ; then
cat &gt;~/.local/share/applications/QtCreator.desktop&lt;&lt;EOF

Type=Application
Exec=/home/xxxx/Qt/Tools/QtCreator/bin/qtcreator(此行需要修改)
Icon=/home/xxxx/Qt/Tools/QtCreator/logo.png(此行需要修改)
Name=Qt Creator
GenericName=C++ IDE for developing Qt applications
X-KDE-StartupNotify=true
StartupWMClass=qtcreator
Terminal=false
Categories=Development;IDE;Qt;
MimeType= text/x-c++src;text/x-c++hdr;text/x-xsrc;application/x-designer;application/vnd.qt.qmakeprofile;application/vnd.qt.xml.resource;
EOF
fi
</code></pre>
<h3 id="三-vscodecmd">(三) Vscode(C、md)</h3>
<p><em>始终用得不惯</em></p>
<pre><code>if [ ! -f "/etc/yum.repos.d/vscode.repo" ]; then
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" &gt; /etc/yum.repos.d/vscode.repo'
fi
</code></pre>
<pre><code>sudo dnf install code
</code></pre>
<p><strong>设置为不更新了,如果太慢:</strong><code>sudo sed -i "4c enabled=0" /etc/yum.repos.d/vscode.repo</code></p>
<h3 id="四-liteide-golang">(四) LiteIDE (Golang)</h3>
<p>官网下载</p>
<p><em>我之前下的版本是:<code>liteidex37.4.linux64-qt5.5.1-system.tar.gz</code> 。下载后,放在合适的位置。然后添加图标:</em></p>
<pre><code>if [ ! -f ~/.local/share/applications/liteide.desktop ] ; then
cat &gt;~/.local/share/applications/liteide.desktop&lt;&lt;EOF

Name=LiteIDE
Exec=
Icon=
Terminal=false
Type=Application
X-Desktop-File-Install-Version=0.24
EOF
fi
</code></pre>
<h3 id="五-pycharm-python">(五) PyCharm (Python)</h3>
<ol>
<li>方法一:官网下载</li>
</ol>
<pre><code># 创建图标:
if [ ! -f ~/.local/share/applications/Pycharm.desktop ] ; then
cat &gt;~/.local/share/applications/Pycharm.desktop&lt;&lt;EOF

Name=PyCharm
GenericName=PyCharm
X-GNOME-FullName=PyCharm
Comment=PyCharm
Exec=/home/xxxx/app/pycharm2022.2/bin/pycharm.sh (此行需要修改)
Icon=/home/xxxx/app/pycharm2022.2/bin/pycharm.png (此行需要修改)
Terminal=false
Type=Application
Categories=Development;
StartupNotify=true
EOF
fi
</code></pre>
<ol start="2">
<li>方法二:可能需要科学</li>
</ol>
<pre><code>sudo bash -c 'cat &lt;&lt; EOF &gt; /etc/yum.repos.d/_copr_phracek-PyCharm.repo:

name=Copr repo for PyCharm owned by phracek
baseurl=https://copr-be.cloud.fedoraproject.org/results/phracek/PyCharm/fedora-$releasever-$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/phracek/PyCharm/pubkey.gpg
enabled=1
enabled_metadata=1
EOF'
</code></pre>
<pre><code>sudo dnf install pycharm-community
</code></pre>
<ul>
<li><strong>安装 Jupyter notebook 和 Ipython:</strong></li>
</ul>
<pre><code>sudo dnf install jupyter-notebook
sudo dnf install ipython
</code></pre>
<h3 id="六-搭建python爬虫环境-下次">(六) 搭建python爬虫环境 (下次)</h3>
<p>主要参考<strong>Python3网络爬虫开发实践</strong>一书</p>
<pre><code>mark it.
</code></pre>
<h2 id="二安装其他软件">二、安装其他软件</h2>
<h3 id="一-先添加第三方源-rpm-fusion如下">(一) 先添加第三方源 RPM Fusion,如下:</h3>
<pre><code>sudo dnf install \
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# 这样就可以安装smplayer等软件了。
</code></pre>
<h3 id="二-chrome">(二) Chrome</h3>
<pre><code>if [ ! -f "/etc/yum.repos.d/google-chrome.repo" ]; then
cat &gt;./google-chrome.repo&lt;&lt;EOF

name=google-chrome
baseurl=http://dl.google.com/linux/rpm/stable/x86_64
enable=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub
EOF
sudo mv -v ./google-chrome.repo /etc/yum.repos.d/
fi
</code></pre>
<pre><code>sudo dnf -y install google-chrome-stable #--nogpg
</code></pre>
<h3 id="三-音视频软件">(三) 音视频软件</h3>
<pre><code>sudo dnf install smplayer byzanz-record flowblade rhythmbox easytag mencoder
</code></pre>
<ul>
<li><strong>smplayer:</strong> 视频播放</li>
<li><strong>byzanz-record:</strong> 录制屏幕</li>
<li><strong>flowblade:</strong> 视频剪辑(b站上有 教程[转],难得!还没学)</li>
<li><strong>rhythmbox:</strong> 自带听歌软件</li>
<li><strong>easytag:</strong> 修改歌曲标签</li>
<li><strong>mencoder</strong> 很好地完成了我的简单任务。所以有了这个脚本 <strong>cut-video.sh</strong> 来剪视频(它只接受正确的输入):</li>
</ul>
<pre><code>#!/bin/bash
# 提取视频
if [ $# -ne 4 ]
        then echo "USage: `basename $0`   start_time(hh:mm:ss) end_time(hh:mm:ss) input_file output_file" ; exit 1
fi

start_time=$1
hour_s=`echo $start_time | cut -f 1 -d :`
min_s=`echo $start_time | cut -f 2 -d :`
sec_s=`echo $start_time | cut -f 3 -d :`
let start_sec="$((10#$hour_s*60*60)) + $((10#$min_s*60)) + $((10#$sec_s))"

end_time=$2
hour_e=`echo $end_time | cut -f 1 -d :`
min_e=`echo $end_time | cut -f 2 -d :`
sec_e=`echo $end_time | cut -f 3 -d :`
let end_sec="$((10#$hour_e*60*60)) + $((10#$min_e*60)) + $((10#$sec_e))"

let duration_time=$end_sec-$start_sec
let duration_h=$duration_time/3600
let duration_m=($duration_time-3600*$duration_h)/60
let duration_s=$duration_time-3600*$duration_h-60*$duration_m
duration=`echo $duration_h:$duration_m:$duration_s`

input_file=$3
output_file=$4

mencoder -ss $start_time -endpos $duration \
-oac pcm -ovc copy \
$input_file -o $output_file
</code></pre>
<p>将倒数第二行,改为:<code>-ovc frameno -oac mp3lame -lameopts cbr:br=320 -of rawaudio \</code> 另存为<strong>cut-audio.sh</strong>, 就可以只提取音频。</p>
<h3 id="四-虚拟机-virtualbox-跑win7">(四) 虚拟机 VirtualBox (跑win7)</h3>
<pre><code>sudo dnf install VirtualBox
</code></pre>
<h2 id="三游戏">三、游戏</h2>
<ul>
<li>Battle for Wesnoth(韦诺之战):这个玩得多点,棋盘类的战斗游戏。 <code>sudo dnf install wesnoth</code></li>
<li>力: 第一人称射击死亡竞技类 3D 电子游戏。 <code>sudo dnf install xonotic</code></li>
<li>Steam:这个不是游戏,是<strong>游戏平台</strong>,CS、文明、Dota等许多好游戏都有的玩。 <code>sudo dnf install steam</code><br>
文明最低要求配置:(Linux下:N卡ok,A卡<strong>貌似</strong>新一点的可以。)</li>
</ul>
<pre><code>    需要 64 位处理器和操作系统
    操作系统: Ubuntu 16.04 (64bit)
    处理器: Intel Core i3 530 or AMD A8-3870
    内存: 6 GB RAM
    显卡: 1 GB VRAM Minimum - NVIDIA GeForce 650
    存储空间: 需要 15 GB 可用空间
    附注事项: IMPORTANT NOTICE: Some Intel i3 Processors may require an additional 2 GB Swap Partition.
    IMPORTANT NOTICE: ATI and INTEL chipsets are NOT supported to run Civilization VI LINUX.
</code></pre>
<p>文明花了我59块,居然玩不了,现已解决,如下:</p>
<pre><code>&gt;LD_PRELOAD=/usr/lib64/libfreetype.so.6 QT_AUTO_SCREEN_SCALE_FACTOR=0 %command%
&gt;Right click the game in your library, go to properties, click "Set Launch Options...", and enter the above line.
</code></pre>
<p><strong>直播:</strong><br>
讲到游戏,怎能少了直播。</p>
<ul>
<li><strong>OBS:</strong> 直播软件,可以在b站直播,我试过了。[转]Linux下直播环境搭建OBS+bilibili-live-helper</li>
</ul><br><br>
来源:https://www.cnblogs.com/qydw000/p/12707467.html
頁: [1]
查看完整版本: Fedora软件安装