Ubuntu&Fedora装机&Mac装机(UOS装机将会持续更新)

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
243750496
帖子: 1038
注册时间: 2012-06-09 15:40

Re: Ubuntu&Fedora装机&Mac装机(Mac装机将会持续更新)

#361

帖子 243750496 » 2017-03-13 15:37

五、
1、nvidia驱动安装(独显用户请进)
先在bios里把集显禁掉如果你是双显卡(不然发热严重!)
我的thinkpad T430 是开机狂按F1然后进入bios按方向键选择config—》Display->Graphics Device:Discrete Grap

OS Detection for NVIDIA Optimus:Disabled 按F10(Save and Exit)根据自己的bios视情况而定
在软件源右侧的附加驱动中选择313版本安装
(闭源驱动比较好当然你也可以选择.run的驱动
下面提供.run安装教程:
下载好后放在主目录下改名qd.run 然后把开源驱动加入黑名单中: 打开终端 sudo /etc/modprobe.d/blacklist.conf 在打开文件末尾新建一行加入:
blacklist nouveau保存并关闭 重启
进不了桌面? 显示 run in low-graphics mode .....?
ctrl+alt+F1看有没有XX login即输入你的账户名称
没有?按几下回车就有了 然后password是输入密码 输完敲回车 继续输入sudo start lightdm 输便密码就进去了(当然其实进不去最好了输入密码敲回车后直接输入sudo sh qd.run 然后好像基本上都选yes除了开头那个好像是no反正你看着如果开头那个选yes就不能安了就选no 后面的反正都是yes )对了英伟达公司的闭源驱动比开源驱动好 ATI的开源驱动比闭源的好)
(如果你安.run文件后)
安装完后重启后找到
NVIDIA X server Settings ->X Server Display Configuration->Save to X Configuration File ->Browse 最上方选择 / 然后在左边找到etc双击,找到X11双击,最下面输入xorg.conf点击保存
打开终端输入sudo gedit /etc/X11/xorg.conf
找到Section "Device"在EndSection前添加:
Option "NoLogo"
Option "RegistryDwords" "EnableBrightnessControl=1"
(注:开启亮度调节)
注意:
最左侧对齐(新加的命令和之前的左对齐)!不然会导致
用wine 模拟photoshop CS4时崩溃(一运行就注销)
Option "NoLogo" "True" 中true是多余的添加后好像也会导致崩溃
-----------------------------------------------------------------------------------------------------------------------------------------------------
调整分辨率(不然关机很难看)
原文地址:http://idyllictux.wordpress.com/2010/04 ... ed-driver/
现简述解决过程:
1. 确认grub和plymouth的系统配置文件是原始状态,没有应用过其它的修改方案。
2. 安装v86d和hwinfo包,下面我们要用到:
代码:
sudo apt-get install v86d hwinfo

3. 查看自己显卡支持的分辨率:
代码:
sudo hwinfo --framebuffer

引用:
> hal.1: read hal dataprocess 2597: arguments to dbus_move_error() were incorrect, assertion "(dest) == NULL || !dbus_error_is_set ((dest))" failed in file ../../dbus/dbus-errors.c line 282.
This is normally a bug in some application using the D-Bus library.
libhal.c 3483 : Error unsubscribing to signals, error=The name org.freedesktop.Hal was not provided by any .service files
02: None 00.0: 11001 VESA Framebuffer
[Created at bios.464]
Unique ID: rdCR.gPBMypaP+07
Hardware Class: framebuffer
Model: "NVIDIA GeForce
"
Vendor: "NVIDIA Corporation"
Device: "NVIDIA GeForce
"
SubVendor: "NVIDIA"
SubDevice:
Revision: "Chip Rev"
Memory Size: 14 MB
Memory Range: 0xf1000000-0xf1dfffff (rw)
Mode 0x0300: 640x400 (+640), 8 bits
Mode 0x0301: 640x480 (+640), 8 bits
Mode 0x0303: 800x600 (+800), 8 bits
Mode 0x0305: 1024x768 (+1024), 8 bits
Mode 0x0307: 1280x1024 (+1280), 8 bits
Mode 0x030e: 320x200 (+640), 16 bits
Mode 0x030f: 320x200 (+1280), 24 bits
Mode 0x0311: 640x480 (+1280), 16 bits
Mode 0x0312: 640x480 (+2560), 24 bits
Mode 0x0314: 800x600 (+1600), 16 bits
Mode 0x0315: 800x600 (+3200), 24 bits
Mode 0x0317: 1024x768 (+2048), 16 bits
Mode 0x0318: 1024x768 (+4096), 24 bits
Mode 0x031a: 1280x1024 (+2560), 16 bits
Mode 0x031b: 1280x1024 (+5120), 24 bits
Mode 0x0330: 320x200 (+320), 8 bits
Mode 0x0331: 320x400 (+320), 8 bits
Mode 0x0332: 320x400 (+640), 16 bits
Mode 0x0333: 320x400 (+1280), 24 bits
Mode 0x0334: 320x240 (+320), 8 bits
Mode 0x0335: 320x240 (+640), 16 bits
Mode 0x0336: 320x240 (+1280), 24 bits
Mode 0x033d: 640x400 (+1280), 16 bits
Mode 0x033e: 640x400 (+2560), 24 bits
Mode 0x0345: 1600x1200 (+1600), 8 bits
Mode 0x0346: 1600x1200 (+3200), 16 bits
Mode 0x034a: 1600x1200 (+6400), 24 bits
Mode 0x034b: 1366x768 (+1368), 8 bits
Mode 0x034c: 1366x768 (+2736), 16 bits
Mode 0x034d: 1366x768 (+5472), 24 bits
Mode 0x0360: 1280x800 (+1280), 8 bits
Mode 0x0361: 1280x800 (+5120), 24 bits
Mode 0x0362: 768x480 (+768), 8 bits
Mode 0x0363: 848x480 (+3392), 24 bits
Config Status: cfg=new, avail=yes, need=no, active=unknown

4. 修改/etc/default/grub文件,使用uvesafb的framebuffer来启动
代码:
sudo gedit /etc/default/grub

把下面的两行
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_GFXMODE=640×480

修改为:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1366×768-24,mtrr=3,scroll=ywrap"

GRUB_GFXMODE=1366×768

5. 修改/etc/initramfs-tools/modules文件,
代码:
sudo gedit /etc/initramfs-tools/modules

添加下面这行:
uvesafb mode_option=1366×768-24 mtrr=3 scroll=ywrap

6. 运行下面的命令,启用framebuffer:
代码:
echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash

