Jack's Blog

流淌的心,怎能阻拦,吹来的风,又怎能阻挡。
cd /usr/share/applications/
vim Pycharm.desktop //如果没有此文件,可以新建一个.
	
[Desktop Entry]
Type=Application
Name=Pycharm
GenericName=Pycharm3
Comment=Pycharm3:The Python IDE
Exec=sh /sdb/python/pycharm-2016.2.3/bin/pycharm.sh  //修改为你的地址
Icon=/sdb/python/pycharm-2016.2.3/bin/pycharm.png    //修改为你的地址
Terminal=pycharm
Categories=Pycharm;

我这个例子是给pycharm创建一个快捷方式。

给其他应用程序创建快捷方式,只需照猫画虎即可。

#!/usr/bin/env xdg-open

[Desktop Entry]
Categories=Development;
Comment[zh_CN]=
Comment=
Exec=/home/obaby/soft/pycharm-2016.1/bin/pycharm.sh %f
GenericName[zh_CN]=IDE
GenericName=IDE
Icon=/home/obaby/soft/pycharm-2016.1/bin/pycharm.png
MimeType=
Name[zh_CN]=PyCharm
Name=PyCharm
Path=
StartupNotify=true
Terminal=false
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=obaby

上面是另一个人给的kde桌面的代码。

其实都是一个道理

如何在Fedora 25上安装pip 3

wget https://bootstrap.pypa.io/ez_setup.py

#安装easy_install-3.5
python3.5 ez_setup.py

#安装完成后/usr/local/bin/目录下出现easy_install-3.5

#安装pip3.5
easy_install-3.5 pip

#安装完成后/usr/local/bin/目录下出现pip3.5

#升级pip3.5版本
pip3.5 install --upgrade pip

一般程序的手动编译安装

阅读全文

由于某些安全性的原因fedora 取消了图形化界面添加su

因而只能采取后台操作添加将自己添加为su

不少freshman(包括我)都是摸索了好长时间才学会的

下面分享方法

su #输入密码后得到root权限
visudo
a #进入append模式(系统会显示INSERT)

在文件中找到这样的代码

## Allow root to run any commands anywhere
root ALL=(ALL) ALL

然后在其下面添加一行

your_name ALL=(ALL) ALLyour_name ALL=(ALL) ALL #your_name 为你的用户名

然后

按Esc 
输入“:w”(保存文件) 
输入“:q”(退出) 

FAQ

1.我的用户名在哪里可以看到?

在终端的开头[your_user_name@...]

2.在编辑文件的时候系统提示我语法错误

只要按照本操作,输入Q后便可保存并退出了

最后便可以愉快的使用sudo了

Before we go

16年安装了fedora 25,然而由于学校的各种事情,用windows还是比较方便。感到遗憾的是一直没有很好的利用这么好的资源,包括各种开源的软件和强大的环境友好性。

现在我想将自己的工作平台全部转移到Fedora 25上,有几大配置非常有用,我将把他们分享给大家


1.Pycharm edu

自行搜索其官网下载最新版的 pycharm edu 最新版

  1. Unpack the PyCharm Edu distribution archive that you downloaded to
     where you wish to install the program. We will refer to this destination
     location as your {installation home} below.

  2. Open a console and cd into "{installation home}/bin" and type:

       ./pycharm.sh

     to start the application. As a side effect, this will initialize various
     configuration files in the ~/.PyCharmEdu3.5 directory.

  3. [OPTIONAL] Add "{installation home}/bin" to your PATH environment
     variable so that you may start PyCharm Edu from any directory.

  4. [OPTIONAL] To adjust the value of the JVM heap size, create
      ~/.PyCharmEdu3.5/pycharm.vmoptions (or pycharm64.vmoptions
      if using a 64-bit JDK), and set the -Xms and -Xmx parameters. To see how
      to do this, you can reference the vmoptions file under
      "{installation home}/bin" as a model.

  [OPTIONAL] Changing the location of "config" and "system" directories

2.python 3

下载地址:https://www.python.org/downloads/release/python-361/

安装代码:

On Unix, Linux, BSD, macOS, and Cygwin::

    ./configure
    make
    make test
    sudo make install

3.搜狗输入法

安装fedora 中文软件源

$ sudo dnf config-manager --add-repo=http://repo.fdzh.org/FZUG/FZUG.repo 
$ sudo dnf install fzug-release -y
$ sudo dnf install sogoupinyin sogoupinyin-selinux -ysudo dnf install sogoupinyin sogoupinyin-selinux -y
$ reboot

