Fedora软件安装

Fedora安装软件

一、搭建编程环境

以下,仅为个人习惯:

(一)Vim (终端快速编辑文件)

sudo dnf install vim
cat >~.vimrc<<EOF
filetype on
set ts=4
set number
set autoindent
map <F5> :w<cr>:r!python3 %<cr>
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
EOF

说明一下:

:vs  竖向分屏
:sp  横向分屏
Ctrl+j,k,h,l  跟vim使用习惯一样,切换屏幕

(二)Qt (C++界面开发)

  1. 科学前往https://download.qt.io/official_releases/online_installers/,下载.run文件。
  2. 安装时,选择5.15版本就好了。
  3. 生成图标。
if [ ! -f ~/.local/share/applications/QtCreator.desktop ] ; then
cat >~/.local/share/applications/QtCreator.desktop<<EOF
[Desktop Entry]
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

(三) Vscode(C、md)

始终用得不惯

if [ ! -f "/etc/yum.repos.d/vscode.repo" ]; then
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
fi
sudo dnf install code

设置为不更新了,如果太慢:sudo sed -i "4c enabled=0" /etc/yum.repos.d/vscode.repo

(四) LiteIDE (Golang)

官网下载

我之前下的版本是:liteidex37.4.linux64-qt5.5.1-system.tar.gz 。下载后,放在合适的位置。然后添加图标:

if [ ! -f ~/.local/share/applications/liteide.desktop ] ; then
cat >~/.local/share/applications/liteide.desktop<<EOF
[Desktop Entry]
Name=LiteIDE
Exec=[Path to liteide (此行需要替换)]
Icon=[Path to liteide png (此行需要替换)]
Terminal=false
Type=Application
X-Desktop-File-Install-Version=0.24
EOF
fi

(五) PyCharm (Python)

  1. 方法一:官网下载
# 创建图标:
if [ ! -f ~/.local/share/applications/Pycharm.desktop ] ; then
cat >~/.local/share/applications/Pycharm.desktop<<EOF
[Desktop Entry]
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
  1. 方法二:可能需要科学
sudo bash -c 'cat << EOF > /etc/yum.repos.d/_copr_phracek-PyCharm.repo:
[phrase-PyCharm]
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'
sudo dnf install pycharm-community
  • 安装 Jupyter notebook 和 Ipython:
sudo dnf install jupyter-notebook
sudo dnf install ipython

(六) 搭建python爬虫环境 (下次)

主要参考Python3网络爬虫开发实践一书

mark it.

二、安装其他软件

(一) 先添加第三方源 RPM Fusion,如下:

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等软件了。

(二) Chrome

if [ ! -f "/etc/yum.repos.d/google-chrome.repo" ]; then
cat >./google-chrome.repo<<EOF
[google-chrome]
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
sudo dnf -y install google-chrome-stable #--nogpg

(三) 音视频软件

sudo dnf install smplayer byzanz-record flowblade rhythmbox easytag mencoder
  • smplayer: 视频播放
  • byzanz-record: 录制屏幕
  • flowblade: 视频剪辑(b站上有 教程[转],难得!还没学)
  • rhythmbox: 自带听歌软件
  • easytag: 修改歌曲标签
  • mencoder 很好地完成了我的简单任务。所以有了这个脚本 cut-video.sh 来剪视频(它只接受正确的输入):
#!/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 

将倒数第二行,改为:-ovc frameno -oac mp3lame -lameopts cbr:br=320 -of rawaudio \ 另存为cut-audio.sh, 就可以只提取音频。

(四) 虚拟机 VirtualBox (跑win7)

sudo dnf install VirtualBox

三、游戏

  • Battle for Wesnoth(韦诺之战):这个玩得多点,棋盘类的战斗游戏。 sudo dnf install wesnoth
  • 力: 第一人称射击死亡竞技类 3D 电子游戏。 sudo dnf install xonotic
  • Steam: 这个不是游戏,是游戏平台,CS、文明、Dota等许多好游戏都有的玩。 sudo dnf install steam
    文明最低要求配置:(Linux下:N卡ok,A卡貌似新一点的可以。)
    需要 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. 

文明花了我59块,居然玩不了,现已解决,如下:

>LD_PRELOAD=/usr/lib64/libfreetype.so.6 QT_AUTO_SCREEN_SCALE_FACTOR=0 %command%
>Right click the game in your library, go to properties, click "Set Launch Options...", and enter the above line.

直播:
讲到游戏,怎能少了直播。

posted @ 2020-04-16 23:44  qydw007  阅读(987)  评论(0编辑  收藏  举报