7. 运行下面的命令,更新grub配置文件:
代码:
sudo update-grub2
sudo update-initramfs -u

8. 重启。大功告成!
注:(此步有双显卡用户会有关机分辨率正常开机出现条纹(花屏)的问题,勿看)
六、超简单为 Grub 2 启动引导菜单添加背景图
安装Ubuntu Linux时如果也安装了Grub 2 启动引导菜单的,默认的菜单是黑底白字很单调,可以为它加上一个背景图片。
步骤a、下载你喜欢的图片保存好,图片的尺寸大小不限,jpg格式或png格式都可以,也许其它的图片格式也行,
步骤b、按下快捷键 Alt F2 打开“运行一个命令”对话框,输入命令,把图片复制到Grub启动目录中,例如:
代码:
sudo cp /home/cc/图片/sea.jpeg /boot/grub/sea.jpeg

步骤c、最后更新Grub 2,按下快捷键 Alt F2 打开“运行一个命令”对话框,输入:
代码:
sudo update-grub

重新启动计算机,就能看到带背景图的Grub 2 启动引导菜单了
243750496
帖子: 1038
注册时间: 2012-06-09 15:40

Re: Ubuntu&Fedora装机&Mac装机(Mac装机将会持续更新)

#362

帖子 243750496 » 2017-03-13 15:39

sudo -i
xhost +SI:localuser:lightdm
su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter background-color ''
用gnome-tweak-tool

FAQforge
Set lightdm wallpaper that is independant of the user’s wallpaper (Ubuntu/Linux Mint)
CSch Categories: Basics, Linux & Unix, Ubuntu Tags: background, change, dconf-tools, lightdm, static, user, wallpaper
Using lightdm, the wallpaper that is shown is usually the one used by the selected user. If you want to change this or just set a static wallpaper for your login screen, there are a few possibilities to do that.

1. Method

The first one is to make your wallpaper inaccessible to others, letting lightdm fall back to its default wallpaper. For this method, dconf-tools must be installed. If it isn't installed on your system yet, install it with

sudo apt-get install dconf-tools

With these tools you can easily configure lightdm - however you cannot do so in the GUI since you must be logged in as lightdm user. Do so by entering following into a terminal:

sudo xhost +SI:localuser:lightdm

sudo su lightdm -s /bin/bash

Now you can edit any of lightdm's settings with the command line - you can use the dconf GUI as reference for the paths and variable names (the dconf path to the lightdm unity greeter configuration is com>canonical>unity greeter). Set the background picture with

gsettings set com.canonical.unity-greeter background '/usr/share/backgrounds/orsomewhereelse.png'

Replace the path I use with the one to the wallpaper of your choice - it must be closed in quotation marks. You can also change the background color to black (x000000) or some other neutral color.