该包已添加 fcitx-gtk2, fcitx-gtk3, fcitx-qt4 和 fcitx-qt5 模块依赖。
注意:由 iBus 切换至 Fcitx 需要 重启/注销 系统,以便 imsettings 启动相应输入法。

FAQ

使用 Sogou Pinyin

如果您使用 XDG 兼容的桌面环境,比如 KDE, GNOME, XFCE, LXDE, Cinnamon。那么当您安装好 Sogou 并重新登录后,Fcitx 和 Sogou 应该会自动启动。使用 Ctrl+Space 激活 Fcitx 便可以输入了,Shift 临时切换中英文。

1). sogou-qimpanel 未自动启动

如果 Fcitx 没有随桌面环境自动启动,请检查 imsettings 设置,正常的配置如下所示:

$ imsettings-info 
Xinput file: /etc/X11/xinit/xinput.d/fcitx.conf
GTK+ immodule: fcitx
Qt immodule: fcitx
XMODIFIERS: @im=fcitx
XIM server: /usr/bin/fcitx -D
Preferences: /usr/bin/fcitx-configtool
Auxiliary:
Short Description: FCITX
Long Description:
Icon file: /usr/share/pixmaps/fcitx.png
Is system default: TRUE
Is user default: TRUE
Is XIM server: FALSE
$ imsettings-switch fcitx  # 切换至 fcitx

如果您的桌面环境不兼容 XDG,则 sogou-qimpanel 不会自动启动。请使用桌面环境自带的自动启动工具,添加 sogou-qimpanel 启动项。

如果您的桌面环境不包含自启动工具,或您使用 startx 脚本启动图形界面,则在 ~/.profile 中添加以下命令。

$ vim ~/.profile
source /etc/sysconfig/sogoupinyin

该脚本在启动 X 时被 /etc/X11/xinit/xinitrc-common 调用,用于设置 Fcitx 环境变量,并启动 sogou-qimpanel

2). 如何安装皮肤

查看帮助信息:

$ rpm -qi sogoupinyin
皮肤保存在~/.config/sogou-qimpanel/skin/, 按以下方式安装:
  $ sudo setsebool sogou_enable_homedirs=1
  $ sogou-qimpanel Skin.ssf

3). 如何安装词库

查看帮助信息:

$ rpm -qi sogoupinyin
词库保存在~/.config/SogouPY/scd/, 按以下方式安装:
  $ sudo setsebool sogou_enable_homedirs=1
  $ sogou-qimpanel Cell.scel

4). 禁止 Sogou 访问网络

查看帮助信息:

$ rpm -qi sogoupinyin
禁止 sogou 访问网络:
  $ sudo setsebool -P sogou_access_network=0 # 默认: true

5). 小黑框问题

Xfce 桌面环境,如遇到小黑框,需开启 Compositor 功能:

Settings -> Windows Manger Tweaks -> Compositor
设置 -> 窗口管理器微调 -> 合成器

Mate 桌面环境,如遇到小黑框,需开启 Compositor 功能:

System -> Control Center -> Windows -> Enable software composit..

LXDE 桌面环境,如遇到小黑框,需要修改窗口管理器。

$ yum install compiz-lxde ccsm
$ vim ~/.config/lxsession/LXDE/desktop.conf
 window_manager=openbox  # 原参数
 window_manager=compiz-lxde-emerald  # 修改为

6). GTK/Qt 程序无法切换输入法

如果遇到无法切换输入法,则检查 Fcitx 环境变量 是否已正确设置。

$ env | grep fcitx
GTK_IM_MODULE=fcitx
QT4_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx

对于兼容 XDG 的桌面环境,Fcitx 环境变量应由 imsettings 通过 /etc/X11/xinit/xinputrc 配置。

$ ll /etc/X11/xinit/xinputrc
/etc/X11/xinit/xinputrc -> /etc/alternatives/xinputrc

7). 选词框乱码

如果您碰到了 #79 的问题。可能是您启用了 "轻量界面 (fcitx-ui-light)" ,它会导致 sogou-qimpanel 不能正常显示。在 "输入法配置" -> "附加组件" 中,禁用 "轻量界面" 即可。

PS: 源里的 fcitx-cloudpinyin 可以正常使用 Google 云拼音,有了云拼音 libpinyin 之类的输入法也挺好,内存占用低。

故障排除

  • imsettings:根据 ~/.cache/imsettings/log 日志排查错误
  • Fcitx:运行 fcitx-diagnose 排查 Fcitx 错误
  • Sogou:运行 sogou-diag 收集诊断信息