What happens in the login screen now is that the dconf wallpaper blinks up for a second and is then replaced by your wallpaper. To counter that, you must make your wallpaper inaccessible to other users. To do that, log in to your account again and open a terminal. Change the ownership to you instead of root if you need to (wallpapers in /usr/share... usually don't belong to you for example). Replace my username (howtoforge)and my group (howtoforge) with yours:

sudo chown howtoforge:howtoforge /usr/share/backgrounds/orsomewhereelse.png

Now right-click the wallpaper and go to the Permissions tab in the Properties menu. Set the rights of Others to None. Lightdm won't be able to access your wallpaper any longer, so it falls back to the one you specified in dconf-tools.

2. Method

The other possibility is to run

id -u

to find out your user ID and afterwards run (replace [your id] with the ID the previous command spit out (without brackets) and the path I used with the one to the wallpaper you want lightdm to display):

dbus-send --system --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User[your id] org.freedesktop.Accounts.User.SetBackgroundFile string:/path/to/wallpaper.jpg

This command has to be repeated every time you change your wallpaper and only replaces the wallpaper for one user. You can decide whether you like this method or the previous more.

To remove white dots, run the following commands in a Terminal:
去除绘制点
sudo xhost +SI:localuser:lightdm
sudo su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter draw-grid false;exit


禁用:
I don't think there is any need to revert anything. See "man xhost"
You could run this to remove lightdm from the access control list.
Code:

sudo -i
xhost -SI:localuser:lightdm

FYI these are the sequence of commands (tested in 16.04) to remove the greeter dots.
Code:

sudo -i
xhost +SI:localuser:lightdm
su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter draw-grid 'false'

You can then type in "exit" and press Enter. Repeat.
or
just close the terminal.
上次由 243750496 在 2017-04-17 12:19,总共编辑 4 次。
243750496
帖子: 1038
注册时间: 2012-06-09 15:40

Re: Ubuntu&Fedora装机&Mac装机(Mac装机将会持续更新)

#363

帖子 243750496 » 2017-03-13 15:44

answered Jan 5 '15
updated Jan 5 '15
Using gsettings, for example:

$ gsettings set org.gnome.desktop.wm.preferences button-layout 'minimize,maximize,close:'
That command will put Minimize, Maximize and Close buttons to the left. You can change the order and which buttons to use. (If you put : in front, buttons will be aligned to the right).

HTH,

Germán.
243750496
帖子: 1038
注册时间: 2012-06-09 15:40

Re: Ubuntu&Fedora装机&Mac装机(Mac装机将会持续更新)

#364

帖子 243750496 » 2017-03-16 10:13

Mini-ITX机箱:https://detail.tmall.com/item.htm?id=35 ... 6125469371
配套的12cm风扇防尘网:https://detail.tmall.com/item.htm?id=18 ... d0ltsk9f9f
配套的120水冷:https://detail.tmall.com/item.htm?id=54 ... d0ltskbfe2
12cm风扇:https://detail.tmall.com/item.htm?id=53 ... d0ltsk7183

海盗船白金统治者内存风扇:
https://item.taobao.com/item.htm?spm=a1 ... d0ltsk7183
海盗船水冷替换用风扇(非水冷原装风扇)3只一套
https://item.taobao.com/item.htm?spm=a1 ... d0ltsk89f9
海盗船SP120(日食风扇3只套装)
https://item.taobao.com/item.htm?spm=a1 ... d0ltsk13c6

注意换新服务也要买上(第一年换新+第二年只换不修)
京东海盗船HD120(选单只带控制器(主要是为了买控制器,这个买不到,如组合买3个装请上淘宝))
http://item.jd.com/11258698860.html
京东海盗船SP120(选单只带控制器(主要是为了买控制器,这个买不到,如组合买3个装请上淘宝))
http://item.jd.com/10907719837.html

注:控制器通用!

华硕千年光盘刻录机(千年光盘读取通用,但刻录需要刻录机支持,不是所有刻录机都能刻)
https://detail.tmall.com/item.htm?spm=a ... abbucket=2
先锋蓝光刻录机:
https://item.taobao.com/item.htm?spm=a2 ... t=2#detail
蓝牙功能的wacom数位板(通过蓝牙连接,避免电池过度充电(通过usb链接同时进行充电)导致电池寿命降低)
https://detail.tmall.com/item.htm?id=54 ... d0ltsk0dd5
带实时显示的手绘屏(不带电池)
https://detail.tmall.com/item.htm?id=52 ... d0ltsk9887

注:链接中的手绘板都支持linux


https://pan.baidu.com/s/1hrAW8Aw

港行 原装正品 爱色丽 Colormunki photo 显示器校色仪 送原厂色卡
https://item.taobao.com/item.htm?spm=a1 ... d0ltska841

后期我要做linux上的色彩管理,需要用到以上两个设备+红蜘蛛(displaycal为其校色软件是GUI的没难度,难的是使用Argyllcms用命令行校色,但是Argyllcms不支持spyder print所以才需要购买爱色丽的设备,如果需要用到请注意)
罗技太阳能键盘surface(Windows)专用版
https://item.taobao.com/item.htm?id=522 ... d0ltskf912
surface使用的分线器(因为罗技太阳能键盘使用的是usb接收器不是蓝牙,所以唯一的端口被占用,另外还要接雷蛇鼠标和移动硬盘或u盘所以需要分线器,这个不需要单独供电
https://detail.tmall.com/item.htm?id=52 ... d0ltsk8c9d
上次由 243750496 在 2020-07-10 21:56,总共编辑 13 次。
243750496
帖子: 1038
注册时间: 2012-06-09 15:40

Re: Ubuntu&Fedora装机&Mac装机(Mac装机将会持续更新)

#365

帖子 243750496 » 2017-03-18 18:04

https://pan.baidu.com/s/1b7eMIi
http://askubuntu.com/questions/9867/how ... nome-shell

If you're using Gnome Shell and you want the window buttons on the left, use this command:

dconf write /org/gnome/shell/overrides/button-layout "'close,minimize,maximize:'"
Then restart the shell if needed: press Alt+F2, type r and press Enter.


To set the icons you can use dconf-editor or:

gsettings set com.solus-project.budgie-wm button-layout 'close,minimize,maximize:appmenu'
For the gnome windows (like settings) it's:

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/ShellShowsAppMenu': ,'Gtk/DecorationLayout': <'close,maximize,minimize:menu'>}"
close,maximize,minimize:menu would be

menu:minimize,maximize,close
if you want it the other way around. Then, if you did not have it:

sudo apt install gnome-tweak-tool
Start it, set the themes under appearance and enjoy the eye candy :). Thanks for sharing the PPA's!

[edit] I noticed that you can start Budgie Welcome from the start menu. Start it and click default settings. Then you have the option to install the Arc and Material Design themes. It seems the Material Design is the one with the transparency. Click install and then Apply. [/edit]


gsettings set com.solus-project.budgie-wm button-layout 'close,minimize,maximize:appmenu'
gsettings set com.solus-project.budgie-helper.workarounds fix-button-layout 'close,minimize,maximize:menu'
上次由 243750496 在 2017-04-04 20:26,总共编辑 8 次。
243750496
帖子: 1038
注册时间: 2012-06-09 15:40

Re: Ubuntu&Fedora装机&Mac装机(Mac装机将会持续更新)

#366

帖子 243750496 » 2017-03-30 17:10

Ubuntu budgie 17.04安装指南

NVIDIA X配置文件路径 /etc/X11/xorg.conf
(配置文件路径有时候会是空白的 选择此路径即可)

编译源码安装并生成deb包:
auto-apt run ./configure
make
sudo checkinstall

curl https://s3-us-west-2.amazonaws.com/brave-apt/keys.asc | sudo apt-key add -
echo "deb [arch=amd64] https://s3-us-west-2.amazonaws.com/brave-apt `lsb_release -sc` main" | sudo tee -a /etc/apt/sources.list.d/brave-`lsb_release -sc`.list
sudo apt-get update

sudo apt-get install python-pip python-dev build-essential exfat-utils gir1.2-webkit-3.0 checkinstall auto-apt libglu1-mesa:i386 network-manager-openvpn-gnome network-manager-openvpn phablet-tools android-tools-adb btrfs-tools dmsetup e2fsprogs f2fs-tools dosfstools hfsutils hfsprogs jfsutils mdadm util-linux lvm2 ntfs-3g reiser4progs reiserfsprogs xfsprogs nfs-common nfs-kernel-server gparted seahorse testdisk rar unrar synaptic python3-pip flashplugin-installer brave
sudo apt-get remove chromium-browser
cd ~/Downloads
wget -O brave.deb https://laptop-updates.brave.com/latest/dev/ubuntu64
sudo dpkg -i brave.deb

sudo pip install --upgrade pip
sudo pip3 install --upgrade pip
sudo pip remove python2
python setup.py install --record log
cat log | xargs rm -rf
python ./setup.py install --record install.txt
cat install.txt | xargs rm -rf
sudo pip install *.tar.gz
pip search *


https://sourceforge.net/projects/ffmulticonv/
sudo pip3 install ffmulticonverter-1.8.0.tar.gz

sudo mkdir /usr/lib/pepperflashplugin-nonfree/
sudo cp /usr/lib/adobe-flashplugin/manifest.json /usr/lib/pepperflashplugin-nonfree/
sudo cp /usr/lib/adobe-flashplugin/libpepflashplayer.so /usr/lib/pepperflashplugin-nonfree/
然后就可以再brave中启用flash插件了


文件浏览器显示PSD脚本:

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#!/bin/bash

# -----------------------------------------------------------
# -- Write psdthumbnailer
# -----------------------------------------------------------
OUTFILE=/usr/lib/psdthumbnailer
(
sudo cat <<'EOF'
# bin/bash
# Arguments / Parameters %i %o %s
f_in=$1
f_out=$2
f_size=$3
# Execute Convert PSD to PNG through ImageMagick
exec convert "psd:$f_in[0]" -scale "$f_sizex$f_size" "png:$f_out"
EOF
) > $OUTFILE
# -----------------------------------------------------------
# -- Write photoshop.thumbnailer
# -----------------------------------------------------------
OUTFILE=/usr/share/thumbnailers/photoshop.thumbnailer
(
sudo cat <<'EOF'
# bin/bash
[Thumbnailer Entry]
TryExec=/usr/lib/psdthumbnailer
Exec=/usr/lib/psdthumbnailer %i %o %s
MimeType=image/vnd.adobe.photoshop; image/x-photoshop; image/x-psd;
EOF
) > $OUTFILE
# -----------------------------------------------------------
# -- Set File Permissions
# -----------------------------------------------------------
sudo chmod 0755 /usr/lib/psdthumbnailer
sudo chmod 0644 /usr/share/thumbnailers/photoshop.thumbnailer

# -----------------------------------------------------------
# -- Add GConf Hooks to parse thumbnails
# -----------------------------------------------------------
sudo gconftool-2 --set /desktop/gnome/thumbnailers/image@vnd.adobe.photoshop/enable --type bool true

sudo gconftool-2 --set /desktop/gnome/thumbnailers/image@vnd.adobe.photoshop/command --type string "/usr/lib/psdthumbnailer %i %o %s %i %o %s"

# -----------------------------------------------------------
# -- Install Dependencies
# -----------------------------------------------------------

sudo apt-get install imagemagick

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

显示XCF命令:
To get XCF thumbnails in Nautilus, firstly install gnome-xcf-thumbnailer. In Ubuntu, use the following command:
sudo apt-get install gnome-xcf-thumbnailer

At this point the the thumbnails don't work yet because GNOME XCF Thumbnailer doesn't install a .thumbnailer file, required by Nautilus 3.x. To fix this, use the following commands:
sudo mkdir -p /usr/share/thumbnailers/
echo -e "[Thumbnailer Entry]\nTryExec=gnome-xcf-thumbnailer\nExec=gnome-xcf-thumbnailer %i %o\nMimeType=image/x-xcf;image/x-compressed-xcf;" | sudo tee /usr/share/thumbnailers/gnome-xcf.thumbnailer
New XCF files (or if you move some already existing XCF files) should have thumbnails now but existing ones may not get thumbnails yet. Let's fix this too by removing the failed thumbnails from cache:
rm -r ~/.thumbnails/fail
rm -r ~/.cache/thumbnails/fail

That's it. Nautilus should now display XCF file thumbnails, as you can see in my screenshot above. I've tested this with Nautilus
3.4
, 3.6 and 3.8.

窗口最大化最小化关闭按钮左置

sudo apt-get install gnome-tweak-tool


answered Jan 5 '15
updated Jan 5 '15
Using gsettings, for example:

$ gsettings set org.gnome.desktop.wm.preferences button-layout 'minimize,maximize,close:'
That command will put Minimize, Maximize and Close buttons to the left. You can change the order and which buttons to use. (If you put : in front, buttons will be aligned to the right).

HTH,

Germán.


用户与群组
sudo apt-get install gnome-system-tools

为ryzen处理器和Nvidia.run驱动打补丁
补丁链接(适用于375.39和318.13):
cd ~/Downloads
sh *.run --extract-only
cd N*39/13(注:375.39/378.13)
wget https://pkgs.rpmfusion.org/cgit/nonfree ... 4.10.patch
或者
patch -p1 <<< $(curl https://pkgs.rpmfusion.org/cgit/nonfree ... 4.10.patch)(注:curl)
patch -p1 < ./kernel*.patch(注:wget)
sudo update-initramfs -u
sudo reboot
切换到tty1
sudo service lightdm stop(一定要有service!)
cd ~/Downloads/N*39/13(注:375.39/378.13)
sudo ./nvidia-installer


英伟达官方.run驱动安装

maybe it is too late ,but hope can help for others. the follow tips worked for ubuntu 16.04 and elementary os 0.4.

remove all nvidia packages ,skip this if your system is fresh installed

sudo apt-get remove nvidia* && sudo apt autoremove
install some packages for build kernel:

sudo apt-get install dkms build-essential linux-headers-generic
now block and disable nouveau kernel driver:

sudo gedit /etc/modprobe.d/blacklist.conf
Insert follow lines to the blacklist.conf:

blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
save and exit.

Disable the Kernel nouveau by typing the following commands(nouveau-kms.conf may not exist,it is ok):

echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
build the new kernel by:

sudo update-initramfs -u
reboot



As the error states, you are still running an X server. This error occurs when you try to install the Nvidia .run files while logged in.

Make sure you are logged out.

Hit CTRL+ALT+F1 and login using your credentials.
kill your current X server session by typing sudo service lightdm stop or sudo lightdm stop
Enter runlevel 3 by typing sudo init 3 and install your *.run file.
You might be required to reboot when the installation finishes. If not, run sudo service lightdm start or sudo start lightdm to start your X server again.

sudo sh /usr/bin/nvidia-bug-report.sh
sudo nvidia-xconfig -sli=on -multigpu=on

apt-cache policy gparted
sudo snap install --edge --devmode gallery-app

[功能]

ubuntu下面的软件包管理工具。


[举例]

目前常用的

==========

*更新本机中的数据库缓存:

sudo apt-get update


*查找包含部分关键字的软件包:

sudo apt-cache search <你要查找的name>


*安装指定的软件:

sudo apt-get install <你要安装的软件包>


*下载软件包源代码(如果有的话):

apt-get source <你要下载的源代码包名>



详细的资料

=========

http://www.debian.org/doc/manuals/apt-h ... ng.en.html

apt-get:


安装和卸载------

*更新本机中的数据库缓存:

sudo apt-get update

最好定期更新一下使你自己机器上面的数据和服务器(/etc/apt/sources.list列出)上面的信息保持一致,在安装软件之前可以运行一下这个命令保证成功性。


*安装软件:

#apt-get install packagename

这里将安装你需要的在sources.lists中的最新的软件包,如果有其他依赖则自动安装相应的依赖软件包。packagename可以是多个软件包。

一些有用的选项:

-h This help text.

-d Download only - do NOT install or unpack archives

-f Attempt to continue if the integrity check fails

-s No-act. Perform ordering simulation

-y Assume Yes to all queries and do not prompt

-u Show a list of upgraded packages as well


*卸载软件(用install):

#apt-get install packagename-

在需要卸载的包后面加上一个'-'(我没有实验过),当然可以apt-get install p1 p2-这样多个命令合并了,装p1卸p2。


*卸载软件2:

#apt-get remove packagename

这会卸载相应的软件,同时也会卸载依赖的部分,没办法指定不卸载依赖的。但是软件的配置文件还是会留在系统中。


*完全卸载软件包括删除配置:

#apt-get --purge remove packagename

这样配置文件也会被删除。


*安装软件2(用remove):

#apt-get remove packagename+

这个和用install来卸载软件的意义类似,在包名称后面添加一个+,表示安装。


*修复或者只安装最新版本:

#apt-get --reinstall install packagename

这里,如果你的软件包被破坏了,或者你想要安装一个最新的软件,运行这个。


升级软件包------

*升级软件包1:

#apt-get -u upgrade

这里加上-u选项列出将要升级的软件,可能会提示有些软件不会升级,因为可能会破坏依赖关系,更好的方法是利用apt-get dist-upgrade

你可以通过cd或者添加源地址来更新,如果你想从cd来升级,首先运行apt-cdrom把cd中的软件添加到/etc/apt/sources源中,然后运行apt-get dist-upgrade来升级,但是因为apt-get总是使用最新版本,如果cd中的不是最新的版本,那么也不会用到cd。


*升级软件包2:

#apt-get -u dist-upgrade

这样安装的软件前面apt-get -u upgrade安不了的也会安装了,但个别的仍然不能安装,例如:升级会导致需要卸载一些包,卸载这些包会导致另外的软件不能用,所以就不升级了。


*升级软件包3:

#apt-get -u install packagename

假设前面升级的时候packagename无法升级,那么这个命令会升级packagename如果需要卸载默写模块而卸载这些模块导致一些软件无法使用,那么干脆把这些软件都卸载了,然后升级,这个命令会导致packagename最终升级了。


清理没用的包文件------

用apt-get 安装软件包的时候,apt会从/etc/apt/sources.list里面将相应的软件包恢复出来,把它们存放在一个本地的文档库中(/var/cache/apt/archives/)然后才开始安装,随着时间的增长,这将不断地消耗硬盘的空间。


*清理所有的缓存文件:

#apt-get clean

这会清理所/var/cache/apt/archives/ 和 /var/cache/apt/archives/partial/中没有被锁定的文件。当然你再次安装软件的时候,这个软件又被恢复到本地文档库中了。


*仅仅清理旧的缓存文件:

#apt-get autoclean

这会清理旧版本的/var/cache/apt/archives/ 和 /var/cache/apt/archives/partial/中的文件。旧版本是指已经有更新的版本的软件了,再下载的话应下载最新的而不是这个旧版本的了。根据apt-show-versions -p可以知道哪些是旧的。


*安装指定版本的软件包:

# apt-get install package=version


查找信息--------


*查找一个含有packagename字符串的包:

#apt-cache search packagename

这样将输出所包含packagename字符串的包。


*显示软件包的详细信息:

# apt-cache show stella

这包含了软件包许多的信息,例如如果你已经安装了这个软件包,信息里面也会显示。


*显示软件包的大致信息:

apt-cache showpkg packagename

这会显示大致的信息。


*查看那些包可以升级的信息:

$ apt-show-versions -u

这个apt-show-versions工具需要安装一下的。


*查看当前特定软件版本:

apt-show-versions -p packagename


*检查packagename依赖的包:

#apt-cache depends packagename


工作相关--------


*安装编译源代码需要的库(包):

# apt-get build-dep packagename

所的源代码包一个'Build-Depends'域,指明了从源代码编译这个包需要安装的软件。上面的命令可以下载这些包,其中'packagename'是包名。



*查看编译一个包需要哪些其他的库(包):

#apt-cache show packagename

如果你只是想要检查编译一个包需要哪些其他的包,那么可以利用上面的命令,其中'packagename'是包名。



*下载包packagename的源代码:

$ apt-get source packagename

这将在当前目录下载个文件:*.orig.tar.gz,*.dsc,*.diff.gz。如果这个包是debian的,那么最后一个文件没有,并且第一个文件名里面不包括"orig"字符串。

.dsc文件被dpkg-source使用,把源代码包解压到目录 packagename-version.每一个下载的源代码包里面都有一个debian/目录,这个目录包含了用于创建.deb包的文件。



*下载的时候自动把源代码包编译:

$ apt-get -b source packagename

可能是编译成.deb包,我没有试过。


*根据下载的源代码创建deb包:

$ dpkg-buildpackage -rfakeroot -uc -b

如果你决定在下载的时候不创建deb包,你可以以后通过在下载的包之后创建的目录里面运行这个命令来创建。


*直接利用包管理器安装包:

# dpkg -i file.deb

需要直接使用包管理器,运行这个命令来安装包。


-------dpkg查找


*已知软件包中有一个文件,根据文件查找软件包:

# dpkg -S stdio.h

输入之后,输出如下:

libc6-dev: /usr/include/stdio.h

libc6-dev: /usr/include/bits/stdio.h

perl: /usr/lib/perl/5.6.0/CORE/nostdio.h

这在知道包中某些文件的时候,来根据文件查找软件包这种情况下非常用。


*查找安装在你的机器上面的软件包:

dpkg -l


*自动安装缺失的软件:

# auto-apt run command

这里,command是你要运行的命令。例如 auto-apt run ./configure .当缺失依赖软件的时候,它会询问你安装,方便了编译。安装之后会继续运行。auto-apt需要保持一个最新的数据库,利用这个命令进行更新:auto-apt update, auto-apt updatedb and auto-apt update-local。


--------apt-get查找


*利用apt-file根据文件名查找相应的软件包:

$ apt-file search filename

如果你只知道程序名字filename,那么你可以运行这个命令,它的工作方式和 dpkg -S差不多,就是根据某个软件包里可能包含的文件来查找这个软件包的名字。另外,它也会显示包含这个文件的没有安装的软件包。当你编译的时候,提示缺了什么头文件的时候,利用这个很方便地确定需要装哪些软件包(当然利用audo-apt更方便).


*列出一个软件包中包含的文件:

$apt-file list packagename

这里,apt-file是根据一个数据库来读取信息的,所以需要保持数据库是最新的。


*更新apt-file的数据库:

# apt-file update

默认情况下,apt-file的数据库和auto-apt是一样的。

必装软件

sudo apt-get install ardour audacity bleachbit blender brasero cecilia converseen deluge fcitx firefox freecad gimp goldendict guvcview guitarix hydrogen kazam krita librecad lives lmms meterbridge mixxx musescore openshot scribus virtualbox pitivi playonlinux rawtherapee rednotebook rosegarden soundconverter truecrypt uget tuxguitar vlc gnome-tweak-tool dconf-editor

需要手动安装

nutstore nod32 sougoupinyin crossover displaycal ffmulticonverter Goldendict词典文件 ue4 qt steam wicreset wiznote gitter


使用dconf Editor更改最大化、最小化、关闭和菜单按钮的位置

/org/gnome/settings-daemon/plugins/xsettings/overrides:
{'Gtk/ShellShowsAppMenu': <0>, 'Gtk/DecorationLayout': <'minimize,close,maximize:menu'>}

/org/gnome/desktop/wm/preferences/button-layout:
minimize,close,maximize:

/com/solus-project/budgie-wm/button-layout:
minimize,close,maximize:menu
minimize,close,maximize:appmenu


UE4 Depends
sudo apt-get install build-essential mono-mcs mono-devel mono-xbuild mono-dmcs mono-reference-assemblies-4.0 libmono-system-data-datasetextensions4.0-cil libmono-system-web-extensions4.0-cil libmono-system-management4.0-cil libmono-system-xml-linq4.0-cil cmake dos2unix clang-4.0 libfreetype6-dev libgtk-3-dev libmono-microsoft-build-tasks-v4.0-4.0-cil xdg-user-dirs


Vyprvpn设置教程
Setup the PPTP connection

Expand the connection menu by clicking the up/down arrow icon in the system taskbar. Then, click on Edit Connections to open the Network Connections control panel.
Click the Add button to add a new VPN configuration.
When prompted to choose a connection type, choose Point-to-Point Tunneling Protocol (PPTP) and click the Create button.
In the Connection name: textbox, enter "VyprVPN (PPTP)"
In the Gateway field enter one of the following server hostnames. View the list of server addresses here.
In the User name: textbox, enter your login.
In the Password: textbox, enter your password.
Click the Advanced button to bring up an additional settings dialog.
Check the Use Point-to-Point encryption (MPPE) box.

Click the OK button
Click the Save button (you may be prompted to enter your password to store the configuration securely)
Restart Network Manager (The best way we have found to restart Network Manager is to open a terminal and type "sudo restart network-manager". This will disconnect all of your network connections)
Establish a secure connection

In the system taskbar, click on the up/down arrow icon to bring up the connection menu.
Mouse over VPN Connections and select VyprVPN (PPTP).
After a few seconds, you will receive a pop-up notification that the connection has been established.
You can check your IP here:https://www.goldenfrog.com/whatismyipaddress

VyprVPN Free accounts are limited to using our Desktop and Mobile applications to connect to our VPN service. Please see "What is VyprVPN Free?" for more information.

Follow the steps below to configure OpenVPN on your Ubuntu machine. This tutorial was created using Ubuntu 16.04.1.

1. Open Terminal, which you can find by using the Ubuntu search feature.

2. Type the following command string and press Enter:

sudo apt-get install -y network-manager-openvpn network-manager-openvpn-gnome

This will install the necessary OpenVPN packages on the machine and add OpenVPN as an option in the desktop VPN configuration menu.



3. Restart network-manager by typing the following command and pressing Enter:

sudo service network-manager restart



4. Download the Golden Frog CA certificate and place it in the OpenVPN folder on your machine by typing the following command and pressing Enter. Ignore line breaks. This is one single command.

sudo wget https://support.goldenfrog.com/hc/artic ... pn.com.crt /etc/openvpn



5. Configure the OpenVPN connection by opening Network Connections. You can locate this by using the Ubuntu search feature.

6. Click Add.

7. Under VPN in the drop-down, choose OpenVPN and click Create.



8. Edit the information in the configuration screen as follows:

Connection name: VyprVPN
Gateway: Enter a server address. View a list of server addresses here.
Type: Select Password
Username: Your Golden Frog account email address
Password: Your Golden Frog account password
CA Certificate: Browse to /etc/openvpn and select ca.vyprvpn.com.crt


9. Click Advanced.

10. Check the option for Use LZO data compression and click OK.



11. Click Save.

How to Connect and Disconnect:

1. Click the Network Connections icon at the top of your desktop in right area of the menu bar. It will generally look like two arrows opposite each other or a WiFi signal.

2. Scroll down to VPN Connections.

3. Click VyprVPN and wait for the connection to establish.



4. You will see a pop-up once connected. Additionally, a lock icon will appear by your network icon in the top menu bar.



5. To disconnect any any time, navigate back to the Network Connections drop-down in the top menu bar, click VPN Connections, and then click Disconnect VPN.

6. Enjoy VyprVPN on your Ubuntu machine!

添加nvidia驱动ppa:

代码: 全选

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update

9.3. Run levels

A run level is a state of init and the whole system that defines what system services are operating. Run levels are identified by numbers. Some system administrators use run levels to define which subsystems are working, e.g., whether X is running, whether the network is operational, and so on. Others have all subsystems always running or start and stop them individually, without changing run levels, since run levels are too coarse for controlling their systems. You need to decide for yourself, but it might be easiest to follow the way your Linux distribution does things.

The following table defines how most Linux Distributions define the different run levels. However, run-levels 2 through 5 can be modified to suit your own tastes.

Table 9-1. Run level numbers

0 Halt the system.
1 Single-user mode (for special administration).
2 Local Multiuser with Networking but without network service (like NFS)
3 Full Multiuser with Networking
4 Not Used
5 Full Multiuser with Networking and X Windows(GUI)
6 Reboot.

sudo apt-get install xserver-xorg-input-wacom (必须是3.4才有PTH660 K1F驱动)
然后打开蓝牙选择BTIntousPro M
注:LEIntousPro M不需要连连上了会立马断掉
wacom cintiq如果使用的话是不可以连接显示器的(显示器和wacom新帝冲突),但是不需要高版本驱动



软件的ppa Ubuntu 17.04已经正式发布但是有些ppa 仍然不能用但是先发上来省的去爬楼了(需要的话)
sudo apt-get install gir1.2-webkit-3.0 for Anoise bug
sudo add-apt-repository ppa:costales/anoise
sudo add-apt-repository ppa:wiznote-team
sudo add-apt-repository ppa:deluge-team
sudo add-apt-repository ppa:dhor/myway (rawtherapee)
sudo add-apt-repository ppa:otto-kesselgulasch/gimp-edge
sudo add-apt-repository ppa:freecad-maintainers/freecad-daily,(sudo add-apt-repository -y ppa:freecad-maintainers/freecad-stable)
sudo add-apt-repository ppa:librecad-dev/librecad-daily,(sudo add-apt-repository ppa:librecad-dev/librecad-stable)
sudo add-apt-repository ppa:thomas-schiex/blender
sudo add-apt-repository ppa:dimula73/krita
sudo add-apt-repository ppa:scribus/ppa
sudo add-apt-repository ppa:libreoffice/ppa
sudo add-apt-repository ppa:noobslab/apps,(curlew)
sudo add-apt-repository ppa:ubuntuhandbook1/apps,(converseen)
sudo add-apt-repository ppa:plushuang-tw/uget-devel,(uget)
sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa,(firefox)

全新安装应该安装的软件(命令)
sudo apt-get install unity-tweak-tool vlc wiznote smplayer anoise* soundconverter deluge indicator-china-weather synaptic gnome-color-manager kazam lives scribus-trunk rar unrar ark playonlinux brasero blender krita3-testing gimp gimp-gmic rawtherapee-unstable freecad-daily librecad libreoffice curlew bleachbit gimp-ufraw ufraw-batch converseen goldendict uget firefox gnome-raw-thumbnailer

通过添加ppa升级应用:
卸载:freecad 安装 freecad-daily
安装:gimp-ufraw ufraw-batch
卸载:scribus 安装 scribus-trunk

gimp相关插件安装:
sudo apt-get install gimp-lensfun gimp-plugin-registry gimp-texturize icc-profiles gimp-ufraw ufraw-batc
上次由 243750496 在 2017-07-28 14:03,总共编辑 66 次。
243750496
帖子: 1038
注册时间: 2012-06-09 15:40

Re: Ubuntu&Fedora装机&Mac装机(Mac装机将会持续更新)

#367

帖子 243750496 » 2017-04-12 12:16

更新驱动使PTH660数位板蓝牙模式正常工作


参考文章1:http://linuxwacom.sourceforge.net/wiki/ ... nput-wacom
安装input-wacom(目前与现有4.10 kernel冲突,所以暂时无法安装):
下载:https://sourceforge.net/projects/linuxw ... put-wacom/
中的需要的版本
sudo apt-get install linux-headers-$(uname -r) build-essential # on Debian, Ubuntu, Mint

tar xjvf input-wacom-<version number>.tar.bz2

auto-apt run ./configure
make
sudo checkinstall

安装:xf86-input-wacom
参考文章2:http://linuxwacom.sourceforge.net/wiki/ ... nput-wacom
下载https://sourceforge.net/projects/linuxwacom/files/latest/download

sudo apt-get install autoconf pkg-config make xutils-dev libtool xserver-xorg-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libudev-dev systemd

auto-apt run ./configure --prefix=/usr
make
sudo checkinstall

安装libwacom
参考文章3:http://linuxwacom.sourceforge.net/wiki/ ... p/Libwacom
On Ubuntu:

sudo apt-get build-dep libwacom

or

sudo apt-get install libgudev-1.0-dev libxml++2.6-dev

下载所需文件:https://sourceforge.net/projects/linuxw ... /libwacom/

./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu/
sudo checkinstall

After building, copy the libwacom data files in to /usr/share/libwacom:

sudo cp -r /home/<path>/libwacom/data/* /usr/share/libwacom/
or
sudo cp -r /home/<path>/linuxwacom-libwacom/data/* /usr/share/libwacom/



参考原文章:http://linuxwacom.sourceforge.net/wiki/ ... /Downloads


version number does not start with digit解决办法:

代码: 全选

For me on (L)Ubuntu 15.10, it was as simple as changing the version, from "stable" to "1":

*****************************************
**** Debian package creation selected ***
*****************************************

This package will be built according to these values: 

0 -  Maintainer: [ root@anon ]
1 -  Summary: [ redis - web interface ]
2 -  Name:    [ redis ]
3 -  Version: [ stable ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ redis-stable ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ redis ]
12 - Conflicts: [  ]
13 - Replaces: [  ]

Enter a number to change any of them or press ENTER to continue: 3
Enter new version: 
>> 1

Add 'video=vesafb: off vga=normal'

on the kernel command line in the bootloader configuration file.
Q4:how to add the command
Edit the file /etc/default/grub and add the commands to the line
Code:

GRUB_CMDLINE_LINUX="video=vesafb:off vga=normal"

between the "quote marks" for example.
Then run
Code:

sudo update-grub

from a terminal to add the line to the boot configuration file.
上次由 243750496 在 2017-04-17 10:13,总共编辑 1 次。
243750496
帖子: 1038
注册时间: 2012-06-09 15:40

Re: Ubuntu&Fedora装机&Mac装机(Mac装机将会持续更新)

#368

帖子 243750496 » 2017-04-13 22:22

翻出来一个小时候写的一个游戏,算是福利放给大家

代码: 全选

#include<stdio.h>
#include<windows.h>
#include<conio.h>
#include<time.h>
main()
{
 FILE *i,*k,*d;
 int a=0,b,c=0,e=0,f=0,g=0,j=0,h=0,l=0,n=0,o=0,p=0,q=3/*命*/,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;
 long int m1=0,m2=0;
 time_t now=0;
 while(1)
 {
  B:
   switch((e>=0)&&(e<20)){case 1: f=4;b=1;h=2;break;}
   switch((e>=20)&&(e<30)){case 1: f=4;b=2;h=3;break;}
   switch((e>=30)&&(e<40)){case 1: f=4;b=3;h=4;switch(e==140){case 1:switch(x==0){case 1:q+2;x=1;u=1;break;}break;}break;}//1
   switch((e>=40)&&(e<50)){case 1: f=5;b=4;h=2;break;}
   switch((e>=50)&&(e<60)){case 1: f=5;b=5;h=3;break;}
   switch((e>=60)&&(e<70)){case 1: f=5;b=6;h=4;switch(e==140){case 1:switch(x==0){case 1:q+2;x=1;u=1;break;}break;}break;}//2
   switch((e>=70)&&(e<80)){case 1: f=6;b=7;h=3;break;}
   switch((e>=80)&&(e<90)){case 1: f=6;b=8;h=4;break;}
   switch((e>=90)&&(e<120)){case 1: switch(e>=100){case 1:b=10;break;}f=6;b=9;h=60000;switch(e==90){case 1:switch(x==0){case 1:q++;x=1;u=1;break;}break;}break;}//3
   switch((e>=120)&&(e<=130)){case 1: f=4;b=11;h=2;o=1;break;}//纵向版o为标志 
   switch((e>=130)&&(e<140)){case 1: f=4;b=11;h=3;o=1;break;}
   switch((e>=140)&&(e<150)){case 1: f=4;b=11;h=4;o=1;switch(e==140){case 1:switch(x==0){case 1:q+2;x=1;u=1;break;}break;}break;}//11
   switch((e>=150)&&(e<160)){case 1: f=5;b=12;h=3;o=1;break;}
   switch((e>=160)&&(e<170)){case 1: f=5;b=12;h=4;o=1;switch(e==140){case 1:switch(x==0){case 1:q+2;x=1;u=1;break;}break;}break;}//12
   switch((e>=170)&&(e<180)){case 1: f=6;b=12;h=2;o=1;break;}
   switch((e>=180)&&(e<200)){case 1: f=6;b=13;h=3;o=1;break;}
   switch(e>=200)
   {
    case 1:f=6;b=13;h=3;o=1;w++;switch(w>10){case 1:w=1;break;}
     switch(w==1)
     {case 1:u=10;break;
      case 0:u++;switch(u>10){case 1:u=10;break;}break;
     }
   break;
   }//13
  i=fopen("1.a","w+");//第1个文件打开
  srand(time(0));
  for(g=0;g<f;g++)
  {c=(rand()%10)+'0';fputc(c,i);}fclose(i);//第1个文件关闭
  d=fopen("3.a","w+");i=fopen("1.a","r");//第2个文件打开
  for(g=0;g<f;g++)
  {c=fgetc(i)-0;fputc(c,d);}
  fclose(d);fclose(i);rename("1.a","4.a");/*重命名*/rename("3.a","1.a");//第2个文件关闭
  d=fopen("4.a","r");n=f;m1=0;//第3个文件打开
  for(g=0;g<f;g++){c=fgetc(d)-'0';n=n-1;for(l=0;l<n;l++){c=c*10;}m1=c+m1;}
  fclose(d);remove("4.a");//第3个文件打开
  i=fopen("1.a","r");//第4个文件打开
  switch(o)
  {
   case 1:for(g=0;g<f;g++){printf("%c\n",fgetc(i));}break;
   case 0:for(g=0;g<f;g++){printf("%c",fgetc(i));}break;
  }
  now=clock();
  for(;clock()-now<CLOCKS_PER_SEC/h;);
  system("cls");fclose(i);remove("1.a");//第4个文件关闭
  k=fopen("2.a","w+");//第5个文件打开
  for(g=0;g<f;g++)
  {
   C:c=getch()-0;
    switch(c)
    {
     case 8:fclose(k);system("cls");k=fopen("2.a","r");d=fopen("4.a","w+");//第5个文件关闭,第6个文件打开
      for(r=0;r<f;r++){c=fgetc(k)-0;fputc(c,d);}fclose(k);fclose(d);//第6个文件关闭
      remove("2.a");k=fopen("2.a","w+");d=fopen("4.a","r");//第7个文件打开
      for(r=0;r<g;r++){c=fgetc(d)-0;
      switch(o)
      {
       case 1:printf("%c\n",c);break;
       case 0:printf("%c",c);break;
      }fputc(c,k);}fclose(d);remove("4.a");/*删除*/g=g-1;goto C;////////////////////////////第7个文件关闭
     default:
      switch((c>=48)&&(c<=57))
      {     
       case 0:
        switch((c==67)||(c==99))
        {
         case 1:q=q+2;switch(q>20){case 1:printf("维他命吃多了,撑死了。。。\n");q=1;m1=1;m2=2;goto D;}
         case 0:
          switch(c==45)
          {
           case 1:q=q-2;switch(q<=0){case 1:printf("维他命没了,饿死了。。。\n");q=1;m1=1;m2=2;goto D;}
           case 0:
            switch(c==13)
            {
             case 1:
              switch(g==f-1)
              {
               case 1:while(((c<48)||(c>57))&&(s==0)){c=getch()-0;t=1;};switch(t){case 1:goto E;}break;
               case 0:goto C;
              }break;
             case 0:goto C;
            }break;
          }break;
        }break;
       case 1:
        switch(g==f-1)
        {
         case 1:
          switch(s)
          {
           E:case 0:s=1;fputc(c,k);
            switch(o)
            {
             case 1:printf("%c\n",c);break;
             case 0:printf("%c",c);break;
            }
          break;
          }
         switch(t==1)
         {
          case 0:goto C;
          case 1:c=getch()-0;while(c!=13){c=getch()-0;}break;
         }
         case 0:fputc(c,k);
          switch(o)
          {
           case 1:printf("%c\n",c);break;
           case 0:printf("%c",c);break;
          }break;
        }break;
      }break;
    }
  }o=0;s=0;t=0;system("cls");fclose(k);//第5个文件关闭
  k=fopen("2.a","r");n=f;m2=0;//第8个文件打开
  for(g=0;g<f;g++){c=fgetc(k)-'0';n=n-1;for(l=0;l<n;l++){c=c*10;}m2=m2+c;}fclose(k);remove("2.a");////第8个文件打开
  D:switch(m1==m2)
  {
   case 0:q--;
   switch(q==0)
   {
    case 0: printf("你还有%d条命",q);for(j=0;j<60000;j++){printf("\r");}system("cls");goto B;
    case 1: printf("Game over!");for(j=0;j<60000;j++){printf("\r");}system("cls");//清屏
   }
   switch(b)
   {
    case 1:printf("等级:星星,积分为:%d\n",e);break;
    case 2:printf("等级:月亮,积分为:%d\n",e);break;
    case 3:printf("等级:太阳,积分为:%d\n",e);break;
    case 4:printf("等级:%c,积分为:%d\n",2,e);break;
    case 5:printf("等级:%c,积分为:%d\n",14,e);break;
    case 6:printf("等级:%c,积分为:%d\n",3,e);break;
    case 7:printf("等级:%c,积分为:%d\n",12,e);break;
    case 8:printf("等级:%c,积分为:%d\n",11,e);break;
    case 9:printf("等级:%c,积分为:%d\n",5,e);break;
    case 10:
    switch(p)
    {
     case 0:printf("等级:%c,积分为:%d\n恭喜你,你晋级了!\n现在开始下一轮!!!!!\n请稍候。。。",15,e);
     for(g=0;g<10;g++){printf("%c",7);}p=1;e=120;for(j=0;j<60000;j++){printf("\r");}goto B;
     default:printf("等级:%c,积分为:%d\n",15,e);break;
    }
    case 11:printf("等级:老C,积分为:%d\n",e);break;
    case 12:printf("等级:老B,积分为:%d\n",e);break;
    case 13:printf("等级:老A,积分为:%d\n",e);break;
   }goto A;
   case 1:y++;
    switch(y)
    {
     case 40:x=0;break;
     case 70:x=0;break;
     case 120:x=0;break;
     case 150:x=0;break;
     case 170:x=0;break;
     case 200:x=0;break;
    }e++;switch(u==10){case 1:v++;switch(v==10){case 1:q=q+2;v=0;break;}break;}
   fclose(i);fclose(k);break;
  }
 }A:fclose(i);fclose(k);system("pause");
}
 
Game终结版.rar
(8.21 KiB) 已下载 117 次
243750496
帖子: 1038
注册时间: 2012-06-09 15:40

Re: Ubuntu&Fedora装机&Mac装机(Mac装机将会持续更新)

#369

帖子 243750496 » 2017-04-16 20:10

You can install Dnscrypt using ppa:shnatsel/dnscrypt PPA