参考:https://github.com/FZUG/repo/wiki/Sogou-Pinyin-%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98

4.安装中文软件包源

软件包列表

按 Fedora 版本浏览


Name Lisence Require repo Description
Input Methods
sogoupinyin Proprietary, GPLv2 fedora 搜狗拼音输入法
fcitx-rime GPLv3 fedora 中州韵输入法
fcitx-sunpinyin GPLv2+ fedora sunpinyin 输入法
fcitx-qt5 GPLv2 fedora fcitx qt5 输入模块
Multimedia
kwplayer GPLv3 rpmfusion 酷我音乐
doubanfm-qt MIT rpmfusion 豆瓣FM
musicbox MIT rpmfusion 网易云音乐 CLI
deepin-music-player GPLv3 rpmfusion 深度音乐
moonplayer GPLv3 rpmfusion Moonplayer播放器
simplescreenrecorder GPLv3 rpmfusion 屏幕录像
obs-studio GPLv2 rpmfusion 屏幕录像/流媒体直播
tragtor LGPLv2 rpmfusion FFmpeg音视频转码
Notes / Dict
wiznote GPLv3 fedora 为知笔记 stable
wiznote-beta GPLv3 fedora 为知笔记 beta
youdao-dict Proprietary fedora 有道词典 for linux
Browser / Proxy
opera-developer Proprietary fedora Opera developer
opera-beta Proprietary fedora Opera beta
opera-stable Proprietary fedora Opera stable
freshplayerplugin MIT fedora Firefox PPAPI flash 兼容插件
Downloads
bcloud GPLv3 fedora 百度云客户端
xware-desktop GPLv3 fedora 迅雷客户端
pointdownload GPLv3 fedora 点载, 支持迅雷/BT/ed2k下载
System tools
ccal LGPL fedora 命令行下的农历日历
grub4dos GPLv2 fedora grub 引导管理器
screenfetch GPLv3 fedora 系统信息收集
vim 7.4.764 vim fedora 编辑器之神,增加剪贴板/lua/py3支持
dkms-mt7601u GPL fedora MT7601U USB Wifi 驱动
System libraries
opencc ASL2 fedora 简繁转换库,修正依赖
sunpinyin LGPLv2 fedora 基于 SLM 模型的输入法引擎,更新字典
python-html2text GPLv3 fedora HTML -> ASCII
python3-xlib GPLv2 null Python3 X 库
python3-keybinder GPLv3 null Python3 键绑定库
python-mutagen GPLv2 fedora 处理音频元数据
python3-cairo LGPLv2 fedora Python3 cairo 绑定,修复 bug
pygobject3 LGPLv2+ fedora Python GObject 封装,修复 bug
deepin-ui GPLv3 fedora Deepin UI toolkit
deepin-utils GPLv3 fedora Deepin utils 库
deepin-gsettings GPLv3 fedora gsettings python 绑定
pyjavascriptcore GPLv3 fedora

pyjs

在我们安装完中文软件源后就可以安装很多软件,只需:

dnf install *(相应软件名称)

 

5.安装python 的依赖库

大家在运行python时,肯定不想被缺乏相应的函数库而困扰

我查阅了相应的资料,只需:

 

pip3 install turtle(for example)pip install turtle(for example)
pip install upgrade pip

pip 是Python通用的

而pip 3 是专门为python 3 开发的

6.googel chrome

cat << EOF > /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome - \$basearch
baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOF
dnf install google-chrome-stable
dnf install google-chrome-beta

Note for Fedora 26/25 Wayland users

If you have problems, then fallback to Xorg with modifying /etc/gdm/custom.conf file:# GDM configuration storage

[daemon]
# Uncoment the line below to force the login screen to use Xorg
WaylandEnable=false

[security]
...

首先上错误代码

Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sda5': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.
  • 首先遇到问题我们先不要惊慌,这是一个程序员的基本素质。
  • 先看看错误代码再说。
  • 进入Windows,然后正常关闭 Windows (不能是挂起/休眠、也不能是快速重启),然后再进入 Fedora 挂载分区。
    或者,用“只读”的方式挂载分区。

按照以上的解决方案,问题轻松的就解决掉了。

Fedora Utils -tweak your own Fedora

What is Fedora Utils?

Fedora Utils lets you install codecs and additional software that Fedora doesn't want to ship, like MP3 codecs, Adobe Flash, Oracle Java etc. It can also fix problems, tweak and cleanup your system, show system information and much more with just few clicks.

Installation

Fedora Utils can be installed by running the folllowing command as root,

su -c "curl http://satya164.github.io/fedorautils/fedorautils-installer -o fedorautils-installer && chmod +x fedorautils-installer && ./fedorautils-installer"

The Fedora Utils repository ensures that Fedora Utils is always up-to-date and all the new features and bug fixes are delivered to you automatically.

Tips & tricks

In addition to the GUI, you can also use Fedora Utils in bash scripts to help you install software and tweak the sytsem automatically. See fedorautils --exec list for a list of commands you can use in bash scripts.

Fedora Utils saves the downloaded files. Have to do the same steps on more than one system? You won't need to redownload the files again. Fedora Utils can use previously downloaded files with ease. Combine this with the scripting ability, and configuring multiple systems becomes a lot easier.

Fedora Utils is extensible via plugins. Writing a plugin is easy and fun.

More info

Fedora Utils is released under GNU GPL V3.0 and the source code is publicly available on GitHub. Feel free to make modifications and contributions.

If you like Fedora Utils, please support us by spreading the word. You can catch me on Google+ or Facebook. Also check my blog and deviantArt page :)


Fedora Utils © 2012 Satyajit Sahoo. Fedora™ is a trademark of Red Hat. All rights reserved.

This tool is really a useful one.I do want to share with you guys.

不知道是怎么回事,在家里用终端升级不行了,每隔几分钟就掉一次线(timeout),速度一直都是5kb或几百b,然后就是无穷无尽的等待之中。。。

我最受不了的就是无穷无尽的等待了。

于是乎就换了许多源

比如说163、sohu....

可结果还是这样。。

然后我一气之下,就把所有的源都给删除了。这样源就下载不了东西了。可是事情有了转机。。。

我重新建了2个中国大学的源。

一个是上海交大的,一个是中科大的。(这两个速度都不错,但是我个人偏向于上海交大的(ftp),这里就不解释了)

闲话不多说了,以下是我的解决方法:

fedora中的yum源列表不像ubuntu那样全在一个sources.list文件中,而是每个源对应一个.repo文件,(这样分开管理会方便一些)它们都放在同一个目录下,路径是:


/etc/yum.repos.d/

首先应该使用gedit新建一个空文档。然后将源的代码复制进去。最后再将你复制的源的代码对应上相对应的名字。

比如说上海交大的就叫 sjtu.repo              中科大的就叫 ustc.repo


首先是上海交通大学的

[Fedora-ftp.sjtu.edu.cn]
name=Fedora 17 – x86_64
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/17/Fedora/x86_64/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
[Everything-ftp.sjtu.edu.cn]
name=Everything 17 – x64_64
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/17/Everything/x86_64/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
[updates-ftp.sjtu.edu.cn]
name=Fedora updates
baseurl=http://ftp.sjtu.edu.cn/fedora/linux/updates/17/x86_64/
enabled=1
gpgcheck=0

注:如果是i386就要把上面所有的x86_64改成i386


中科大的yum源

[Fedora-mirrors.ustc.edu.cn]
name=Fedora 17 – i386
baseurl=http://mirrors.ustc.edu.cn/fedora/linux/releases/17/Fedora/i386/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
[Everything-mirrors.ustc.edu.cn]
name=Everything 17 – i386
baseurl=http://mirrors.ustc.edu.cn/fedora/linux/releases/17/Everything/i386/os/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
[updates-mirrors.ustc.edu.cn]
name=Fedora updates
baseurl=http://mirrors.ustc.edu.cn/fedora/linux/updates/17/i386/
enabled=1
gpgcheck=0

注:这个与上面相反。


将自己创建的源创建好后,需要打开终端,用su,输入密码,去的超级用户的权限。之后用cd打开你将刚才的文档保存的文件夹。

cd 文件路径
ls
mv ustc.repo sjtu.repo /etc/yum.repos.d/

最后

yum makecache

显示元数据库已建立就好了


注意:yum makecache时出现yum update时候出现Another app is currently holding the yum lock解决方法

yum被锁定了。 可以通过执行rm -rf /var/run/yum.pid 来强行解除锁定

如何在fedora17上安装Texlive?

   在Linux系统中我们最常用的TEX套装也许就是Texlive了。那么我们该如何安装它呢?虽然在Fedora官方源中也有它,不过只是个2007版,而且也没有中文配置……

一下是我的安装命令:

pkcon install texlive texlive-latex texlive-xetex texlive-ctex 
#因为是fedorapeople,所以速度超慢

 

这样就安装到带有ctex-kit包的TeXLive!

如果你需要ctex要用的中文字体,可以下在这里的奥多比中文字体集并安装。

可以正常在Linux下使用带有中文支持的咯!